BookmarkSubscribeRSS Feed
HanaR
Fluorite | Level 6

Hello,

The assignment I am working on is to convert reports in TPL to SAS, which I did;

The problem is that the requirements indicate that the developers MUST use proportional fonts to look just like the reports in TPL.

Everything looks fine except one column in the report;

The column is character field containing "name of the each state" and "dots (.)" to fill in blank.

I am using proc report to generate the report;

attached files are my sas code and results PDF files: one with Arial/ one with SAS monospace.

the problem area in sas code is that "COMPUTE T1_STCNTY_NAME". I created dynamic format to fulfill the requirements, but with Font Arial, it is so hard to meet the requirements.

Your suggestions, ideas, or tips would greatly be appreciated.

Thanks.

Hana


2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:

  The issue is the font, not the code. here's why:

2 text strings, 10 letters, followed by 10 periods/dot

Arial 14pt

wwwwwwwwww..........

iiiiiiiiii..........

Courier New 14pt

wwwwwwwwww..........

iiiiiiiiii..........

Helvetica 14pt

wwwwwwwwww..........

iiiiiiiiii..........

Terminal 14pt

wwwwwwwwww..........

iiiiiiiiii..........

As you can see, the "proportional space fonts", like Arial and Helvetica do not "line up" because the letter w takes up more space horizontally than the letter i, therefore, the dots do not line up either. However, with the "fixed pitch" or "monospace" fonts, like Courier New or Terminal, the letter w and the letter i take up the same amount of horizontal space, so the dots "line up". Notice how Courier and Terminal are slightly different from each other.

 

If your requirement is to use Arial or any proportional font and have the dots "line up" , then I fear you have been set an impossible task. You will have to use a font like Courier New or Terminal or SAS Monospace for your report.

I am not sure I understand the requirement, entirely. TPL (Table Producing Language) is like PROC TABULATE and to some extent, like PROC REPORT, in that you can use TPL to produce cross-tabular tables. When I worked with TPL, it created output printed on a line printer that used a fixed pitch or monospace font (not a proportional font). So I am not sure that you can replicate that look without using Courier New.

I  am teaching and not able to run code. I would suggest that you work with Tech Support, but they really can't  change  the fundamental behavior of proportional spaced fonts. ODS does have some style attributes that would achieve indenting (such as you used to do with TPL), perhaps those will help. But if your purpose with the dots is to make them line up in a proportional font, I think you are not going to have success.

cynthia

HanaR
Fluorite | Level 6

Ms. Cynthia,

Thank you so much for your explanation; it is a GREAT help!

Sincerely,

Hyunjoo Reed

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1579 views
  • 0 likes
  • 2 in conversation