BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I created these &VARS &FILEN1 - &FILEN9 in a DATA Step as follows;


DATA _NULL_;
RETAIN NUMCSV 0;
INFILE INP LENGTH=ILEN;
INPUT DIRLINE $VARYING100. ILEN;
NUMCSV = NUMCSV + 1;
FILEN = COMPRESS("FILEN" || PUT(NUMCSV,2.));
CALL SYMPUT(FILEN,DIRLINE);
CALL SYMPUT("NUMCSV",NUMCSV);
RUN;

And now I want to process each in a %MACRO %DO LOOP changing the x in the following &FILENx from 1 to 9.

%DO I = 1 %TO &NUMCSV;
...
FILENAME WINPERF "&FILENx";
...
%END;

Can anyone point me in the right direction?
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
There are some suggestions and references in this previous forum posting:
http://support.sas.com/forums/thread.jspa?threadID=9640&tstart=0

cynthia
deleted_user
Not applicable
The info I found and needed was that the "I" counter variable in the
%DO I=1 TO ... is referenced as "&I" when in the %MACRO and to suffix it to the other AmperVar &FILEN I needed to code 2 ampersands &&FILEN&I. Thank You
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Very useful links using the Google advanced search arguments below, this topic/post:

macro variable introduction site:sas.com

macro variable generate code site:sas.com


Scott Barry
SBBWorks, Inc.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 674 views
  • 0 likes
  • 3 in conversation