/**********************************************************************/

/****** EXAMPLE for OS/2 client on NOVELL network *********************/
/*
   This code will work for an OS2 machine attached to a NOVELL file
   server.  This example uses the Netware whoami command on OS2.  The
   whoami command returns current user information for the server
   queried.

   Here is some sample output:
     > whoami tech1

You are user BUBBA attached to server TECH1, connection 50.
Server TECH1 is running NetWare v3.12 (100 user).
Login time: Wednesday  June  19, 1996  11:28 am

*1*  
   Set the noxwait option  so that you do not have to
   enter the exit command.

*2*  
   X statement calling the whoami program and re-routing output to text
   file 'who'.  User will need write authority to the current directory

*3*
   Data step to read the who text file.  If the third parm is user, the
   4th will be userid.  Set the local macro variable user to the
   extracted value. 

*4* 
   Set the environment variable vqpname to the value  

*5*
   Display value of environment variable for debugging
*/
/****** Start of Code for OS/2 client on NOVELL network example *******/

/* *1* */  

options noxwait;

/* *2* */

  x 'f:\public\os2\whoami tech1> who'

/* *3* */

  data _null_;
     infile 'who' truncover;
     input lin $char80.;
     if (scan(lin,3)='user') then
        do;
           user=scan(lin,4);
           call symput('user',user);
           stop;
        end;
 run;

/* *4* */

options set=vqpname &user;
/* *5* */ 

/****** End of Example for OS/2 client on NOVELL network **************/