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...
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.