The SELECT clause lists the columns to select. COALESCE overlays the like-named columns. For each row, COALESCE returns the first nonmissing value of either P2.JOBCODE or P.JOBCODE. Because P2.JOBCODE is the first argument, if there is a nonmissing value for P2.JOBCODE, COALESCE returns that value. Thus, the output contains the most recent jobcode information for every employee. LABEL= assigns a column label.
   title 'Most Current Jobcode and Salary Information';
   select p.idnumber, coalesce(p2.jobcode,p.jobcode) 
        label='Current Jobcode',