Hi,
I have a column (code)which has a length 255
format $255
informat$255
I change its length to 7
When i run a PROC REPORT WITH OUTPUT STATEMENT
I get the following error???
ERROR: The width of Code is not between 1 and 213. Adjust the column width or line size.
NOTE: This affects LISTING output.
Could you help me figure out how to proceed
Thanks
You didn't change the FORMAT. Try this example to see the same error message.
proc report data=sashelp.class nofs;
format name $255.;
run;
SAS has a nasty habit of attaching $xxx. formats to characters variables especially when using PROC IMPORT or SAS/Access. You can remove them with a format statement that lists variables but does NOT specify any format.
format _character_ ;
Turn off the LISTING and the error goes away.
ODS LISTING CLOSE.
I suspect that you didn't actually manage to change the length as you think and your current LINESIZE system option isn't large enough to accomodate the variable Code.
You may be able to get the output using
options linesize=max;
OR in the proc use Format Code $7.; That should display the first 7 characters of the variable.
Run proc contents on the dataset containing the variable to verify the actual length.
You didn't change the FORMAT. Try this example to see the same error message.
proc report data=sashelp.class nofs;
format name $255.;
run;
SAS has a nasty habit of attaching $xxx. formats to characters variables especially when using PROC IMPORT or SAS/Access. You can remove them with a format statement that lists variables but does NOT specify any format.
format _character_ ;
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.
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.