BookmarkSubscribeRSS Feed
ASASProgrammer
Calcite | Level 5

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

7 REPLIES 7
SASKiwi
PROC Star

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.

ASASProgrammer
Calcite | Level 5

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.

SAS_ITUSER
Calcite | Level 5

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.

ASASProgrammer
Calcite | Level 5

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

TimCampbell
Quartz | Level 8

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

Patrick
Opal | Level 21

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

twocanbazza
Quartz | Level 8

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 2701 views
  • 0 likes
  • 6 in conversation