BookmarkSubscribeRSS Feed
Inp
Obsidian | Level 7 Inp
Obsidian | Level 7
Hi
When I run below coding , the column header is truncated to 'this is testing more than thirty' but my acutal column header is 'this is testing more than thirty two charaters'. Can any one help to fix this problem.

Thanks so much for your help in advance.



data temp;
input x $50.;
label x = 'this is testing more than thirty two charaters';
cards;
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeee
;
proc print data=temp label;
run;

PROC EXPORT DATA=temp
OUTFILE='C:\PROJECTS\TPA_Current\OCT2009\testing.csv'
DBMS=csv
REPLACE LABEL;
RUN;
3 REPLIES 3
LinusH
Tourmaline | Level 20
I got the same result.
Can't find any limitation mentioned in the documentation, so you could open a track to SAS support for clarification.
To fix this, you probably have to do some data step programming instead.
/Linus
Data never sleeps
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
It appears that PROC EXPORT still uses the SAS v7 (then current) max label text length. Oddly, the LABEL option was just added with SAS v9.2, I believe.

You may also notice in the SAS DOC for EXPORT that any SAS variable that is longer than 32 characters is also truncated (without the LABEL parameter of course). Likely doesn't sound like it will be considered a DEFECT, given this condition.

Regardless, it's important to contact SAS support to give them the feedback on these types of limitations rather than presuming they already know.

Scott Barry
SBBWorks, Inc.
Cynthia_sas
Diamond | Level 26
Hi:
One possible workaround is to use ODS CSV, as shown below.
cynthia
[pre]
data temp;
length x y $50;
input x $;
y='twas brillig and the slithy toves';
label x = 'this is testing more than thirty two characters'
y= 'Not as long for the label';
cards;
aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeee
;
run;

ods listing close;
ods csv file='c:\temp\longlabel.csv';

proc print data=temp label;
run;
ods csv close;
[/pre]

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 3094 views
  • 0 likes
  • 4 in conversation