2
votes

I have a proc sql code, creating table as below:

    proc sql; create table aa as 
    select distinct
     id, question, answers;from stg.bag ;
    quit;
proc print data=work.aa;
var 
 id question answers;  run;

I have warning when I run this query in SAS data integration, when I run this query in Enterprise Guide I don't have. Warning is:

WARNING: Data too long for column "question"; truncated to 127 characters to fit.

I put length=2000 next to question at proc sql code, but still giving me error. My confusion is, should I put the length in proc sql or proc print code. The warning is after proc print code.

1

1 Answers

1
votes

PROC PRINT is complaining here, probably because you're printing to the Listing destination or some other destination that has a limitation to the total width of a printed line. It's not saying that the variable is truncated in the data set- it's being truncated in the printed page, is all, so that you don't overflow the page width.

To fix this, you might be able to change to a destination supporting wider pages, such as HTML, though it depends on how you're using/viewing this output.