Date: Fri, 30 Mar 2001 18:20:06 -0500
Reply-To: wei cheng <cheng_wei@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: wei cheng <cheng_wei@HOTMAIL.COM>
Subject: Re: Hex value for line feed
Content-Type: text/plain; format=flowed
A faithful SAS-Ler also told me to use:
%let sv=%str('0A'x);
and use
... Seperated by &sv;
...
%put &namelist;
The strange thing is that he said in his log on Windows95 6.12, the names
can be put into different lines. But I trid both 8.0 and 6.12 on my Windows
NT, they always on one line with those square boxes in between.
Wei Cheng
=================================================================
http://www.geocities.com/prochelp
INTERNET and Web Resources for SAS Programmers and Statisticians
=================================================================
>From: "Terjeson, Mark" <TerjeMW@DSHS.WA.GOV>
>Reply-To: "Terjeson, Mark" <TerjeMW@DSHS.WA.GOV>
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Re: Hex value for line feed
>Date: Fri, 30 Mar 2001 12:41:17 -0800
>
>Thanks Richard,
>Yeah, that's a better way of saying it.
>I was trying to answer the question
>of getting it to show in the %put, and
>a space is all you'll see. Thanks for
>elaborating better.
>Mark
>
>-----Original Message-----
>From: Richard DeVenezia [mailto:radevenz@IX.NETCOM.COM]
>Sent: Friday, March 30, 2001 11:45 AM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Re: Hex value for line feed
>
>
>Mark:
>
>Acutally, SQL will let you used non-printables as separators. Try
>...
>separated by '0A'x
>...
>data _null_;
> a = "&namelist";
> r = rank (substr(a,5,1));
> put r=;
>run;
>
>You will see R=10 in the log
>
>The thing is, %put is NOT going to put a newline in the log, just the
>internal printable substitute that the macro system uses for non-printables
>(in this case it's a space)
>
>--
>Richard DeVenezia - SAS Macros and AF Tools
>http://www.devenezia.com
>
>
>"Terjeson, Mark" <TerjeMW@DSHS.WA.GOV> wrote in message
>news:B0562E2B5957D411A42800D0B782284003F4C52D@dshsmsgf1-a.dshs.wa.gov...
> > 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
|