RLU
Steps to follow:
1. Start RLU
2. Define a record format
3. Define a constant field
4. Center the report title
5. Add database fields to a report
6. Create a field line
7. Create sample data for a report
8. Save the report design and create a printer file
9. Print the report
Starting RLU:
To start an RLU session, do the following:
1. Type STRRLU on the command line on the AS/400 Main Menu.
2. Press F4 (Prompt)(A) to see the parameters for the STRRLU command. The
Start Report Layout Utility (STRRLU) display appears.
3. Type QDDSSRC in the Source file prompt, CHOWDARY1 in the Library prompt, RLU123 in
the Source member prompt,80 in the Page width prompt, and press Enter.
The Load RLU Work Space display indicates that the contents of the source
member are being loaded into the work space. If loading occurs quickly you
may not see the display. The Design Report display appears on which you
define the report design.
Chowdary S Page 1
Defining a Record Format:
To define a record format:
1. Type a report title on the first blank line of the Design Report display, as shown in the following display,
and press Enter. The line containing text shows a sequence number in the sequence number area.
'''''''
2. To define this line as a single-line record format, type DR beside the report title
in the sequence number area of the Design Report display, as shown in the
following display, and press Enter:
The name of the record format appears in the sequence number area of the line. The naming convention
RLU uses for record format names is RCDnnn, where nnn is a 3-digit number beginning with 001 for the
first record format you create in your edit session. The 3-digit number is increased by one for each
subsequent record format created.
Chowdary S Page 2
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.
Centering the Report Title:
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 definition.
Adding Database Fields to a Report:
Now that your report design has a title field, the next step is to add some fields by referencing a database
file. To add the next five fields to your report, use the source physical file CUSDATA in library QPDA. This
file contains fields for a customer report and is shipped with Application Development ToolSet for AS/400.
To add the EMPADD , EMPNAME, EMPNUM and EMPPH to your report:
1. Press F10 (Database fields)(B). The Work with Database Fields display appears.
2. Select option 1 (Add field) in the Option prompt, and type QPDA in the Library prompt, SIMEMPPF in
the File prompt, EMPRCD in the Record prompt, and press Enter. The Select Database Fields display
appears showing the fields available for selection into your report.
3. To select the EMPADD , EMPNAME, EMPNUM and EMPPH for your report, type option 1 (Select) in
the Opt column next to each field, and press Enter. The field NAME is on the next page of the display.
The selected fields are identified by the > symbol to the left of the field name.
4. Press Enter again. The Work with Database Fields display is shown with a list of the selected fields.
5. Press Enter again to return to the Design Report display. The selected database fields appear at the
bottom of the display.
6. 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.
7. To define the second record, type DR in the first position of the second blank line, and press Enter. The
second record is defined.
Creating a Field Line:
To create a field line using the View Field (VF) line command:
1. 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.
Chowdary S Page 3
2. Move the cursor to column 1 on the FLD1 field line of the second record and type 2C, which places the
EMP field on this line starting in column 1. The C adds the defined column heading in the report design.
Move the cursor to column 9 and type 5C, at column 33 type 4C, at column 45 type 3C, at column 57 type
1C, and press Enter. The selected database fields are added to the report design and a new record
format for the column headings is created.
The following figure shows the Design Report display with database references:
The following figure shows the Design Report Display with the database fields added:
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:
Chowdary S Page 4
Saving the Report Design and Creating a Printer File:
For this example, you are finished designing your report and ready to do the
following:
¹ Leave the Design Report display
¹ Save the source member
¹ Print a prototype of the report
¹ Create a printer file
¹ Exit from RLU
To save the simple report and create a printer file:
1. Press F3 (Exit). The Exit RLU display appears.
2. To save and exit from RLU, type 1 in the Option prompt.
3. Type Y (Yes) in the Create printer file prompt.
4. 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.
5. Press Enter. The following messages appear at the bottom of the display:
Chowdary S Page 5
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 RLU123 added to file CHOWDARY1/QDDSSRC created with 80 records.
Note: You can also create a prototype of the report by specifying the value 6 for
the OPTION parameter of the STRRLU command. For more information,
see “Start Report Layout Utility (STRRLU) Command” on page 5.
And now we need to write the RPG PGM as mention below.
Opt Member Type Text
- MYRLUPG123 RPGLE MY RLU RPGLE PGM 123
.: 1 71 Edit CHOWDARY1/QRPGLESRC
MYRLUPG123
*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
********** Beginning of data *************************************
*FILE DECLARATION
**********
*
FSIMEMPPF IF E DISK
* EMPLOYEE DETAILS PF
FRLU123 O E PRINTER OFLIND (*IN99)
* PRINTER FILE FOR EMP DETAILS
***************
*MAIN LOGIC
***************
C MOVE *ON *IN99
C WRITE RCD001
C READ SIMEMPPF 90
C *IN90 DOWEQ *OFF
*
C *IN90 IFEQ *ON
C WRITE RCD003
C ENDIF
*
C *IN99 IFEQ *ON
C WRITE RCD002
C ENDIF
C READ SIMEMPPF 90
C ENDDO
C SETON LR
C RETURN
*******************END THE PROGRAM *********************
************** End of data ****************************************
Complie the above program and call it and goto spool file and see the report with 5 opt.
Chowdary S Page 6
Printing the Report:
To print the report you created, type WRKSPLF on the command line on the AS/400
Main Menu. The Work with All Spooled Files display appears. From this display,
you send your files to the printer.
If you want to make any changes to your report design, do the steps of the example again. When you are
finished, you can print another prototype of the report to make sure it appears as you want it.
Out Put:
Chowdary S Page 7