If you're looking at a workspace server log, each line may be preceded by a date/time stamp, log level info and a username. Assuming a linux environment, you can use the following command line syntax. Be sure to set the correct log file name and also replace the username (john_doe) in 2 places in the statement. This will generate a file in the same location as the log, with the same name as the log, with a ".sas.recover" extension. Note that this recovered code should be used with caution, and only as reference, because parts might not be included, macros may be expanded, etc based on options that are set. logname=SASApp_WorkspaceServer_2019-10-07_hostA_342040.log grep "john_doe \- [0-9]" ${logname} | grep -v 'The SAS System' |awk -F'john_doe - ' '{print $2}'| sed -E 's/([0-9]+) //' > `dirname ${logname}`/`basename ${logname} .log`.sas.recover This is written for Workspace server logs specifically. To run this on Batch or Connect logs, adjust the regex in the grep statement accordingly. The sed statement can remain as is.
... View more