Dear all,
I tried to combine several data together by using set statement.
Thought I ues length statement to set up the "var_level " as $ 100 . However , the var_level was still trucated.
Any solution ? Thank you very much ! (The length is enough to cover the var_level at each file. , no error message. )
Ivy
data rpt_cat;
length var_level $ 100. ;
set rpt_gender
rpt_uidxinsplan ;
run;
3218 data rpt_cat;
3219 length var_level $ 100. ;
3220 set rpt_gender rpt_uidxinsplan ;
3221 run;
NOTE: There were 3 observations read from the data set WORK.RPT_GENDER.
NOTE: There were 14 observations read from the data set WORK.RPT_UIDXINSPLAN.
NOTE: The data set WORK.RPT_CAT has 17 observations and 7 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds
Please post code used.
Make sure you put length statement before the SET statement.
Most likely, the variable also has a format attached to it that is truncating the displayed value. Add the FORMAT statement AFTER the SET statement, to remove the format:
format var_level;
Good luck.
Edit: I see, @Astounding was faster and had the same idea.
Hello @Ivy,
The reason for the truncation may be a format (such as $17.) which is permanently associated with variable VAR_LEVEL. This would be shown in column "Format" of the PROC CONTENTS output for dataset RPT_CAT. You could get rid of this format by adding the following statement before the run; in your data step:
format var_level;
Thank you very much ,
Removing format works beautifully !
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.