BookmarkSubscribeRSS Feed
0 Likes

Within Viya the new functionality to background submit is a very nice addition, but is lacking for use in a couple of ways for use in pharma:

1) Inability to specify an autoexec program like you can when doing a CLI submission

2) Difficulty in automating when having to run ~100 programs for a deliverable

 

I think building a package of data step tools to allow programmatically submitting programs to the background would be beneficial for everyone.  I presented partially on this at Innovate earlier this year.  I currently do this with RSUBMIT code, but I think similar functionality could be made with data step functions.  Something like:
data submissions;

    JOBID=background_submit(program="ProgramPath/ProgramName.sas",autoexec="ProgramPath/autoexec.sas");

run;

Then have the variable name contain the job ID spawned from the background job if successful.  Having another function to return the job status based on the job ID would also be great, and these functions would be usable in %sysfunc to macrotize.  

data _null_;
    set submissions;

    JOBSTATUS=background_status(JOBID);

   put JOBSTATUS=;

run;

 

Having a way to sequence jobs would be really great as well.  Something like assigning a queue number that works small to large.  Jobs with queue number 1 have to finish before jobs with queue number 2 start or something like that.  I built all of this logic with macro functions and RSUBMIT but having something native would be a large benefit I think.

1 Comment
Quentin
Super User

Many of us (myself included) see a problem and think "I'd like to solve that with SAS!"  While it would be possible to build a job scheduler / flow orchestrator with SAS, and doubtless many have done it, I think it's better to let actual job schedulers own this domain.  I don't have Viya, but I see it has a scheduler: https://blogs.sas.com/content/sgf/2025/12/04/getting-started-with-job-scheduling-in-sas-viya/  .  On 9.4 we used to use LSF to schedule SAS jobs, now using airflow.

 

p.s. happy to see that the URL for 2025 content still contains the SGF directory.  Would only be slightly happier if it was /sugi/   : )