*
;
/*
Subject:      Re: Automatic macro variable
From:         Bernard Tremblay 
Date:         1997/04/10
Newsgroups:   comp.soft-sys.sas

HI,
        There is no automatic variable, but you should be able to
get it with a simple call to the OS.  I use the following macro
under UNIX.  You'll have to find out the equivalent command under
DOS to get the LAN userid (I suspect it might be the same or
echo %USERID%...). Then, adapt the macro to your needs.

                Have fun,
                        Bernard Tremblay   */


/*------------------------------------------------------------------*/;
/* USERID                                      Novembre 1996 BT     */;
/*------------------------------------------------------------------*/;
*;
%*=============================*;
%* Find out userid and store it*;
%* in macro variable USERID    *;
%*=============================*;
%*;
%macro userid;
  %global userid;
  filename userid pipe "whoami";  /*<== use DOS/LAN command to return userid*/
  data _null_;
       infile userid length=ln end=eof;
       input fname $varying200. ln;
       call symput('userid',trim(fname));
run;
  filename userid clear;
*;
%mend userid;

*
;