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 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!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

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