08-16-2017 02:42 PM
Hello, We have 9.4(TS1M3) on Grid. When I submit job to grid in background, log file is getting created in current directory after job completes. Is there a way log file be found while the job is running so I check on the progress of a job?
08-16-2017 04:00 PM
I'm not sure if this is exactly what you're looking for: I've been known to grab the src and log information at the beginning of a SAS job (or at the end) to send myself a quick message when it runs:
/* get job source and log location */ %let job_src=%sysfunc(getoption(sysin)); %let job_log = %sysfunc(getoption(log)); /* send msg with job information */ filename mailbox email subject="Job started: &job_src &job_log" to="firstname.lastname@example.org" type="text/plain"; data _null_; file mailbox; put "Job started:"; put / "View the log at %sysfunc(getoption(log))"; put / "View the src at %sysfunc(getoption(sysin))";
put / "Server hostname is &systcpiphostname"; run;
I haven't tried this on Grid (I expect that it works), so hope this helps.
08-18-2017 02:31 AM
I do the following (this is for all our batch jobs):
- the wrapper script for SAS bacth jobs determines a timestamp and process number
- timestamp and process number are used to create the filename for the log file, used with the -log commandline option
- the wrapper script runs a quick SAS program that writes all pertinent information (parameters, program name, time etc) to a SAS dataset; return code is set to -1, and a HTML navigation page for the current day is written, containing all jobs from the day, with links to the log file location
- once the main job has run, a similar SAS program runs that adds the final return code to the jobcontrol dataset, and recreates the navigation page
As soon as a job runs, I get an entry in today's jobcontrol page on the web server (return code is "running"). Clicking on the link that is attached to the program name will display the log. With "reload" I can watch the job's progress.