Professional Documents
Culture Documents
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:
Chowdary S Page 1
Defining a Record Format:
'''''''
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.
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.
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 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:
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.
.: 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