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-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
  • 3 replies
  • 2477 views
  • 3 likes
  • 4 in conversation