BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I'm getting the error message 'Data too long...truncated to 94 characters to fit' and in my output, the sentence for the variable "COMMENT" is getting cut off and the entire paragraph is not showing. How do I increase the number of characters allowed in proc print so that I can see the entire entry, no matter how long the data are?

thanks!!!
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
Here's one note that describes that message in conjunction with PROC IMPORT followed by a PROC PRINT:
http://support.sas.com/kb/5/492.html

However, I can duplicate that error message by just setting a small linesize for my session or job. Consider this program that makes a BIG variable called NEWNAME -- it is a length of 259 characters -- 8 for name, plus ':', plus a long string of '1234Z' :

[pre]
data biglines;
set sashelp.class;
length newname $259 temp $250;
temp = repeat('1234Z',49);
newname = catt(name,':',temp);
run;
[/pre]
Anyway, after I make that big variable, now I want to use PROC PRINT. Notice how I turn on the LISTING window and set a small LINESIZE in this first PROC PRINT:
[pre]
ods listing;
options linesize=64;
proc print data=biglines;
var name age newname;
title 'linesize set to 64';
run;
[/pre]
The note in the log says:

WARNING: Data too long for column "newname"; truncated to 60 characters to fit.


And, I still get an error message after the second PROC PRINT because 259 (the length of NEWNAME) is bigger than the max linesize of 256 that I can set:
[pre]
options linesize=256;
proc print data=biglines;
var name age newname;
title 'linesize set to 256';
run;
[/pre]


WARNING: Data too long for column "newname"; truncated to 252 characters to fit.


However, since ODS HTML ignores linesize, you can use the following code and get your "big" variable displayed in its entirety in the HTML output file.
[pre]
** using ODS;
ods listing close;
ods html file='c:\temp\biglines.html' style=sasweb;
proc print data=biglines;
var name age newname;
title 'Using ODS';
run;

ods html close;
ods listing;
[/pre]

If you have a big variable that is less than 256 characters or if your total linesize is less than 256 characters, you may be able to stop that error message with a simple change to the LINESIZE option. Otherwise, you can switch to ODS HTML in order to avoid the problem. On the other hand, if you are having the first PROC IMPORT related problem, then you may have to apply the service pack described in the Tech Support note.

cynthia
Rama_s
Calcite | Level 5

Hi Cynthia,

 

I still got the same error when I am using ODS HTML without closing ODS Listing.

 

Its must be ODS Listing which is causing the error.

 

Rama

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!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 2 replies
  • 18683 views
  • 0 likes
  • 3 in conversation