Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, I was wondering if anyone co

Status
Not open for further replies.

wphupkes

Technical User
Jul 1, 2008
22
0
0
NL
Hi,

I was wondering if anyone could help me out with the following question. I've written a program in Base 9, with multiple data steps (and proc prints / reports). The outcome is based on the input variables, as stated at the beginning of the program (the &LET statements). Maybe useful to mention: in the datasteps itself, there are several other macro's created by the CALL SYMPUT statement (but these macro's are part of the calculations in the datastep, nothing else).

Now I want to run like 10.000 simulations (so different %LET statements). Is there a way to do this? Creating another dataset with the variables of each %LET statement and make the whole thing just 1 macro? Or is this not possible? Thanks for your answer in advance!

The code looks like this:

/* Input variables new system*/

%Let example1='1';
%Let example2='5';
%Let example3='20';
%Let example4='35';
%Let example5='0';
%Let example6='3';
%Let example7='5';

Datastep 1
Proc Print 1
Data step 2
Proc Print 2
Etc.

Business / Risk Analyst
wphupkes@gmail.com
 
Hi,

Its possible to do like that;
What I understood from your information is that; there are series of steps which you want to carry out for diiferent values as output (say 10000 different values).

You can do it as following;

Step 1: Put all the code (series of steps in one macro lets say macro process_data
Step 2: Write another macro (lets say calling_macro as follows

%macro process_data (cnt) ;

Datastep 1
Proc Print 1
Data step 2
Proc Print 2
Etc.

%mend process_data


%macro calling_macro;

%do %from %i = 1 %to 10000;
%process_data(&i) /* here the value of i will be passed to the macro process_data which will be captured in another macro variable called cnt */
%end;

%mend process_data;


Hope this will help you. All the best.



sasbuddy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top