|
Thanks a lot Mark!
I didn't expect that the macro variable is not going to let me have
non-printable chars in the SEPARATED BY .
I may go with your first suggestion. It's good and simple enough. Why I made
things complicated? :)
If I really need to use SEPERATED BY, I will do;
proc sql noprint;
select name into :name1 - :name999
from mydata;
quit;
%do i=1 %to &sqlobs;
%put &&name&i;
%end;
Wei Cheng
=================================================================
http://www.geocities.com/prochelp
INTERNET and Web Resources for SAS Programmers and Statisticians
=================================================================
>From: "Terjeson, Mark" <TerjeMW@dshs.wa.gov>
>To: "'wei cheng'" <cheng_wei@HOTMAIL.COM>, SAS-L@LISTSERV.UGA.EDU
>Subject: RE: Hex value for line feed
>Date: Thu, 29 Mar 2001 11:56:11 -0800
>
>Hi Wei,
>
>
>data mydata;
> name = 'Fred ';output;
> name = 'Wilma ';output;
> name = 'Barney ';output;
> name = 'Betty ';output;
> name = 'Pebbles';output;
> name = 'BamBam ';output;
> name = 'dino ';output;
>run;
>
>
> * the carraige-return, line-feed ;
> * are decimal 13,10 or hex 0d,0a ;
>
> * but the macro variable is not going ;
> * to let you have non-printable chars ;
> * in the SEPARATED BY ;
>
>proc sql noprint;
>select name into :namelist separated by ' '
>from mydata;
>quit;
>%put namelist is >&namelist<;
>
>
> * how about ;
>data _null_;
> set mydata;
> put name;
>run;
>
> * or how about ;
>data _null_;
> stmp = trim(left("&namelist"));
> wordcount = length(stmp) - length(compress(stmp)) + 1;
> do i = 1 to wordcount;
> name = scan(stmp,i);
> put name;
> end;
>run;
>
>
>Hope this is helpful,
>Mark Terjeson
>Washington State Department of Social and Health Services
>Division of Research and Data Analysis (RDA)
>mailto:terjemw@dshs.wa.gov
>
>
>
>-----Original Message-----
>From: wei cheng [mailto:cheng_wei@HOTMAIL.COM]
>Sent: Thursday, March 29, 2001 11:27 AM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Hex value for line feed
>
>
>If I create a macro variable from PROC SQL; SELECT INTO clause. For
>example:
>
>Proc sql noprint;
>select name into :namelist seperated by ' '
>from mydata;
>quit;
>
>Then I need to put the &name to the log:
>
>%put &namelist;
>
>The Log will shows the name list in one line seperated by a blank. If I
>need
>different name shows in different line, I think that I need to use the hex
>value of line feed to seperate the names when generating the &namelist. I
>used to have Ultraedit that I can check the hex value there, but I don't
>have the Ultraedit any more.
>
>Can any one provides me the Hex value for the line feed?
>
>Or if you have some better methods to achieve that?
>
>TIA,
>
>
>
>
>
>Wei Cheng
>=================================================================
>http://www.geocities.com/prochelp
>INTERNET and Web Resources for SAS Programmers and Statisticians
>=================================================================
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at http://explorer.msn.com
>
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
|