DATA Step, Macro, Functions and more

Is there any way to check a job's status inside another SAS program?

Reply
Contributor
Posts: 21

Is there any way to check a job's status inside another SAS program?

Can anybody help this?

The scenario is this:

XCMD is disabled, no way to use shell command,

We need check the status (running, complete, failed...) of a scheduled job inside another SAS program.

Thanks in advance,

Shi

Super User
Posts: 3,114

Re: Is there any way to check a job's status inside another SAS program?

How is the SAS program scheduled? What operating system is it being run on? Often the job scheduler will show you this type of information. For example the LSF scheduler that comes bundled with SAS BI Server shows you the job status.

Contributor
Posts: 21

Re: Is there any way to check a job's status inside another SAS program?

The program is scheduled inside LSF scheduler.  The OS is SUN Solaris.

We need check the status of a scheduled job inside another SAS program.

New User
Posts: 1

Re: Is there any way to check a job's status inside another SAS program?

HI if you are using the LSF you can check the log up to what extend the code was writen for example as you are scheduling another job in  the sas job when the inside job reach that code it will write the onfo in the log just check it.

Contributor
Posts: 21

Re: Is there any way to check a job's status inside another SAS program?

The XCMD is disabled, and we need check the status of a scheduled job inside another SAS program.

Contributor
Posts: 45

Re: Is there any way to check a job's status inside another SAS program?

Hi Shi,

You could get the program that is running on a schedule to write some sort of log entries to a SAS dataset and then read from that to determine whether the process worked or not?

We have a macro that is stored on the server to create a record in a log table when a process starts and then update the record with an end date and success/fail message when it finishes.

Alternatively, even with xcmd turned off you should be able to use some combination of DOPEN/FOPEN/FINFO to look at the last modified dates on the lsf log files or to read in the log files to search for completion messages.

http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000209583.htm

Tim

Respected Advisor
Posts: 3,900

Re: Is there any way to check a job's status inside another SAS program?

XCMD might be disabled when running your job out of DIS (session created using object spawner). But when running the job in batch (like done via LSF) then the setting is very likely XCMD - else you can set it yourself by passing -XCMD as start option.

I personally believe that for DIS development XCMD should be set. There was some time ago some rational posted which can be used to discuss this within an organisation - but I just can't find this thread anymore.

..... found it: The case for XCMD privileges in SAS Enterprise Guide - The SAS Dummy

Super Contributor
Posts: 356

Re: Is there any way to check a job's status inside another SAS program?

If you have used DIS to create the job you can get it to create a status file/dataset (easy point and click), your other job can then check for that file and it's contents

Barry

Ask a Question
Discussion stats
  • 7 replies
  • 357 views
  • 0 likes
  • 6 in conversation