12-08-2014 07:32 AM
I have to execute a job in SAS DIS and conditionally call another job in it using ‘Systask’ command.
I can call the 2nd job using ‘Systask’ command and have passed the required macro variable from job 1 as ‘sysparm’.
(Example command used: SYSTASK COMMAND “/opt/sas/config/Lev1/SASApp/BatchServer/sasbatch.sh -log /opt/sas/config/Lev1/SASApp/BatchServer/Logs/Web_service_job2.log -batch -noterminal
-sysin /opt/sas/config/Lev1/SASApp/SASEnvironment/SASCode/Jobs/Web_service_job2.sas –sysparm &ID”)
The issue i am facing is that, i am not able to read any SAS data set in the 2nd job. If i use ‘proc sql’ with ‘select statement’ for an existing table, the query returns “No rows selected” in the log(Web_service_job2.log), although there are records in the table. Also, ‘Set statement’ doesn’t read any records.
If i run the 2nd job separately in SAS DIS, it works fine. The issue persists only when it is called through ‘Systask’ command in the 1st job.
Could anyone please help me with this.
Thanks in Advance!
12-08-2014 09:27 AM
Still, why systask?!?!
Ok, you are passing the macro variable, can you verify in the log that the &ID is replaced by the current value?
And in your called job, how to you refer to sysparm - the log...?
12-09-2014 05:11 AM
yes right..have narrowed it to this much:
First_job code: systask command "path1/sasbatch.sh -log logfile_path.log -batch -noterminal -sysin second_job.sas -sysparm &id;
Second_job code: libname lib "path";
set lib.xyz; /*existing permanent SAS data set*/
If I check now the log file created- "logfile_path.log", It shows that " 0 observations were read from data set lib.xyz".
Hence, the newly created data set "lib.abc" contains no observations but just variables.
Could you please help with this.