BookmarkSubscribeRSS Feed
aruku
Calcite | Level 5

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

2 REPLIES 2
AbhiD
Obsidian | Level 7

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

Patrick
Opal | Level 21

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:

https://support.sas.com/documentation/cdl/en/lesysoptsref/68023/HTML/default/viewer.htm#p0fmptfnyvi1...

 

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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1863 views
  • 0 likes
  • 3 in conversation