As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

PassInfX Writing Info to Log with InitStmt

From sasCommunity
Jump to: navigation, search


Writing information to the SAS log with option InitStmt


-initstmt '%Include "";'


%let    LineSize = %sysfunc(getoption(linesize));run;
options LineSize = max;
%let JobStart = %sysfunc(inputn(%substr(&SysProcessId.,1,16)x,hex16.)
%put PASS-INFO:$22   :JobStart  =&JobStart.;
%put PASS-INFO:$hex16:DateTime  =%substr(&SysProcessId.,1,16);
%put PASS-INFO:$12   :FullStimer=%sysfunc(getoption(fullstimer));
%put PASS-INFO:$20   :Host      =%sysget(computername);
%put PASS-INFO:$hex16:SysId     =%substr(&SysProcessId.,17,16);
%put PASS-INFO:  4, 4:SysJobId  =&SysJobId.;
%put PASS-INFO:$16   :UserId    =&SysUserId.;
%put PASS-INFO:$ 8   :SysScpL   =&SysScpL.;
%put PASS-INFO:$16   :SysVlong  =&SysVlong.;
%put PASS-INFO:$80   :MemSize   =%sysfunc(getoption(MemSize));
%put PASS-INFO:  4,32:SortSize  =%sysfunc(getoption(SortSize));
%put PASS-INFO:  4,32:SumSize   =%sysfunc(getoption(SumSize));
%put PASS-INFO:$128  :SysIn     =%sysfunc(getoption(SysIn))*;
%put PASS-INFO:$128  :SysParm   =&SysParm.*;
run; %Symdel JobStart;
%*2. overwrite altlog.cfg;
%let FileSpec = !SASuseAltCfg;
%let Text     = -altlog "!SASuseAltLog\%sysfunc(DateTime(),hex16.).log";
%let LrecL    = %length(&Text.);
%let FileRef  = AltLog;
%let Rc       = %sysfunc(filename(FileRef ,"&FileSpec."));
%let Fid      = %sysfunc(  fopen(&FileRef.,o,&LrecL.,e));
%let Rc       = %sysfunc(   fput(&Fid.,&Text.));
%let Rc       = %sysfunc( fwrite(&Fid.));
%let Rc       = %sysfunc( fclose(&Fid.));
%SymDel  FileSpec Text LrecL FileRef Rc Fid;
%*3.     reassign rtraceloc;
options  RtraceLoc =
options  source LineSize = &LineSize.; %SymDel LineSize;
  • Description

Write a standard header to log with information used by LogParse.

Note: This is an extension of the LogParse macro PassInfo.

See also:

Option InitStmt

Option Rtrace

--macro maven == the radical programmer 11:51, 14 August 2007 (EDT)