In a job when it reads an empty data set I want it not to abort the job with an error, but to move on to the next scheduled job. Any suggestions on how this can be done?
SAS Data integration Studio 4.6 empty data set
786 Views Asked by Daphne At
2
There are 2 best solutions below
5

If you run this code first, to check for existence of the dataset and more than 0 observations, SAS will exit with errorlevel 0 and your scheduler should continue:
%let endsas=;
data _null_;
if not exist("sashelp.class2") then call symputx("endsas","endsas");
run;
&endsas;
/*Since we are here, the dataset exists, continue to check for 0 obs:*/
%let endsas=endsas;
data _null_;
set sashelp.class2;
call symputx("endsas","");*if not 0 obs, this will be executed;
stop;*Stop, because we only need to run 1 obs;
run;
&endsas;
Note that no code after this will be submitted if the dataset does not exist or is empty.
Since you are talking about scheduled job which means that you have deployed more than 1 job using DI Studio for scheduling purpose and added all the deployed job that you need to run as a jobstream to a JobFlow in SAS Management Console -> Schedule Manager Plugin.
If this is the case then connecting the jobs in the schedule manager plugin -> schedule flow will popup condition for triggering next di studio jobflow. You can setup condition to trigger the next job regardless of the condition.
Hope this helps.