How do I duplicate data but still process it? I know that you can use the output statement to create a duplicate record, but if you do any processing after this point it shows up as missing. You can see this in the Test dataset - the Runs field, created after the output statement, is blank for Smith's duplicated observation. data have;
infile datalines dsd;
input Name : $9. Score1-Score3 Team ~ $25. Div $;
datalines;
Smith,12,22,46,"Green Hornets, Atlanta",AAA
Mitchel,23,19,25,"High Volts, Portland",AAA
Jones,09,17,54,"Vulcans, Las Vegas",AA
;
data test;
set scores;
if name = "Smith" then output;
Runs=sum(Score1,Score2,Score3);
output;
run;
data want;
infile datalines dsd;
input Name : $9. Score1-Score3 Team ~ $25. Div $ Runs $2.;
datalines;
Smith,12,22,46,"Green Hornets, Atlanta",AAA,80
Smith,12,22,46,"Green Hornets, Atlanta",AAA,80
Mitchel,23,19,25,"High Volts, Portland",AAA,67
Jones,09,17,54,"Vulcans, Las Vegas",AA,80
;
... View more