BookmarkSubscribeRSS Feed
yelkenli
Calcite | Level 5

I use an excel SAS add-in that let's me run SAS code.  I develop the code in SAS Studio.  The resulting dataset in the excel worksheet has some very wide column widths.   The wide columns are for variables with lengths of 12,000 for free form entry.  I do not want to truncate any of the text.   

 

Is there control the column width in excel?

 

Proc print data=mydata;
Run;
2 REPLIES 2
ballardw
Super User

To set all of the cells to the same width something like:

proc print data=sashelp.class 
   style(data)={cellwidth=1in}
;
run;

If you want to set specific variables widths then you will need to add VAR statements to list the variables and set the style for the specific variable to a desired width such as

 

proc print data=sashelp.class 
   ;
   var name sex age;
   var height /style={cellwidth=2in};
   var weight;
run;

Which leaves SAS defaults for the variables without the style override and sets that one variable to a width of 2 inches.

 

Anything with 12,000 characters is likely going to result in very tall cells if you reduce the width to 1 or two inches. You will have to investigate the Excel formats to turn off wordwrap, which I can't help with if that happens.

yelkenli
Calcite | Level 5

ballardw: 

Thanks for replying.  the SAS excel add-in tool appears to not use all of the SAS coding controls, as this did not work (similar result as my other forum thread).  If anyone uses the excel add-in, please chime in.  Any suggestions are appreciated.  

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 961 views
  • 0 likes
  • 2 in conversation