LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 5 Sep 2008 22:24:12 -0400
Reply-To:     Bucher Scott <SBucher@SCHOOLS.NYC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Bucher Scott <SBucher@SCHOOLS.NYC.GOV>
Subject:      Re: proc datasets with many variables
Comments: To: art297@NETSCAPE.NET
In-Reply-To:  <200809060137.m85Jn9uV028474@malibu.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"

I see. This question came up previously, and no way around the limit was identified then either <http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0610b&L=sas-l&D=0&P=49531> . Your macro does remove a great deal of the tedium of the statements, but I am surprised there is no shorthand for applying a series of formats to a series of variables.

Also noted in the older thread is that in some settings the error message occurs a bit earlier than 4096. I encountered the same problem; even when applying 4087 I received the "ERROR: Limit of 4096 formats or informats in use in a single step has been exceeded" message. So it may be prudent to set the macro loops to something less than that.

-Scott

-----Original Message----- From: Arthur Tabachneck [mailto:art297@NETSCAPE.NET] Sent: Friday, September 05, 2008 9:38 PM To: SAS-L@LISTSERV.UGA.EDU; Bucher Scott 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.


Back to: Top of message | Previous page | Main SAS-L page