BookmarkSubscribeRSS Feed
Junyong
Pyrite | Level 9

Is there any automatic way to resize columns in VIEWTABLE? Here's one sample code.

filename LIPSUM temp;
proc http method="get" out=LIPSUM
url="https://en.wikipedia.org/wiki/Lorem_ipsum";
run;
data LIPSUM;
infile LIPSUM length=LENG lrecl=32767;
input LINE $varying32767. LENG;
LINE=strip(LINE);
if count(LINE,"Lorem ipsum dolor sit amet,");
LINE=tranwrd(LINE,"<p>","");
LINE=tranwrd(LINE,"<i>","");
LINE=tranwrd(LINE,"</i>","");
LINE=strip(LINE);
run;
quit;

This code may generate one dummy sentence that is too long to be displayed with no line break. As expected, here's the default view by VIEWTABLE.

1.png

There would be no problem technically as long as the data contain the sentences appropriately, but I still wonder if it's possible to automatically fit the column (or assign a specific width manually, or disable the automatic text wrap) as a matter of convenience. Hopefully, I want to force VIEWTABLE to display the sentence in one line and enable the horizontal scrollbar below, but any reasonable alternative would be also welcome. Dragging columns to expand every time is just pesky. By the way, I tried formatting (format LINE $100.) already, but it didn't adjust the column width. Thanks beforehand.

1 REPLY 1
pink_poodle
Barite | Level 11

This board says the easiest way to turn off line-wrapping is to use ODS output to HTML:

    Google Forum about SAS

 

Then this SAS Note says, to do that in HTML, you would need to use a template code they provide:

 

    Usage Note 23373

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 1195 views
  • 0 likes
  • 2 in conversation