BookmarkSubscribeRSS Feed
SASAna
Quartz | Level 8

Hi SAS Users,

 

I wanted to check if there is any way to avoid truncation of the data for the below scenario of data append using proc append.

 

I have 10 different tables data i am appending which has different lengths and different data types (around 500 attriutes in each table).

 

I did reformatting of the data for all the variables which ever was different , but due to length issues , data is being truncated after appending it.

 

Example : 

 

data length X $10. Y $20, ;

 

 Proc Append  Base= Base_table     Data= sas_ds    FORCE NOWARN;

 

I tried to use length statement for dataset sas_ds by taking the max length of the attributes, but that did not help me much.

 

Can you please suggest the options?

 

Thanks,

Ana

2 REPLIES 2
Tom
Super User Tom
Super User

You need to make the variables in BASE table have the proper length since that is the one that defines the table that PROC APPEND is adding the data into.

 

Note that SAS will issue a warning if the vairable in the DATA table is defined as longer than the variable in the BASE table, even if all of the actual values will fit.

 

LinusH
Tourmaline | Level 20
Did you mean that you tried LENGTH in proc append? That's not possible. You could however use views to expand length of variables and append from them.

You said you reformatted all variables. Did you mean changing the SAS format? If so, that doesn't help.

Do what is your challenge? Syntax or the volume (no of variables)?
Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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