Extract submitted code from Server Logs

Java apps like RMfB and RMfI submit SAS code directly to the Workspace Server for processing.  The code snipped below can be used to extract this code (as generated by the Java app).  To know how to switch on server logging, click here.


data x;
infile “C:SASConfigLev1SASAppWorkspaceServerLogsSASAppWorkspaceServer2013-04-186288.log”;
input;
if length(_infile)>72;
x=substr(infile,66);
if substr(x,1,1)=’-’;
test=subpad(x,2,7)1;/ignore warning*/
if test>0 and index(x,‘The SAS System’)=0 then do;
if input(subpad(x,2,7),8.)>0 then put x=;
end;
run;