LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 22 Apr 2004 14:45:05 -0700
Reply-To:     Donald Mayfield <donaldwmayfield@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Donald Mayfield <donaldwmayfield@YAHOO.COM>
Organization: http://groups.google.com
Subject:      filename of program in  macro variable
Content-Type: text/plain; charset=ISO-8859-1

I'll include code to get filename in a macro variable when running batch. Can anyone do this running interactive? Variables are jobid which has full path, and filename which does not have full path.

%MACRO jobidmac; %GLOBAL jobid filename; options msglevel=i; proc printto new log='TEMP.TMP'; run; proc options host; run; proc printto; run; data _null_; length filename fqfn $200; infile 'temp.tmp' ls=132 pad; input line $char132.; if index(line,'SYSIN=') then do; today = put(datetime(),datetime13.); sysin = substr(line,index(line,'=') + 1); fqfn = reverse(scan(reverse(sysin),2)); filename = reverse(scan(reverse(sysin),2,'.\')); call symput('JOBID',trim(sysin)||' '||trim(today)); call symput('FQFN',trim(fqfn)); call symput('FILENAME',trim(filename)); put line; stop; end; run;

%mend jobidmac;

%jobidmac


Back to: Top of message | Previous page | Main SAS-L page