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.;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 6 replies
  • 526 views
  • 1 like
  • 4 in conversation