![]() Chapter Contents |
![]() Previous |
![]() Next |
| The SQL Procedure |
| Procedure features: |
| ||||||||
| Tables: | PROCLIB.PAYROLL, PROCLIB.PAYROLL2 |
| Input Tables |
| PROCLIB.PAYROLL (Partial Listing) |
|
|
|
| PROCLIB.PAYROLL2 |
|
|
|
| Program |
libname proclib 'SAS-data-library';
options nodate pageno=1 linesize=80 pagesize=60;
| | proc sql outobs=10;
title 'Most Current Jobcode and Salary Information';
select p.IdNumber, p.Jobcode, p.Salary,
p2.jobcode label='New Jobcode',
p2.salary label='New Salary' format=dollar8. |
| | from proclib.payroll as p left join proclib.payroll2 as p2 |
| | on p.IdNumber=p2.idnum; |
| Output |
| | title 'Most Current Jobcode and Salary Information';
select p.idnumber, coalesce(p2.jobcode,p.jobcode)
label='Current Jobcode', |
| | coalesce(p2.salary,p.salary) label='Current Salary'
format=dollar8. |
| | from proclib.payroll p left join proclib.payroll2 p2
on p.IdNumber=p2.idnum; |
| Output |
| Output |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.