Date: Fri, 3 Nov 2000 10:32:22 -0500
Reply-To: Ian Whitlock <WHITLOI1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ian Whitlock <WHITLOI1@WESTAT.COM>
Subject: Re: Use macro values in proc statement
Content-Type: text/plain; charset="iso-8859-1"
Jonathan,
If it is important to save a data pass then the FREQ could be skipped, since
these counts are already in the log. Or even better the split should
probably not even be done. A sort and simple BY processessing is usually
faster and simpler to maintain. Of course, the requirements for later
processing may make the split neccessary or at least wise. If the split is
required, then using two macro list variables would be more efficient than
an array of macro variables. In this case even the need for a macro can be
eliminated.
Ian Whitlock <whitloi1@westat.com>
-----Original Message-----
From: Jonathan Goldberg [mailto:Jonathan_Goldberg@MASTERCARD.COM]
Sent: Friday, November 03, 2000 10:09 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Use macro values in proc statement
mvs_user <deja_news@HOTMAIL.COM> asks:
--snip--
why, after creating a group of data sets named in the form base1--basen, the
statement:
proc freq data = %do i=1 %to # a&&code&1 %end;
fails. (note: I assume that a&&code&1 is really a&&code&i).
The problem, as noted by nother poster, is that procs do not accept multiple
data sets. It was suggested that
data x;
set %do i=1 %to # a&&code&1 %end;;
proc freq data = x;
be used instead.
Making x a view is better; it avoids passing the data more than once. Also,
it
is more flexible in some situations. This would be done simply by:
data x/view=x;
set %do i=1 %to # a&&code&1 %end;;
proc freq data = x;
Jonathan