You can create a free-form report from a TABLE request that omits the display commands that control columnar and matrix formatting (PRINT, LIST, SUM, and COUNT). Instead, the request includes the following report features:
Heading |
Contains the body of the report. It displays the text characters, graphic characters, and data fields that make up the report. |
Footing |
Contains the footing of the report. This is the text that appears at the bottom of each page of the report. The footing may display the same characters and data fields as the heading. |
Prefix operators |
Indicates field calculations and manipulation. |
Temporary fields |
Derives new values from existing fields in a data source. |
BY phrases |
Specifies the report sort order, and determines how many records are included on each page. |
WHERE criteria |
Selects records for the report. |
When creating a free-form report, you can:
Suppose that you are a Personnel Manager and it is your responsibility to administer your company education policies. This education policy states that the number of hours of outside education that an employee may take at the company expense is determined by the number of hours of in-house education completed by the employee.
To do your job efficiently, you want a report that shows the in-house education history of each employee. Each employee information should display on a separate page so that it can be placed in the employee personnel file and referenced when an employee requests approval to take outside courses.
To meet this requirement, you create the EMPLOYEE EDUCATION HOURS REPORT, which displays a separate page for each employee. Notice that pages 1 and 2 of the report provide information about employees in the MIS department, while page 6 provides information for an employee in the Production department.
The following diagram simulates the output you would see if you ran the procedure in the example named Request for EMPLOYEE EDUCATION HOURS REPORT.
The following request produces the EMPLOYEE EDUCATION HOURS REPORT. Numbers to the left of the request correspond to numbers in the following annotations:
1. SET STYLE = OFF SET STYLEMODE=FIXED SET ONLINE-FMT = PDF 2. DEFINE FILE EMPLOYEE CR_EARNED/I2 = IF ED_HRS GE 50 THEN 9 ELSE IF ED_HRS GE 30 THEN 6 ELSE 3; END 3. TABLE FILE EMPLOYEE BY DEPARTMENT 4. HEADING " " "<13>EMPLOYEE EDUCATION HOURS REPORT" 5. "<14>FOR THE <DEPARTMENT DEPARTMENT" 6. "</2" "EMPLOYEE NAME: <23><FIRST_NAME <LAST_NAME>" "EMPLOYEE ADDRESS: <23><ADDRESS_LN1>" "<23><ADDRESS_LN2>" "<23><ADDRESS_LN3>" "</1" "JOB CODE: <JOBCODE>" "JOB DESCRIPTION: <JOB_DESC>" "</1" 7. "MOST RECENT COURSE TAKEN ON: <MAX.DATE_ATTEND>" "TOTAL NUMBER OF EDUCATION HOURS: <ED_HRS>" "</1" 8. "<10>|-------------------------------------|" 9. "<10>| EDUCATION CREDITS EARNED <CR_EARNED>|" "<10>|-------------------------------------|" 10.BY EMP_ID NOPRINT PAGE-BREAK 11.WHERE ED_HRS GT 0 12.FOOTING "<15>PRIVATE AND CONFIDENTIAL" END
The following explains the role of each line of the request in producing the sample report: