BookmarkSubscribeRSS Feed
ranikeka
Calcite | Level 5
Hi

My data truncated while appending multiple data sets and also changing data structure Could you please help me out how to retrieve complete data in variables.

Thanks

Happy thanksgiving day

4 REPLIES 4
ballardw
Super User

Show the LOG from the step that did this. Copy the entire text of the data step or Procedure with ALL notes, warnings and messages. Paste into a code box opened on the forum with the </> to preserve text formatting.

 

I will bet a largish stack of $$ that your log will say something like.

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

Which means that you need to determine which variable(s) lengths are longer and address the issue. HOW depends on the method you used to append the sets.

 

Warning: If your data is originally coming from Proc Import or other import wizard you will find yourself having to fix this frequently when reading files with common variables. Each separate import makes guesses as to the lengths of variables based on rows examined and can change quite a bit from file to file based on content.

 

ranikeka
Calcite | Level 5
I have imported more than 100 excelfiles to sas using macro. While appending, gives warning: Variables has different lengths on base and data files. More in data.

How would I do correct this as my data is truncating. Please help me out
Thanks
Kurt_Bremser
Super User

The proper way of avoiding this in a production environment is, of course, to avoid Excel files altogether. Save the data to a sensible format (CSV or similar), which you can read with a consistent data step.

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!

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
  • 4 replies
  • 1014 views
  • 0 likes
  • 3 in conversation