Reading data set in a sub-job called using systask

Reply
Occasional Contributor
Posts: 10

Reading data set in a sub-job called using systask

Hi,

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!

Dipti

Super User
Posts: 5,391

Re: Reading data set in a sub-job called using systask

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...?

Data never sleeps
Occasional Contributor
Posts: 10

Re: Reading data set in a sub-job called using systask

no problem with  sysparam. its working fine. Only the issue is i am not able to read any dataset using proc sql.

Super User
Posts: 5,391

Re: Reading data set in a sub-job called using systask

No chance to help out without any log.

try to narrow down your task to a minimum during trouble shooting.

Data never sleeps
Occasional Contributor
Posts: 10

Re: Reading data set in a sub-job called using systask

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";

                    data lib.abc;

                         set lib.xyz;  /*existing permanent SAS data set*/

                    run;

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.

Super User
Posts: 5,391

Re: Reading data set in a sub-job called using systask

And no errors/warnings?

Than I assume that your input data set is empty...?

Else, show us the complete logs.

Data never sleeps
Ask a Question
Discussion stats
  • 5 replies
  • 241 views
  • 0 likes
  • 2 in conversation