Using the Source Entry Utility (SEU)
You can use the Source Entry Utility (SEU) to enter your source statements. SEU also provides prompting for the different specification templates as well as syntax checking. To start SEU, use the STRSEU (Start Source Entry Utility) command. For other ways to start and use SEU, refer to the ADTS for AS/400: Source Entry Utility manual.
If you name your source file QRPGLESRC, SEU automatically sets the source type to RPGLE when it starts the editing session for a new member. Otherwise, you have to specify RPGLE when you create the member.
If you need prompting after you type STRSEU, press F4. The STRSEU display appears, lists the parameters, and supplies the default values. If you supply parameter values before you request prompting, the display appears with those values filled in.
In the following example you enter source statements for a program which will print employee information from a master file. This example shows you how to:
- Create a library
- Create a source physical file
- Start an SEU editing session
- Enter source statements.
- To create a library called MYLIB, type:
The CRTLIB command creates a library called MYLIB.
- To create a source physical file called QRPGLESRC type:
CRTSRCPF FILE(MYLIB⁄QRPGLESRC) RCDLEN(112) TEXT('Source physical file for ILE RPG programs')
The CRTSRCPF command creates a source physical file QRPGLESRC in library MYLIB.
- To start an editing session and create source member EMPRPT type:
STRSEU SRCFILE(MYLIB⁄QRPGLESRC) SRCMBR(EMPRPT) TYPE(RPGLE) OPTION(2)
Entering OPTION(2) indicates that you want to start a session for a new member. The STRSEU command creates a new member EMPRPT in file QRPGLESRC in library MYLIB and starts an edit session.
The SEU Edit display appears as shown in Figure 1. Note that the screen is automatically shifted so that position 6 is (for specification type) at the left edge.
- Type the following source in your SEU Edit display, using the
following SEU prefix commands to provide prompting:
- IPF — for file description specifications
- IPD — for definition specifications
- IPI — for input specifications
- IPC — for calculation specifications
- IPCX — for calculation specifications with extended Factor 2
- IPO — for output specifications
- IPP — for output specifications continuation
- IPPR — for procedure specifications
- Press F3 (Exit) to go to the Exit display. Type Y (Yes) to save
The member EMPRPT is saved.
Figure 3 shows the DDS which is referenced by the EMPRPT source.
To create a program from this source use the CRTBNDRPG command, specifying DFTACTGRP(*NO).