BookmarkSubscribeRSS Feed
Patrick
Opal | Level 21
Hi all

I'm running the following script in a vmware Windows2003 image with PC
SAS 9.1.3 on a single intel processor laptop.
The script should "spawn" 3 sessions on the same machine where the main program runs.
The 3 sessions should run in parallel (asynchronous).


options sascmd='C:\Program Files\SAS\SAS 9.1\sas.exe -
nosyntaxcheck' ;


%macro testit;
%do i=1 %to 3;
signon t&i;
%syslput ri=&i;
rsubmit wait=no log="C:\temp\testNew2_&i..log" output="C:\temp
\testNew2_&i..lst" ;
filename test "C:\temp\testNew2_&ri..txt";
data _null_;
file test;
put "Test &ri";
call sleep(10,1);
run;
filename test clear;
endrsubmit;
signoff t&i;
%end;
%mend;


%testit


I have the following 2 questions/issues:


1. It looks to me as if the tasks run synchronous instead of
asynchronous - why?


2. If I run the code more than once I get the following error:
ERROR: File is in use, C:\temp\testNew2_1.log.
ERROR: Remote submit cancelled.


Why is the log file still locked after signing off from the "spawned"
session? What am I missing?


Cheers, Patrick
3 REPLIES 3
DanielSantos
Barite | Level 11
Hello Patrick.

Set the autosignon option at the beginning:

option autosignon=yes;

Cheers from Portugal.

Daniel Santos @ www.cgd.pt.
Patrick
Opal | Level 21
Hi Daniel

Thanks for your answer. Someone replied! 🙂

I tried autosignon=yes; but still encounter the same issues.

There is an explicit signon in the code I provided so I don't really understand the point of adding the autosignon option.

I could imagine that multithreading doesn't really work as there is only one processor - and even though it's a dual-core processor it could be that the VM ware image runs on only one core. Just theory - but it's at least some kind of explanation.... Running very similar code in a multi-processor Unix environment works fine and the tasks run in parallel.

I still don't understand why the files stay locked even after an explicit signoff.

Cheers, Patrick
DanielSantos
Barite | Level 11
autosignon must be set if you wish to use multithreading feature (MP Connect).

Something may be wrong with your setup.

MP Connect will run on a single CPU (although internally, it should clearly be round robin processing).

I have ran the exact same code (with the autosignon=yes) asynchronously on my workstation (WinXP P4 with single CPU) with no problem at all.

Could you try the following code, to see if it works on your installation:

http://support.sas.com/documentation/cdl/en/connref/61908/HTML/default/a001249955.htm

Cheers from Portugal.

Daniel Santos @ www.cgd.pt

sas-innovate-2024.png

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.

 

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
  • 3 replies
  • 1554 views
  • 1 like
  • 2 in conversation