BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ari2495
Obsidian | Level 7
1167
1168  data all_res_smd;
1169  set res_smd_:;
1170  run;

WARNING: Multiple lengths were specified for the variable Segmento by input data set(s). This
         can cause truncation of data.

please, help me to fix this warning

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

First a note about creating sets you intend to combine: make sure properties like length and variable type are consistent when the data sets are created.

 

You can avoid the message and possibility of truncation but providing a Length statements for such variables before the SET statement: Below assumes that the variable Segmento is character and that the longest length defined for any of the datasets is less than or equal to 100. Use your preferred value if 100 is too long.

data all_res_smd;
length Segmento $ 100.; set res_smd_:; run;

 A side affect of this is that Segmento will appear as the first column in the data set as it is the first variable used in the data step.

View solution in original post

2 REPLIES 2
ballardw
Super User

First a note about creating sets you intend to combine: make sure properties like length and variable type are consistent when the data sets are created.

 

You can avoid the message and possibility of truncation but providing a Length statements for such variables before the SET statement: Below assumes that the variable Segmento is character and that the longest length defined for any of the datasets is less than or equal to 100. Use your preferred value if 100 is too long.

data all_res_smd;
length Segmento $ 100.; set res_smd_:; run;

 A side affect of this is that Segmento will appear as the first column in the data set as it is the first variable used in the data step.

Kurt_Bremser
Super User

In almost all cases, such problems arise from a faulty process which brings the data into SAS. You need to fix that so your datasets have a consistent structure.

  • no Excel files
  • no PROC IMPORT

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

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