BookmarkSubscribeRSS Feed
Priyanka_b
Calcite | Level 5

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?

Please advise!

3 REPLIES 3
DaveHorne
SAS Employee

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="email@example.com"
    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.

Kurt_Bremser
Super User

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.

alexal
SAS Employee

Maybe you need to use PROC PRINTTO in your SAS program?

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2310 views
  • 3 likes
  • 4 in conversation