Course Code: Printer Files Version No:1.0 Date of Release: Jul-22-02 Author: Pramod MG & Palaniappan M
Jul-22-02
Printer Files
Page : 1/36
Objectives
To familiarize with the Printer Files and RLU. To code intermediate level - RPG programs.
Jul-22-02
Printer Files
Page : 2/36
Prerequisites
Basic knowledge of RPG programming concepts.
Jul-22-02
Printer Files
Page : 3/36
Course Outline
Program Described Printing Externally Described Printing RLU Printer File DDS
Jul-22-02
Printer Files
Page : 4/36
Jul-22-02
Printer Files
Page : 5/36
Printer Files
Types
Externally-described Program-described.
CL command CRTPRTF (Create Print File) can be used to create a printer file. Valid file operation codes are WRITE, OPEN, CLOSE, and FEOD.
Jul-22-02
Printer Files
Page : 6/36
Jul-22-02
Printer Files
Page : 7/36
Jul-22-02
Printer Files
Page : 8/36
Jul-22-02
Printer Files
Page : 9/36
Jul-22-02
Printer Files
Page : 11/36
Limitations :
Wrapping of fields is not allowed.The entire field is dropped if the field is outside the report width boundaries. Some keywords, such as, the HIGHLIGHT and UNDERLINE, have no effect in Design Report display. More than one record format on the same line is not allowed. Jul-22-02 Printer Files Page : 12/36
Starting RLU
You can start RLU as follows: From the AS/400 Main Menu From the programming development manager (PDM) By typing the Start Report Layout Utility (STRRLU) command with parameters
Jul-22-02
Printer Files
Page : 13/36
Designing a Report
With RLU, you can design the textual image of a report without exiting from the Design Report display. You can then save the report design and print it at the same time. When you are designing a report, you can use sequence line commands, command line commands, and Control Language commands.
Jul-22-02
Printer Files
Page : 14/36
Jul-22-02
Printer Files
Page : 15/36
Jul-22-02
Printer Files
Page : 16/36
Jul-22-02
Printer Files
Page : 17/36
Jul-22-02
Printer Files
Page : 18/36
Jul-22-02
Printer Files
Page : 19/36
Defining a Constant Field To define the report title as a constant field using the Define Constant (DC) command, type DC beside the report title in the sequence number area, and press Enter. A message indicating that an unnamed (constant) field is created in the record format and a field line appears immediately above the field you just created.
Jul-22-02
Printer Files
Page : 20/36
Jul-22-02
Printer Files
Page : 21/36
To center the report title by using the Center Field (CF) line command, type CF beside the report title in the sequence number area on the Design Report display, as shown in the following display, and press Enter. The field is centered relative to the report page width you specified when you started RLU, and this new position appears in the field definition.
Jul-22-02
Printer Files
Page : 22/36
Adding Database Fields to a Report (cont) To show the selected database fields on your report design, create a second record using the Insert (I) line command. Type I2 in the sequence number area beside the report title, and press Enter. Two new blank lines are added. The first blank line remains as a filler line. To define the second record, type DR in the first position of the second blank line, and press Enter. The second record is defined.
Jul-22-02 Printer Files Page : 25/36
Creating a Field Line To create a field line using the View Field (VF) line command: Type VF in the sequence number area of the second record, and press Enter. The FLD1 field line appears, which is used to add the selected database fields to your report design. The fields are placed on the FLD1 field line in the order that you want them to appear on the report.
Jul-22-02 Printer Files Page : 26/36
Jul-22-02
Printer Files
Page : 28/36
Jul-22-02
Printer Files
Page : 29/36
Creating Sample Data for a Report To create 5 lines of sample data for the fields in record format RCD002 using the Sample Data (SD) line command, type SD5 in the sequence number area of the second record, as shown in the following display, and press Enter:
FLD1 00005 + FLD1 SD5 <....> Number <...> XXXXX <..> Name <..................> XXXXXXXXXXXXXXXXXXXX <..> Paid <......> 99/99/99 <..> Paid <......> 99999999 <.....> Balance <.........> 999,999.99-
Jul-22-02
Printer Files
Page : 30/36
Jul-22-02
Printer Files
Page : 31/36
Saving the Report Design & Creating a PRTF To save the simple report and create a printer file: Press F3 (Exit). The Exit RLU display appears. To save and exit from RLU, type 1 in the Option prompt. Type Y (Yes) in the Create printer file prompt. Type Y (Yes) in the Prototype report prompt. The default values for the source member, source file, and the library, are those that you specified on the Start Report Layout Utility (STRRLU) display when you started the example exercise.
Jul-22-02 Printer Files Page : 32/36
(cont)
Press Enter. The following messages appear at the bottom of the display: Member is being saved. Printer file being created. Prototype report printer file being created. Prototype report printing. You exit from RLU and return to the AS/400 Main Menu, where the following message is displayed: Member SREPORT added to file QGPL/QDDSSRC created with 80 records. Jul-22-02 Printer Files Page : 33/36
Jul-22-02
Printer Files
Page : 34/36
Jul-22-02
Printer Files
Page : 35/36
References
IBM Manual
ILE RPG/400 Reference Report Layout Utility
Jul-22-02
Printer Files
Page : 36/36