Hello all, I have 10 SAS datasets, which I want to combine together (to concatenate). Some variables appear in all files, some only in some. Each file represent a different visit in a clinical trial. I had a problem with variables being numeric in one dataset and character in another. There weren't too many of them, so I dealt with it manually. Now a new problem. Some character variables (usually the ones of the free text), have different length in differnt datasets, so I get lot's of warnings in the log, and my data is truncated. Afte looking online, I tried the following thing, before using the SET statement, I used the length, like this: data All;
length Var1 $ 160 Var2 $ 150;
Set DS1 DS2 DS3;
run; So now there are no warnings anymore in the log, however, first of all, the data is still being truncated ! Secondly, when looking at the attributes of the specific variables, I see that the length was changed indeed, but the format wasn't, for example: If Var1 had length 109 in DS1 and 160 in DS2, than I do see 160 in the length, but in format I see $109, which is weird. So my quesion is, assuming I have several dataset, with hundreds of variables in each, and assuming that the type is finally matching, how do I concatenate them all, if some character variables have different lengths ? Thank you !
... View more