BookmarkSubscribeRSS Feed
gaultie
Calcite | Level 5

Hi

 

I am using SAS Enterprise Guide 5.1 to submit a SAS program called SASBatchSubmit.sas to run as a background process on a Unix server running SAS 9.4 using a %sysexec command as follows

 

%sysexec nohup sas ~/SASBatchSubmit.sas -print ~/SASBatchSubmit.lst -log ~/SASBatchSubmit.log &;

This runs fine (the option is enabled for the server to allow system commands) and the output file (.lst) is created correctly with the output expected. However there is no sign of a log file despite it being included in the command. If the same thing is remote submitted from a SAS Display Manager application environment then it works fine and the log is created.

 

 

Does anyone know why there is no log ? For a few reasons we want to be able to kick this off from Enterprise Guide

7 REPLIES 7
r_behata
Barite | Level 11

Have you tried looking into the contents of the file "nohup.out" which will be created on the Linux/Unix file system when you run a command with the nohup option. This file will give you more information on the Job completion and where it created the log file and list files.

 

The sample output of the nohup.out on the SAS Grid would typically  look like this :

 

cat nohup.out

 

 

Grid job return code is 5 (0x5)
rc=5 - command not successful
Leaving SASGSUB logs in <path> for review
Job ID: 12333
Job directory: "<path>"
Job log file: "<path>.log"
Waiting for grid job to complete...
Grid job complete.
12333 (Job) has Failed: Submitted: <datetime>, Started: <datetime> on Host xyz, Ended: <datetime>, RC:5
Moving job information to "<path>"
gaultie
Calcite | Level 5

Thanks

 

I am not seeing nohup.out in the default location I would expect but I will look further at this

Kurt_Bremser
Super User

Run this:

filename oscmd pipe "sas ~/SASBatchSubmit.sas -print ~/SASBatchSubmit.lst -log ~/SASBatchSubmit.log 2>&1";

data _null_;
infile oscmd;
input;
put _infile_;
run;

to see what your command does. You may have problems because of the environment being that of the Object Spawner and not that which you get when using remote login and Display Manager.

gaultie
Calcite | Level 5

Thank you for the reply. The oscmd file is coming up empty for some reason - see log below

 

1 %_eg_hidenotesandsource;

5 %_eg_hidenotesandsource;

29

30 filename oscmd pipe "sas ~/sasbatchsubmit.sas -print ~/sasbatchsubmit.lst -log ~/sasbatchsubmit.log 2>&1";

31

32 data _null_;

33 infile oscmd;

34 input;

35 put _infile_;

36 run;

NOTE: The infile OSCMD is:

Pipe command="sas ~/sasbatchsubmit.sas -print ~/sasbatchsubmit.lst -log ~/sasbatchsubmit.log 2>&1"

NOTE: 0 records were read from the infile OSCMD.

NOTE: DATA statement used (Total process time):

real time 12.95 seconds

cpu time 0.01 seconds

 

Kurt_Bremser
Super User

Another thing: after each test, do a ls -l on the result file(s) to see if they have been changed. Sometimes leftovers from previous tests can make it seem that the program ran, when in fact nothing was started at all.

Tom
Super User Tom
Super User

Make sure that the command sas that you are trying to call is actually defined on the machine where your SAS job is running.

 

I have seen environments where the machine that users sign onto and use to launch SAS is not the machine where SAS itself runs.  So the set of available commands when SAS is running is not the same as what was available at the command prompt where the original job was submitted.

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 2345 views
  • 0 likes
  • 4 in conversation