LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (December 2001, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sat, 8 Dec 2001 18:18:15 -0600
Reply-To:   Gilles Moser <gilles@fuse.net>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Gilles Moser <gilles@FUSE.NET>
Organization:   Posted via Supernews, http://www.supernews.com
Subject:   Make SAS wait between execution of X command

Hi,

I have a SAS macro looping to generate a Unix file with a single parameter used to customized SAS programs. I have to loop through approximately 500,000 regression models that I am trying to divide in 50 SAS jobs doing each 10,000 models. My problem is because Unix takes a while to launch the SAS job the Unix file is updated before the corresponding job is launched. I would like to make SAS wait to be sure that the right parameters are passed from Unix back to the new SAS jobs.

Here is a sample of my code that passes SAS variable to Unix:

%macro test; %do i=1 %to 2;; x "echo star > ls"; x "echo &i >> ls"; x "cp clone.sas opt&i..sas"; x "sas opt&i..sas"; /*The SAS jobs is launched to late and uses the parameters of the second loop creating the LS file*/ %end; %mend; %test;

Here is a sample of the code OPT&i..SAS that takes the parameter from the Unix file:

data _null_; infile "/ahome/.../ls" input @1 param $ 1-5; /*I apologize for this approximative input statemet*/ call symput ('myvar'||left(-n),param); run;

%put _user_;

This first SAS job the macro variable myvar1 resolves to 2 (INSTEAD OF 1). The second SAS job has the macro variable is also 2.

I wanted to have 1 for the first SAS job and 2 for the second.

Could anyone help me? Anyone to solve this issue would be appreciated.

Gilles Moser Information Resources Inc.


Back to: Top of message | Previous page | Main SAS-L page