Date: Sat, 26 Feb 2000 15:19:13 PST
Reply-To: James Zhou <jameszhou@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: James Zhou <jameszhou@HOTMAIL.COM>
Subject: Re: Help needed
Content-Type: text/plain; format=flowed
Paul,
Yahoo!!!!!!
That's it. That's one I need!!!
Thank you, Paul, so much! You are the winner!!!
My thanks also are given to David Nasser, Matthew M. Zack, Wayne Woo, Harry
Droogendyk, and Ans Jessens for their inputs.
The case is closed unless there are more efficient ways.
Regards!
James
>From: "Paul Dorfman" <paul_dorfman@hotmail.com>
>Reply-To: sashole@mediaone.net
>To: jameszhou@HOTMAIL.COM, SAS-L@LISTSERV.UGA.EDU
>CC: sashole@mediaone.net
>Subject: Re: Help needed
>Date: Sat, 26 Feb 2000 22:56:24 GMT
>
>James,
>
>Before plugging "&data" into the IN operator, use the expression
>
>%let data =
>%sysfunc(tranwrd(%sysfunc(compbl(&data)),%str( ),%str(" ")));
>
>to surround its inner tokens by double quotes. In the case the parm
>contains just one token, it will work OK, too.
>
>Kind regards,
>========================
>Paul M. Dorfman
>Jacksonville, Fl
>========================
>
>>From: James Zhou <jameszhou@HOTMAIL.COM>
>
>>I want to develop a macro which can handle multiple data sets in each
>>invocation.
>>
>>Here is the simplified macro:
>>
>>%macro data(libname=,data=);
>>
>>%let libname=%upcase(&libname);
>>%let data=%upcase(&data);
>>
>>proc sql NOPRINT;
>> select memname into :datasets
>> separated by ','
>> from dictionary.tables
>> where libname eq "&libname"
>> %if %length(&data) gt 0 %then %str(and memname in ("&data"));;
>>quit;
>>
>>%mend;
>>
>>The macro works if
>>%data(libname=mylib, data=credit)
>>
>>However, I'd like to do something like this:
>>
>>%data(libname=mylib, data=credit address finan phone)
>>
>>I need translate the value (CREDIT ADDRESS FINAN PHONE) of &data into
>>"CREDIT" "ADDRESS" "FINAN" "PHONE" to be used in the SQL.
>
>
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
|