PassInfX Writing Info to Log with InitStmt

From sasCommunity
Jump to: navigation, search

PassInfx

Writing information to the SAS log with option InitStmt

Usage:

-initstmt '%Include "PassInfX.sas";'

Program:

*PassInfX.sas;
%let    LineSize = %sysfunc(getoption(linesize));run;
options LineSize = max;
%let JobStart = %sysfunc(inputn(%substr(&SysProcessId.,1,16)x,hex16.)
                               ,datetime22.2);
%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 =
         "!SASuseRtrace\%substr(&SysProcessId.,1,16)-&SysJobId..log";
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.

http://support.sas.com/rnd/scalability/tools/fullstim/fullstim.html

See also:

Option InitStmt http://www.sascommunity.org/wiki/Option_InitStmt

Option Rtrace http://www.sascommunity.org/wiki/Option_Rtrace

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