Date: Tue, 22 Nov 2011 11:32:37 -0500
Reply-To: Bolotin Yevgeniy <YBolotin@SCHOOLS.NYC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Bolotin Yevgeniy <YBolotin@SCHOOLS.NYC.GOV>
Subject: Re: Export Contents of Macro Variables
In-Reply-To: <DCCF5C4C413228459F79656548489F6D07CB5B3963@EX3VS1.nyced.org>
Content-Type: text/plain; charset="us-ascii"
Oh oops, copied from the original code without looking
Should be "put", not "%put"
Thanks to Ya Huang for the catch
-----Original Message-----
From: Bolotin Yevgeniy
Sent: Tuesday, November 22, 2011 11:03 AM
To: b miner; SAS-L@LISTSERV.UGA.EDU
Subject: RE: Export Contents of Macro Variables
%macro writeToFile();
data _null_;
file "c:\myfile.txt";
%DO I=1 %TO &firstCounter;
%put &&IF&I;
%end;
Run;
%mend;
If you're having issues with the actual &&IF&I part instead, provide
more detail.
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of b
miner
Sent: Tuesday, November 22, 2011 10:51 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Export Contents of Macro Variables
Hi All-
In a UNIX environment, I wish to write the contents of macro variable
out to a text file.
The macro variables are indexed and I am accessing them as:
%DO I=1 %TO &firstCounter;
%put &&IF&I;
%end;
Is it possible to loop through them and write the value to a text file?
Each &&IF&I contains a string.
Thanks!