Date: Mon, 20 Jun 2005 19:03:39 +0530 "Sharma, Diwakar (GE Equipment Services, consultant)" "SAS(r) Discussion" "Sharma, Diwakar (GE Equipment Services, consultant)" Re: Macro Question (reformulated) To: "Richard A. DeVenezia" text/plain; charset="Windows-1252"

Thanks

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Richard A. DeVenezia Sent: Monday, June 20, 2005 7:00 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Macro Question (reformulated)

Sharma, Diwakar (GE Equipment Services, consultant) wrote: > Hi, > > This is just a clarification. Whats the meaning of "wallpaper code" ??

Diwakar:

Wallpaper in the home is a wall covering having a pattern that repeats over and over. Also known as a tessellation.

Wallpaper code is a series of identically structured statements that repeat over and over, with small variations in each statement. When printouts of wallpaper code are tacked to a wall, they cover it like wallpaper.

This is wallpaper code,

if name = 'A' then output A; else if name = 'B' then output B; else if name = 'C' then output C; else if name = 'D' then output D; else if name = 'E' then output E; else if name = 'F' then output F; else if name = 'G' then output G; else if name = 'H' then output H; else if name = 'I' then output I; else if name = 'J' then output J; else if name = 'K' then output K; else if name = 'L' then output L; else if name = 'M' then output M; else if name = 'N' then output N; else if name = 'O' then output O; else if name = 'P' then output P; else if name = 'Q' then output Q; else if name = 'R' then output R; else if name = 'S' then output S; else if name = 'T' then output T; else if name = 'U' then output U; else if name = 'V' then output V; else if name = 'W' then output W; else if name = 'X' then output X; else if name = 'Y' then output Y; else if name = 'Z' then output Z; else ;

Attempts to edit wallpaper code are prone to typographic error. There is usually an underlying methodology that drives the need for 'wallpaper code', and the method can be functionally decomposed (i.e. finding the rules for the variations within the repetitions {patterning rule, or simple the rules}). When that is the case, it is more reliable to write a program that writes the code {using the rules} for where wallpaper processing is too occur.

Examine the above wallpaper again:

%* this macro snippet creates 26 if then else statements

%do x = 1 %to 26; %let letter = %sysfunc(byte(&x)); if name = "&letter." then output &letter.; else %end; ;

Richard A. DeVenezia

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