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.

Using sysfunc with file functions to overwrite altlog

From sasCommunity
Revision as of 13:01, 2 July 2012 by Ron.Fehd.macro.maven (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This set of statements opens a file, writes text, and closes the file.

%*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;

Example altlog.cfg:

-altlog "!SASuseAltLog\41D664159896C8B4.log"


-- created by User:Rjf2 16:30, 13 August 2007 (EDT)

--Ronald_J._Fehd macro.maven == the radical programmer