SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
Mike_Davis
Fluorite | Level 6

Hello everyone,

I am curious about whether SAS has the ablility to put some special symbols to SAS log,(not into graph,but into SAS log).

those special symbols such as star,triangel ,circle or any other symbols not in the keybard.

Thanks.

Mike

5 REPLIES 5
Astounding
PROC Star

Mike,

There's only one way I've been able to do something like this.  It would affect only the PRINTED version, not the DISPLAYED version.  I used the .lst file, but it would apply equally to the .log file.

You have to dig out the instructions for your printer and find its set of escape codes.  These are sets of characters that, when sent to the printer, act as instructions rather than as characters to print.  Some of them will change the font that the printer uses.  So you have to find the symbols you are looking for in some other font.  Then in your program, write out the escape code to switch to that font, write the special character, and (MOST important) write out the escape code to switch back to the original font.  (Remember, these escape codes remain in effect.  You definitely don't want the next job that prints to use your special font.)

I suspect this is not the simple route you were hoping to find.

Good luck.

ballardw
Super User

The SAS LOG is basically a TEXT document. I suspect the only way you will get such symbols would be to make the FONT associated with the LOG one that shows such symbols. I also suspect that the remainder of the log will be very difficult to read.

Since I expect you would be using some form of conditional logic to generate the text involving those you might look into conditionally generating something set to a destination other than the log.

Astounding
PROC Star

One more thought about this ...

There are characters that are part of your current font that do not appear on the keyboard.  This would be a way to view them interactively:

data _null_;

do i=0 to 255;

   character = byte(i);

   put i character;

end;

run;

Some of these will be unprintable characters.  Some will perform functions, such as a page eject or a tab.  Do NOT try to print the results.  Depending on the printer you use, one of these bytes may be a signal that the printer should turn itself off.  But you will find some characters that don't appear on the keyboard yet could be displayed in the log.

Good luck.

PaigeMiller
Diamond | Level 26

On Windows computers, you can produce special symbols via holding down the Alt button and then typing a four-digit code. For example, the copyright symbol is Alt-0169. The cedilla (the letter c with a comma stuck on the bottom, used in some Eastern European languages and French), is Alt-0231.

So, with the following code, those two special symbols get written to the SASLOG.

data _null_;

    file log;

    copyright='©';

    cedilla='ç';

    put copyright cedilla;

run;

--
Paige Miller
Mike_Davis
Fluorite | Level 6

Thanks, and type the digit on number pad

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1728 views
  • 3 likes
  • 4 in conversation