11-27-2016 05:29 PM
When I try to save a work.dataset as a sas.dataset I get the following warning message:
Multiple lengths were specified for the variable X by input data set(s). This can cause truncation of data.
The dataset (WIO) has 2467 columns (C, D, E etc.) and 36960 rows. IIOdat is the library.
11-28-2016 09:45 AM
SAS will look at the first instance of a field and set the ongoing format based on what it sees that first time. If some other value is assigned to that field that is longer it may not fit (say it sees a 5 character field first and then another dataset comes in later and has a 10 character value in that field).
It looks like you need to do some data grooming on the datasets you wish to use in the macro, formatting each variable to the same length before setting them together.
11-28-2016 10:46 AM
I would place a small wager that all of your WIO&i data sets were created with separate Proc Import statements. Import guesses about the length of variables and if they length changes for values from set to set or the number examined in each proc import (default 20) is small then you get different results.
You may be better off going back to the import and use one of the methods to read each file with the same data step.
NOTE: Starting with Excel files often compounds this issue due to the lack of constraints on individual files.
11-30-2016 09:58 AM
Thank you for the advises. I ended up changing the code for how I imported the csv files in the beginning of the programme, where I specified the length of the character and numeric variables - It seems like that solved the truncation problem. Thus, in stead of using 'PROC IMPORT' to import multiple csv files, I used the INPUT statement to import the files.