Date: Fri, 5 Sep 2008 21:37:39 -0400
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: proc datasets with many variables
Scott,
Unless someone comes up with something better, I'll stick with my original
suggestion. Your proposal, as shown below in the macro %doit3 (below),
results in the same error the original requester was trying to overcome:
data have;
array q(5000);
do i=1 to 5000;
q(i)=i;
end;
run;
%macro doformat;
%do i=1 %to 5000;
proc format;
value q&i._
&i.=9
other=0;
run;
%end;
%mend;
%doformat
%macro doformat;
%do i=1 %to 5000;
proc format;
value q&i._
&i.=9
other=0;
run;
%end;
%mend;
%doformat
%macro doit1;
proc datasets library = work;
modify have;
%do i=1 %to 4096;
format q&i. q&i._.;
%end;
quit;
%mend;
%doit1
%macro doit2;
proc datasets library = work;
modify have;
%do i=4097 %to 5000;
format q&i. q&i._.;
%end;
quit;
%mend;
%doit2
%macro doit3;
proc datasets library = work;
modify have;
format
%do i=1 %to 5000;
q&i. q&i._.
%end;
;
quit;
%mend;
%doit3
Art
---------
On Fri, 5 Sep 2008 19:02:56 -0400, Bucher Scott <SBucher@SCHOOLS.NYC.GOV>
wrote:
>Try using a single format statement, i.e.
>
>proc datasets library = jack;
>modify data0204;
>format
> q1 q1.
> q2 q2.
> q3 q3.
> ;
>quit;
>run;
>
>Regards,
>Scott
>
>-----Original Message-----
>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of M D
>Sent: Friday, September 05, 2008 6:52 PM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: proc datasets with many variables
>
>Hello,
>
>I am trying to modify the format of the variables of a dataset. First I
>run
>a proc format to set the format of the variables and then I run proc
>datasets.
>
>*
>
>proc **datasets* library = jack;
>
>modify data0204;
>
>format q1 q1.;
>
>format q2 q2.;
>
>.....
>quit;
>run;
>
>Unfortunately, I have more than 4096 format statements that are trying
>to
>process at the same time and thus, I am getting the following error
>message.
>
>
>119803 format q1 q1.;
>
>ERROR: Limit of 4096 formats or informats in use in a single step has
>been
>exceeded.
>
>What can I do to avoid this error.
>
>Many thanks in advance,
>
>Mike.