[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

3077.0. "How to test if ALL-IN-1 user profile already exits" by NWGEDU::MACKNEY () Tue Jul 27 1993 19:18

    I am trying to write a script to add users accounts automatically. I
    have cracked most of the problems, but I would like to test whether the
    user exists in ALL-IN-1 before I try adding the profile.
    
    I thought the simple way would be to open PROFILE.DAT and do a 
    READ/KEY='username' but unfortunately the record size of PROFILE.DAT is
    to big for my DCL buffer. It does infact tell me if the record is not
    there, but its a bit dirty. 
    
    I then tried the following code:
    
    $open/write out file.tmp
    $write out "$ allin1/reenter/noinit"
    $write out "$get cli$username = profil.user[""''user'""]
    $write out "exit"
    $close out
    [email protected]
    $show sym username
    %DCL-W-UNDSYM, undefined symbol - check validity and spelling
    
    but the DCL symbol - username - is not created becuase the DCL symbol  
    is a local symbol, which is not available to the main process. I would 
    be intersted to know if this code can be made to do what I want. Does 
    anyone know if I can create Global Symbols with CLI$xxx
    
       The above is purely academic because there is no point in 
       starting the ALL-IN-1 image to see if a user exists so that 
       you don't have to waste your time starting the ALL-IN-1 image 
       to create a profile for a user that already exists....
    
    
    Can anyone suggest a nice way to doing this.
    
    Regards 
    J
                                   
T.RTitleUserPersonal
Name
DateLines
3077.1Try this . . .IOSG::SHOVEDave Shove -- REO2-G/M6Wed Jul 28 1993 11:4717
    In answer to .0's question, no you can't define global symbols from
    ALL-IN-1.
    
    What you could do is to define a /Job logical, thus:
    
    $open/write out file.tmp
    $write out "$ allin1/reenter/noinit/nodefer" ! To make sure the subproc
    !						   is running
    $write out "oa$ini_init"
    $write out "get #xx = profil.user[""''user'""]
    $write out "get oa$dcl = '$define/job username ' #xx"
    $write out "exit"
    $close out
    [email protected]
    $show log username
    
    Dave.
3077.2Perhaps it's a little obvious but...IOSG::CHINNICKgone walkaboutThu Jul 29 1993 12:1627
    OK,
    
    What's wrong with...
    
	    $ user = "MANAGER                "
	    $ allin1/reenter/noinit
	    	get cli$username = profil.user[cli$user]
	    	exit
	    $show sym username
    
    
    Or even better...
    
    	    $ open/read/share=write profile$ OA$DATA_SHARE:PROFILE.DAT
    	    $ read/key=&user/error=PROFILE_CHECK profile$ profile_record
    	    $PROFILE_CHECK:
    	    $ Must allow for RMS$_RTB or RMS$_NORMAL here
    	    $ if $status.eq.%X181A8 .or. $status .eq. %X10001
    	    $ then
    	    $		! User exists
    	    $ else
    	    $		! User doesn't exist (most probably RMS$_RNF)
    	    $ endif
    
    
    Paul.