Hi,
If I get your requirement correctly, you can accomplish the desired task using arrays also.
Try with this code. check whether you are getting right output or not?
data dd;
infile datalines;
input Staff_id Product $ Pts_Earned;
datalines;
182715 EPE 150
182825 EASB 22200
182825 EIKPA 1056
182825 EKD 810
182825 EPE 2400
182825 ESM 30
;
data dds(drop=product pts_earned);
length staff_id 8.;
array prd{5} EASB EIKPA EKD EPE ESM;
set dd;
if product='EPE' then EPE=pts_earned;
if product='EASB' then EASB=pts_earned;
if product='EIKPA' then EIKPA=pts_earned;
if product='EKD' then EKD=pts_earned;
if product='ESM' then ESM=pts_earned;
proc print;
run;
Thanks,
Deendayal Cheni
Oracle Corporation (Formerly Sun Microsystems Inc.)
... View more