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 (October 2002, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 30 Oct 2002 09:41:33 -0600
Reply-To:     "MCQUOWN, GARY" <GMCQU90@ENTERGY.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "MCQUOWN, GARY" <GMCQU90@ENTERGY.COM>
Subject:      Re: into: seperated by syntax
Comments: To: "Goldman, Brad (AT-Atlanta)" <Brad.Goldman@AUTOTRADER.COM>
Content-Type: text/plain

Brad;

You can concatinate "done" and " ' " on your string with:

%let homelist = ' &types done ' ;

But if all you need is a way to determine that you are at the end, consider a %while or %until.

/* example */

%Macro looper1(list1=);

%LET i = 1; %DO %WHILE ((%scan(&list1, &i))>' '); %let varn = %scan(&list1, &i);

/** code **/

%LET i = %EVAL(&i+1); %END; %MEND LOOPER1;

HTH; Gary

-----Original Message----- From: Goldman, Brad (AT-Atlanta) [mailto:Brad.Goldman@AUTOTRADER.COM] Sent: Wednesday, October 30, 2002 9:21 AM To: SAS-L@LISTSERV.UGA.EDU Subject: into: seperated by syntax

Consider the following from the SAS online docs: proc sql; select distinct quote(style) into :types separated by ', ' from sasuser.houses;

Anyone know if there is a way to prepend/append the &types macro variable created within this SQL step? For example, I might want the final string not to be CONDO, RANCH, SPLIT, TWOSTORY, but Houselist: 'CONDO, RANCH, SPLIT, TWOSTORY done' I can't find any reference to it... but sometimes docs do not tell all.

If there is a not a way, does anyone agree with me that it would be nice to have? For example, you could say:

proc sql; select distinct quote(style) into :types separated by ', ' beginning with "Houselist: '" ending with " done'" from sasuser.houses;

Brad


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