data sasuser.sales;
input type $1. @;
if type='H' then input @3 address $15.;
if type='P';
input @3 Name $10. @13 Age 3. @16 Gender $1.;
datalines;
P MARY E 21 F
P WILLIAM M 23 M
P SUSAN K 3 F
H 321 S. MAIN ST
;
run;
proc print data=sasuser.sales;
run;
執(zhí)行結(jié)果
ObstypeaddressNameAgeGender
1P MARY E21F
2P WILLIAM M23M
3P SUSAN K3F
為什么 H 321 S. MAIN ST 沒法輸出?