[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: Hex value for line feed
From:       Richard DeVenezia <radevenz () IX ! NETCOM ! COM>
Date:       2001-03-31 0:26:24
[Download RAW message or body]

RRak sent in a separate e-mail:
>
> Mr. V., I can get it to put a new line (or new page or
>            carriage return or almost anything else) by
>            enclosing the macro var (in the %put stmt)
>            within double quotes. (I notified Mr.Cheng
>           (the original poster) of this yesterday.) Try...
>
> %let sv=%str('0a'x); /*or any character or sequence*/
>
> data test; v='abc'; output; v='def'; output; run;
>
> proc sql noprint; select v into :v separated by &sv from test; quit; run;
>
> %put "&v";
>
> Your comments are appreciated.
>
> Regards,  R.

'Non-printables' in the log-window show up in the log in various ways.
Sometimes (as noted) it is replaced with a space

Sometimes you might see a place holder character (such as a block outline
character)
data _null_;
put '0a'x;
run;

Sometimes you will see a message about unquoting occurring to be able to
show a value in the log.
(sorry no example handy)

When a log-window (or log) is saved to an operating system file the
character placed in the log can be 'interpreted' differently by other log
viewers (such as notepad, sasviewer, ...)

In a SAS session, when the log shows a space, you pretty much can expect a
space when the same log is directed to a file.
If the log shows a 'place holding' character like a rectangle you can expect
a byte of a different flavor in the log file.

The following codes log when seen in the log window, and when seen in the
saved log file will be different.  In the sas log window you will see a
place holder character (the '0A'x) in the log file an editor will see the 0A
will be interpreted be a newline.

As for why the double quotes cause the macro system to present '0A'x as a
place holding block character instead of a space, I am not sure.

try with and with out printto

proc printto log='C:\temp\test.log' new;

data abc;
a=1; output;
a=2; output;
run;

proc sql noprint;
  select a into :A separated by '0a'x from abc;
quit;

%put &A;    %* 0A (between 1 and 2) presented as a space;
%put "&A"; %* 0A presented as a newline;
%put %str(&A);    %* 0A presented as a space;
%put %sysfunc (quote(&A));    %* 0A presented as a space, I thought for sure
this would present as a newline;

proc printto log=log;
run;

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic