/*View Raw Data File Before Writing Code*/ proc fslist fileref='salaries.dat'; run; data current(drop=SalYear Type); retain ID LName FName HireDate Salary; /*Must RETAIN all variables in new data set*/ length ID $ 6; infile 'salaries.dat'; input Type $ @; if Type='E' then do; if _n_ ne 1 then output; /*Ouput when next employee is read*/ input ID $ FName $ LName $ HireDate : date9.; end; else if Type='S' then do; input SalYear Salary:comma8.; end; run; proc print data=current; format HireDate date9.; title 'Salaries as of 2001'; run;