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

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!

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