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_ ;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.