[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

Title:*OLD* ALL-IN-1 (tm) Support Conference
Notice:Closed - See Note 4331.l to move to IOSG::ALL-IN-1
Moderator:IOSG::PYE
Created:Thu Jan 30 1992
Last Modified:Tue Jan 23 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:4343
Total number of notes:18308

1384.0. "COPY DISTRIBUTION LIST FROM ANOTHER ALL-IN-1 NODE" by CROCKE::YUEN () Thu Sep 10 1992 01:31

    One of our clients want to copy distribution list from a master/world
    ALL-IN-1 node, just like what mail directory is doing.
    
    I have looked at note 1046 but I don't know what is A1INFO.
    
    Thank you very much
    Banquo.
T.RTitleUserPersonal
Name
DateLines
1384.2Have I made myself intelligableCROCKE::YUENFri Sep 11 1992 00:4812
    Hi,
    
    My problem is that I want to copy all SDLs (System Distribution Lists) 
    reside on other specified ALL-IN-1 node into my node.  ALL-IN-1 now
    provides Housekeeping procedure to copy mail addresses from other ALL-IN-1
    node.  so I think these two functions are very similar and I want the
    copying of SDLs to work similar.
    
    Has anyone done that before ?
    
    Thank you very much
    Banquo.
1384.3Write something like this...IOSG::PYEGraham - ALL-IN-1 Sorcerer's ApprenticeFri Sep 11 1992 09:4323
    Although it may look like copying mail addresses and SDLs is similar,
    in fact they are completely different. If you want to do something like
    this, then you have to write it yourself (unless someone else here has
    done it before)
    
    SDLs are files in the directory pointed to by the logical
    OA$SYSTEM_LISTS. The files have those strange Znnnnnn names, but you
    could probably copy them all across to the other system and not get two
    names the same unless you were very unlucky.
    
    The pointers to the files are records in the profile, starting with "@"
    or ending with ":". You could probably loopthrough the profile and find
    all of them, and then use the TEXT FILE functions to write a script
    that you could execute on the other node to add the profile records in
    again. The fields in the profile that you would need to set are:
    
    	Full Name - permanently set to "System Distribution List"
    	Address1 - the filename of the SDL (e.g. OA$SYSTEM_LISTS:ZSBSFLW9G.DIS)
    	MAIDES - permanently set to "MAIL-LIST"
    
    Hope this helps,
    
    Graham
1384.4More problems arised, arising, will ariseCROCKE::YUENFri Sep 11 1992 10:3342
    I have already started writing something.  The first problem I
    encountered is that I cannot use <FORM PROFILE ENTRY/MODE=INQUIRE to
    examaine the content of the SDL, because I cannot enter the key in this
    form, strange!, I was already in the DEPARTMENT field when I first
    enter this form and was asked to enter the key (USER) at the same time.
    
    The 2nd problem is I don't know how to get the symbols
    OA$GT_EMD_SYS_DIST_INFO and OA$GT_MAIDES_MLIST to compare with the
    "Full Name" and "Mail Destination" in the profile record.  It doesn't
    look like a global symbol.
    
    The 3rd problem arise when I try to use OA$MAIL_ALL_DIST to get all the
    DLs into a text file instead of looking at each PROFILE record.
    When I use the FOR loop like that
    
    	FOR OA$MAIL_ALL_DIST DO -
    		GET #DL = .USER \\ ....
    
    If I have 3 DL, @A, @B and @C, the first time I get the #DL is
    something like @A@B@C@A and loop doesn't work either.
    
    Then I try using DATA_FILE, but this failed me as well because the
    DATA_FILE GET_NEXT does not know when to end eventhough the manual says
    that it will set OA$STATUS to 0 when end of stream encountered.  I
    wrote something like that:
    
    	DATA_FILE OPEN/READ MAD OA$MAIL_ALL_DIST
    	.LABEL LOOP_MAD
    		DATA_FILE GET_NEXT MAD \ IFNOTSTATUS \ .GOTO END_MAD
    		DATA_FILE GET_FIELD USER ....
    		.GOTO LOOP_MAD
    	.LABEL END_MAD
    
    Instead of using IFNOTSTATUS in the function list, I have tried to use
    .IF in desperation and I find that the OA$STATUS is always 1 and the
    loop go on forever getting @A, @B, @C, @A, @B, @C, @A, ...
    
    I have just started learning ALL-IN-1 script and looking at the manual
    this week, so please pardon me for a lot of trivial questions.
    
    Thank you very much
    Banquo.
1384.5AnswersSCOTTC::MARSHALLDo you feel lucky?Fri Sep 11 1992 12:3478
Hi Banquo,

First, I'll answer some of your questions, then I'll suggest a way to
mail system distribution lists.  I'll assume you have access to the ALL-IN-1
application programming books, so won't repeat information from them here.

1. <FORM PROFILE ENTRY/MODE=INQUIRE

Form PROFILE is a subset of form PROFIL.  PROFIL is the real profile form.
(Confusing, I know!).  Also, if using /MODE=..., you should also specify
/SAVE_START, or the results are pretty yucky (as you found out!)

So try this instead:  <FORM PROFIL/MODE=INQUIRE/SAVE_START="'USERNAME'"
Note the use of quotation marks.  ALso, you don't need to say ENTRY as the form
is already defined as an ENTRY form.

2. OA$GT_EMD_SYS_DIST_INFO and OA$GT_MAIDES_MLIST

I'm not sure what you're trying to achieve here.  You're right that these two
aren't ALL-IN-1 symbols, they're code-level stuff.  I don't think you need to
worry about the information they contain, anyway.

3. OA$MAIL_ALL_DIST

The documentation says this dataset is used for recognition, so there may be
something odd about it that prevents it working as you'd expect in other
contexts.  Having said that, I just tried it and it worked fine in a FOR loop,
so I'm not sure what's going wrong on your system...

4. DATA_FILE GET_NEXT does not know when to end

This is one of the funny things about GET_NEXT: it loops around at the end of
the file, back to the beginning.  It's up to you to test the key of the record
returned, to determine when you've reached the end of the file.


Here's my suggestion for getting all the system distribution lists.

! The first part of the script creates a mail message
MAIL INITIALIZE
MAIL PUSH_CURMES
MAIL CREATE/NOEDIT/NOSEND/OPEN

! Change the text in the next two lines to whatever you need
MAIL SUBJECT "System distribution lists for node XYZ"
MAIL TO "recipient's mail address"
MAIL CLOSE_MESSAGE

! Now get the distribution lists, make a filecab entry for each, and attach
! it to the mail message created above
FOR PROFIL WITH .%KEY = "@" OR .%KEY:H = ":" DO -
    CABINET CREATE "SYSDISLISTS" \\-
    COPY .ADDR1 OA$CURDOC_FILENAME \\-
    CABINET ADD_ATTRIBUTE, "TITLE", .%KEY \\-
    GET #DOC = OA$CURDOC \\-
    CABINET ATTACH_DOCUMENT OA$CURMES, OA$CURDOC \\-
    CABINET CURRENT #DOC

! Now send the mail message
MAIL SEND
MAIL POP_CURMES


If you want to do some tidying up, modify the last six lines of the script to:

    CABINET ATTACH_DOCUMENT OA$CURMES, OA$CURDOC \\-
    CABINET CURRENT #DOC \\-
    CABINET DELETE_DOCUMENT

! Now send the mail message
MAIL SEND
MAIL DELETE/NOPROMPT
MAIL POP_CURMES


Of course, you then have to unpackage it all at the other end!

Scott
1384.6Watch out for address formatsAIMTEC::WICKS_AIt wasn&#039;t supposed to end this wayMon Sep 14 1992 03:3720
    Banquo,
    
    Bear in mind also that the addresses you get when you have transferred
    the SDL may not be useable on the remote node
    
    Consider the case where on node A the distribution list @TEST contains
    the address:
    Andrew.D.Wicks		( WICKS )
    this is a local address that's valid on node A
    
    However when I transfer the SDL @TEST to node B this address is invalid
    since it should be 
    Andrew.D.Wicks		( WICKS @ A1 @ NODEA )
    
    So unless you ensure the addresses are valid on both nodes you're going
    to run into even more problems.
    
    Regards,
    
    Andrew.D.Wicks