Hi:
If you know what LENGTH you want, then you can simply put a LENGTH statement before your SET statement. The program below shows the creation of datasets A and B with variables of differing lengths. Note how the PROC CONTENTS after the SET, shows that the new file uses the LENGTH from the LENGTH statement.
Technically, you only need a LENGTH statement for your character variables, since the numeric variables will all have a length of 8 by default, but I wanted to show the difference in how you would set a length for a numeric variable if you needed to. Without an explicit LENGTH statement, SAS will use the LENGTH from the dataset that is listed first on the SET statement -- this can result in the truncation that you describe. Using an explicit LENGTH statement avoids any uncertainty about what the final length will be for the variables. You might control this by putting the dataset with the longest length first -- but it would need to have the longest length for ALL the variables for this approach to work.
cynthia
[pre]
data a;
infile datalines;
input name $ numvar;
return;
datalines;
a2 1111
b1 2222
c3 3333
;
run;
proc contents data=a;
title 'Dataset A';
run;
data b;
infile datalines;
input name $11. numvar;
return;
datalines;
x1xyzxxxx33 333.3
y2pqryyyy44 444.44
z3stuzzzz55 555.575
;
run;
proc contents data=b;
title 'Dataset B';
run;
data together;
length name $20 numvar 8;
set a
b;
run;
proc contents data=together;
title 'Use Lengths from LENGTH statement';
run;
proc print data=together;
title 'Show Datasets Concatenated';
format numvar comma12.3;
run;
[/pre]