- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am a student just started to learn SAS, and I encountered a strange problem that I can't figured out. When I run the example given from the lecture note using PROC FREQUENCY, I got the correct result in the output window with the exception that the style line in my table was displayed in bunch of question marks. Please see attached for what I mean, and what should be correct result be (I scanned in the correct result from my note). I checked my log files and there was no error, warning, or note displayed. It was a rather straight forward and simple PROC FREQUENCY Code too.
Has anyone encountered this before and/or know how to resolve the issue?
My Own Result (with bunch of question marks):
The "Correct" Result I Scanned from my lecture notes (just a simple line):
Thanks so much!
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In fact, it would seem that all my "lines" have been converted to "???". See one more example below. Any help would be much appreciated!
My result from a simple PROC FORMAT FMTLIB:
The "Correct" Result from Lecture Note:
Thanks,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Check options formchar= at support.sas.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Keshan -
Thanks! I added OPTIONS FORMCHAR="|----|+|---+=|-/\<>*"; and now at least the result is readable and somewhat acceptable (see screenshots)! However, it is still not quite the same (or as pretty) as the results from my lecture notes. Do you or anyone know why that is and what I need to do to print "smooth, straight lines"?
P.S. The class only uses Listing Output, we do not use HTML.
Thanks,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That maybe different SAS Version between yours and lecture .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Are you both outputting the data to the same destination with the same style? It looks to me like your using basic text (possibly output window) output, and the tutor may be using the HTML output window. If you are using Base SAS, then you can goto Tools->Options->Preferences, then the Results tab and check Create HTML
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
OR use the default FORMCHAR and assign the SASFONT format in the program you are using to look at the results.
But the HTML / ODS output would be better.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
HI Ballardw -
My listing output is defaulted to display SASFONT - and I'm positive that the lecture note is not using the HTML output. In fact, our SAS class asked us to turned off the HTML output completely for the whole course because part of the course is about learning how to gain better control over your output results. (But yes, the HTML Outlook does look very nice, at least that!)
The more I look into it, the more I think somehow the SAS output window (or maybe Windows itself) just cannot process the SAS Monospace fonts. As this page (FORMCHAR Option - sasCommunity) points out, SAS Monospace font includes special characters that help draw up the smooth line you see in the output. However, I have checked that SAS and my Windows 7 have properly installed sas1252.font, sasmono.ttf, and sasmonob.ttf. I even tried deactivating all of the Chinese fonts I have, but nothing seems to be working. With default FORMCHAR, it is still "???????????????????"...
Thanks,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If I guess right. You are using different version SAS like Chinese version SAS or Korean version SAS . That would generate different look from English version SAS. Can you talk to SAS Technology Support about this question?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Keshan -
I definitely installed the English version. I downloaded directly from my school's software store (in United States) and is currently using student license. It doesn't look like any other students is having the same problem - though people have different versions 9.2, 9.3, and 9.4 - I am using 9.4. During installation, I distinctively remembered I used "English" as my only language to install SAS. My professor has encountered this problem before, but other than FORMCHAR, she doesn't know what else to do either. You're right, I'm spending way too much time trying to figure it out, so I might as well give SAS tech support a call...
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If the output in the SAS Output window looks "nice" meaning that the lines in tables are connected then that is most likely the SAS monospace font. When you save that output to a text file (default .lst) and open it in another program, such as Notepad, Wordpad or Word the font information is gone. Those programs will use their default font. In the case of Notepad or Wordpad, almost guaranteed to be Microsoft's Courier New. Which yields a script sort of f for horizontal lines for example. If the file is open in Wordpad 1) select all text and 2) change the font to SAS Monospace. With the default formchar option, not the one to use the lower ASCII +- and such, then the lines will look nice.
Microsoft changed the behavior of the original IBM PC fonts which used nice box drawing characters about the time of DOS 4 to mess with non-Micro$oft applications that used those fonts for prettier output. Or open the files with the SAS Editor.
Remember, straight text files do not have font information and appearance is controlled by the font active in an application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, Ballardw. That's very helpful information. I know what you're talking about, the screenshots I've taken above are directly taken from my SAS Output window - and even when I save it as .lst and open in an application like Wordpad and change the font to SAS Monospace (which is installed for both SAS and my Windows), the line still appear as question marks "??????" - and this is using the default FORMCHAR (OPTIONS FORMCHAR = "‚ƒ„…†‡ˆ‰Š‹Œ+=|-/\<>*";).
Knowing this and your information, I definitely think it's either SAS application or my Windows System not being able to process some of the special characters from SAS Monospace...
P.S. I am LOVING the "non-Micro$oft", I will have to steal that from you.
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Something else to look at:
proc options group=envdisplay; run;
See what fonts may show up. If you see anything that might be a DBCS font that could be an issue as the default characters in FORMCHAR are in the ASCII 127-255 range. If a code outside of that range shows up then and ASCII font gets confused. One hint to this is that your ? don't go all the across the data using.
Also missing characters at the beginning of Start End Label Low High and what I assume were Black Asian Indian and White.