BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
robertrao
Quartz | Level 8


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

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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

View solution in original post

3 REPLIES 3
OS2Rules
Obsidian | Level 7

Turn off the LISTING and the error goes away.

ODS LISTING CLOSE.

ballardw
Super User

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.

Tom
Super User Tom
Super User

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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2810 views
  • 3 likes
  • 4 in conversation