Here a comprehensive example with data taken from your other thread:
data us australia;
input
@1 id $6.
@21 lname $18.
@43 title $20.
@64 salary dollar8.
@73 country $2.
@76 bdate mmddyy10.
@87 hdate mmddyy10.
;
format
salary dollar8.
bdate hdate mmddyy10.
;
select (country);
when ('AU') output australia;
when ('US') output us;
otherwise;
end;
cards;
120102 Tom Zhou M Sales Manager $108,255 AU 08/11/1969 06/01/1989
120103 Wilson Dawes M Sales Manager $87,975 AU 01/22/1949 01/01/1974
120121 Irenie Elvish F Sales Rep. II $26,600 AU 08/02/1944 01/01/1974
120261 Harry Highpoint M Chief Sales Officer $243,190 US 02/21/1969 08/01/1987
121018 Julienne Magolan F Sales Rep. II $27,560 US 01/03/1944 01/01/1974
121019 Scott Desanctis M Sales Rep. IV $31,320 US 06/25/1986 06/01/2004
;
run;
... View more