The Department Table (TBLDEPT) contains only two fields: Department Code (DEPT) which is the key field, and Department Name (DEPTNAME) which is the translation as defined in the PIMS manual. This table is allocated whenever any other file is selected for ad hoc reporting.
In FOCUS databases (e.g., AC) the Department Table is automatically joined to the host file via the key field. However, in external files such as EH, a match is required to merge the data in the files. The sample program below illustrates a match between the Employment History Extract (EH) file and the Department Table (TBLDEPT).
MATCH FILE EH
BY DEPT AS EH:DEPT
AFTER MATCH HOLD AS PERMSML OLD
The resulting hold file, PERMSML, requires a define to fill-in blank values for department name:
DEFINE FILE PERMSML ADD
IF (EH:DEPT EQ LAST EH:DEPT ) AND (DEPTNAME EQ ' ') AND
(LAST DEPTNAME NE ' ') THEN LAST DEPTNAME
(LAST DEPTNAME EQ ' ') THEN LAST DPTNAME
The final report is generated per the commands below:
TABLE FILE PERMSML
PRINT eh:wname dptNAME
Last Updated: June 2, 2001