BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PaigeMiller
Diamond | Level 26
data months;
    do i=1 to 4;
	month=intnx('month',today(),i,'b');
	output;
	end;
	format month yymm7.;
run;

This is what I see in viewtable in SAS 9.4M5 Windows 10. The column for MONTH is too narrow. Yes, I can manually expand the column to see the values of the data, but this gets tiresome after having to do this all the time (and my real data has several month columns). So, how do I fix this programmatically so that viewtable will make the column wide enough?

 

Capture.PNG

--
Paige Miller
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
Try expand the width of format
format month yymm9.;
Or use other format like yymmn7. ;

View solution in original post

6 REPLIES 6
Tom
Super User Tom
Super User

Did you try using a different font?  Not sure what setting impacts ViewTable, but there are font setting options in Display Manager.  Tools -> Options -> Font...

Ksharp
Super User
Try expand the width of format
format month yymm9.;
Or use other format like yymmn7. ;
PaigeMiller
Diamond | Level 26

Any explanation why viewtable works with YYMM9. but not YYMM7. ?

--
Paige Miller
RichardDeVen
Barite | Level 11
The viewtable layout engine (internal) sets the column width wider for a format that says its data render is 9 characters wide.

On my system the 7. format set aside is 47 pixels and 9. is 59 pixels. The minimum pixels need to wholly display the sample data is 49 pixels. I presume the M in the format cause the data render, with default font settings, to require a final graphic (screen) rendering wider than the estimate for space needed. So you get ****** instead.
Ksharp
Super User
I don't know why . If I run your code under SAS9.2 . The result is good .
Anytime if you find ***** in viewtable , that means the width of format is not enough .
Ksharp
Super User
format month yymm12.;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 1327 views
  • 1 like
  • 4 in conversation