Hi all,
I am trying to trigger multiple SAS Sessions in parallel using SYSTASK. I used rsubmit before but there is no SAS Connect in our current set up. Can any one please help me with this:
Below i am trying to run two sas scripts (adh.sas & adh1.sas) in parallel using a different sas script (adh2.sas)
Content in script adh2.sas
systask command "sas /sas/exl/exl_final_reports_dev/adh.sas" taskname = rmnohup;
systask command "sas /sas/exl/exl_final_reports_dev/adh1.sas" taskname = rmgmi;
Error:
NOTE: SAS initialization used:
real time 0.14 seconds
cpu time 0.11 seconds
ERROR: Execution of the Command 'sas /sas/one/one_time/adh.sas' failed.
ERROR: The specified executable module either cannot be located or it is not a valid executable.
ERROR: Could not create a new process.
1 systask command "sas /sas/one/one_time/adh.sas" taskname = rmnohup
Hi,
Is it not necessary in SYSTASK to mention the complete command as below
systask command
"START ""Batch"" /wait /min
""%sysget(sasroot)sas.exe"" -batch -nosplash
-sysin ""D:Program1.sas""
-log ""D:Program1.log""
" wait;
Rgds,
AbhiD
Very often you want a specific environment invocated. If so then don't use "sas.exe" but "sas.bat" (Windows) or "sas.sh" (Unix/Linux) under the server context you want.
The following code works for me when executed via SAS EG with a SAS Server under Windows. The child processes use the "sas.bat" under the server context (compute tier) to which the EG session is connected to.
systask command
"
%sysget(APPSERVER_ROOT)\sas.bat
-batch -nosplash
-sysin ""c:\test\HelloWorld.sas""
-log ""c:\test\#P_#Y#m#d_#H#M#s_#p.log""
-logparm rollover=session
"
taskname=pgm1
nowait;
systask command
"
%sysget(APPSERVER_ROOT)\sas.bat
-batch -nosplash
-sysin ""c:\test\HelloWorld.sas""
-log ""c:\test\#P_#Y#m#d_#H#M#s_#p.log""
-logparm rollover=session
"
taskname=pgm2
nowait;
waitfor _all_ pgm1 pgm2;
Log directives:
SAS/Connect ("rsubmit") gives you remote library services. This is something you don't have available when creating child sessions via SYSTASK. You will need to write data to permanent tables in the child sessions and then access these tables later on in the parent session.
You can "mimik" the SAS/Connect functionality of pushing macro variables from the parent to the child via system option "-initstmt" (dynamically creating "%let" statements which then get executed in the child session).
Here the link for Windows but the same works also under UNIX/Linux: http://support.sas.com/documentation/cdl/en/hostwin/67962/HTML/default/viewer.htm#p05ueoh4gef14pn10r...
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.