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 (June 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 3 Jun 2004 13:10:43 +0200
Reply-To:     "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Subject:      Re: Q: looping nested format
Comments: To: julierog@ix.netcom.com, trovato@verizon.net
Content-Type: text/plain; charset="iso-8859-1"

Hi Roger,

Yes, I already feared something like that. Thanks.

Regards - Jim. -- . . . . . . . . . . . . . . . .

Jim Groeneveld, MSc. Biostatistician Science Team Vitatron B.V. Meander 1051 6825 MJ Arnhem Tel: +31/0 26 376 7365 Fax: +31/0 26 376 7305 Jim.Groeneveld@Vitatron.com www.vitatron.com

My computer may have missed me, I did not; it, that is.

[common disclaimer]

-----Original Message----- From: Roger Lustig [mailto:trovato@verizon.net] Sent: Thursday, June 03, 2004 13:02 To: Groeneveld, Jim Subject: Re: Q: looping nested format

Jim: The reason is that, when you specify a nested format in your VALUE statement, SAS does nothing at all! Only when the format is *called* does SAS go looking for a format to resolve the nesting. And since you've specified exactly one format (that would be $NestFmt. -- specifying widths doesn't make new formats), SAS finds what you specified, sees that it needs resolving, looks for $NestFmt. again, sees that it needs resolving, etc.

Try this:

proc format; value test low-high=[Zonk16.] ; run;

No error message, even though the Zonk. format doesn't exist. Now try *using* the format.

Roger

Groeneveld, Jim wrote: > Hi friends, > > Why does the following nested format loop so many times that its stack space gets full? > I explicitly specified it to loop 11 times at maximum. I would like to hear your opinions. > Mine is that apparently SAS does not initially look at the format lengths and thus iterates indefinitely (if it could). > > 1 PROC FORMAT; > 2 VALUE $NestFmt > 3 '11111111111' = [$NestFmt10.] > 4 '1111111111' = [$NestFmt9.] > 5 '111111111' = [$NestFmt8.] > 6 '11111111' = [$NestFmt7.] > 7 '1111111' = [$NestFmt6.] > 8 '111111' = [$NestFmt5.] > 9 '11111' = [$NestFmt4.] > 10 '1111' = [$NestFmt3.] > 11 '111' = [$NestFmt2.] > 12 '11' = [$NestFmt1.] > 13 '1' = [$1.] > 14 ; > NOTE: Format $NESTFMT has been output. > 15 RUN; > > NOTE: PROCEDURE FORMAT used: > real time 0.15 seconds > cpu time 0.01 seconds > > 16 > ERROR: Stack overflow detected In Task ( DATASTEP ] > ERROR: Stack overflow detected In Task ( DATASTEP ] > ERROR: Stack overflow detected In Task ( DATASTEP ] > Exception occurred at (67996E49) > Exception occurred at (67996E49) > Exception occurred at (67996E49) > Task Traceback > Task Traceback > Task Traceback > > NOTE: DATA statement used: > real time 3.77 seconds > cpu time 3.61 seconds > > 17 DATA NestFmt / DEBUG; > 18 x = '11111111111'; * but the value does not influence the error result; > 19 FORMAT X $NestFmt12.; > > 20 RUN; > 21 > 22 PROC PRINT DATA=NestFmt; RUN; > ERROR: File WORK.NESTFMT.DATA does not exist. > ERROR: File WORK.NESTFMT.DATA does not exist. > ERROR: File WORK.NESTFMT.DATA does not exist. > > Regards - Jim. > -- > . . . . . . . . . . . . . . . . > > Jim Groeneveld, MSc. > Biostatistician > Science Team > Vitatron B.V. > Meander 1051 > 6825 MJ Arnhem > Tel: +31/0 26 376 7365 > Fax: +31/0 26 376 7305 > Jim.Groeneveld@Vitatron.com > www.vitatron.com > > My computer may have missed me, I did not; it, that is. > > [common disclaimer]


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