Running a Program Using the CL CALL Command
*===============================================================*
* PROGRAM NAME: EMPRPT2 *
* RELATED FILES: EMPMST (PHYSICAL FILE) *
* PRINT (PRINTER FILE) *
* DESCRIPTION: This program prints employee information *
* stored in the file EMPMST if the password *
* entered is correct. *
* Run the program by typing "CALL library name/ *
* EMPRPT2 (PSWORD)" on the command line, where *
* PSWORD is the password for this program. *
* The password for this program is 'HELLO'. *
*===============================================================*
FPRINT O F 80 PRINTER
FEMPMST IP E K DISK
IEMPREC 01
Figure 47 (Part 1 of 2). ILE RPG Program that Requires Parameters at Run Time
*-----------------------------------------------------------------*
* The entry parameter list is specified in this program. *
* There is one parameter, called PSWORD, and it is a *
* character field 5 characters long. *
*-----------------------------------------------------------------*
C *ENTRY PLIST
C PARM PSWORD 5
*-----------------------------------------------------------------*
* The password for this program is 'HELLO'. The field PSWORD *
* is checked to see whether or not it contains 'HELLO'. *
* If it does not, the last record indicator (LR) and *IN99 *
* are set on. *IN99 controls the printing of messages. *
*-----------------------------------------------------------------*
C PSWORD IFNE 'HELLO'
C SETON LR99
C ENDIF
OPRINT H 1P 2 6
O 50 'EMPLOYEE INFORMATION'
O H1P
O 12 'NAME'
O 34 'SERIAL #'
O 45 'DEPT'
O 56 'TYPE'
O D 01N99
O ENAME 20
O ENUM 32
O EDEPT 45
O ETYPE 55
O D99
O 16 '***'
O 40 'Invalid Password Entered'
O 43 '***'
Figure 47 (Part 2 of 2). ILE RPG Program that Requires Parameters at Run Time
Figure 48 on page 106 shows the DDS that is referenced by the EMPRPT2
source.
Chapter 9. Running a Program 105