data cholesterol_1;
infile 'path/file_1' delimiter='09'x TRUNCOVER DSD firstobs=2 ;
length variant $70 minor_allele $2 minor_AF 8
expected_case_minor_AC 8 low_confidence_variant $5
n_complete_samples 8 AC 8 ytx 8
beta 8 se 8 tstat 8 pval 8
;
input variant--ytx ( beta se tstat pval ) (:??32.) ;
run;
data cholesterol_2(drop = variant);
set cholesterol_1;
chr = scan(variant, 1,':');
bp = scan(variant, 2,':');
mutant = scan(variant, 3,':');
orig = scan(variant, 4,':');
run;
data cholesterol_3(drop = chr_ bp_);
retain
chr bp mutant orig minor_allele minor_AF
expected_case_minor_AC low_confidence_variant
n_complete_samples AC ytx beta se tstat pval
;
set cholesterol_2(rename = (chr=chr_ bp=bp_));
chr = input(chr_,1.);
bp = input(bp_,8.);
run; This is my code. and I would like to repeat this for generating final output table(cholesterol_3) with multiple raw data(which are in same path/directory). I am pretty new to SAS and I would like to hear some general approaches/tips for creating function with this code.
... View more