TechTalk: A New Compile Command

CL
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

One of the shortcomings of PDM is the inability to easily access members from different source files on one screen.

In order for these changes to a display file to take effect, you must compile the display file, and then the program. Since this is a two-step process, you can't just leave the computer to itself to run these two compiles.

CRTDSPFRPG (1a and 1b) will execute these two steps for you, and if you create a User-Defined Option code, it can be executed with only a two- letter code.

CRTDSPFRPG (Figure 1a and 1b) will execute these two steps for you, and if you create a User-Defined Option code, it can be executed with only a two- letter code.

First, key and compile the command, CRTDSPFRPG (Create Display File and RPG Program), by making it a source type of CMD and using option 14 to compile it. Next, key and compile the CL program, also named CRTDSPFRPG, source type CLP. See Figures 1a and 1b.

Now, press F16 from the Work With Members screen and create the User- Defined Option code (using F6). See 1c. Notice the question mark before CRTDSPFRPG. This forces PDM to prompt the command and allows the user to change any names or source files.

Now, press F16 from the Work With Members screen and create the User- Defined Option code (using F6). See Figure 1c. Notice the question mark before CRTDSPFRPG. This forces PDM to prompt the command and allows the user to change any names or source files.

To use the command, place a DR (for Display and RPG Compile) next to the desired member (either the Display file or RPG member), and press enter. The next screen will show the command and allow you to change the two member names if they need to be changed. The two compiles will execute when you press enter.

A completion message will automatically be sent to the user's message queue. If you do not hear a beep when the message is received, change your user profile (CHGUSRPRF) to set the parameter DLVRY(*NOTIFY).

Art Tostaine, Jr. Spotswood, New Jersey


TechTalk: A New Compile Command

Figure 1A The CRTDSPFRPG command

 CMD PROMPT('Create DSPF & RPG Program') PARM KWD(DSPFMBR) TYPE(*CHAR) LEN(10) RSTD(*NO) + MIN(1) PROMPT('Display File Member') PARM KWD(DSPFLIB) TYPE(*CHAR) LEN(10) RSTD(*NO) + MIN(1) PROMPT('Display File Library') PARM KWD(RPGMBR) TYPE(*CHAR) LEN(10) RSTD(*NO) + MIN(1) PROMPT('RPG Program Member') PARM KWD(RPGLIB) TYPE(*CHAR) LEN(10) RSTD(*NO) + MIN(1) PROMPT('RPG Program Library') PARM KWD(DSPFSRCF) TYPE(*CHAR) LEN(10) RSTD(*NO) + DFT(QDDSSRC) MIN(0) PROMPT('Display File + Source File') PARM KWD(DSPFSRCL) TYPE(*CHAR) LEN(10) RSTD(*NO) + DFT(*CURLIB) MIN(0) PROMPT('Display File + Source Library') PARM KWD(RPGSRCF) TYPE(*CHAR) LEN(10) RSTD(*NO) + DFT(QRPGSRC) MIN(0) PROMPT('RPG Program + Source File') PARM KWD(RPGSRCL) TYPE(*CHAR) LEN(10) RSTD(*NO) + DFT(*CURLIB) MIN(0) PROMPT('RPG Program + Source Library') 
TechTalk: A New Compile Command

Figure 1B The CRTDSPFRPG CL program

 CRTDSPFRPG: + PGM PARM(&DSPFMBR &DSPFLIB &RPGMBR &RPGLIB &DSPFSRCF &DSPFSRCL + &RPGSRCF &RPGSRCL) DCL VAR(&DSPFMBR) TYPE(*CHAR) LEN(10) DCL VAR(&DSPFLIB) TYPE(*CHAR) LEN(10) DCL VAR(&RPGMBR) TYPE(*CHAR) LEN(10) DCL VAR(&RPGLIB) TYPE(*CHAR) LEN(10) DCL VAR(&DSPFSRCF) TYPE(*CHAR) LEN(10) DCL VAR(&DSPFSRCL) TYPE(*CHAR) LEN(10) DCL VAR(&RPGSRCF) TYPE(*CHAR) LEN(10) DCL VAR(&RPGSRCL) TYPE(*CHAR) LEN(10) DLTF FILE(&DSPFMBR) MONMSG MSGID(CPF2105) /* OBJECT NOT FOUND */ CRTDSPF FILE(&DSPFLIB/&DSPFMBR) SRCFILE(&DSPFSRCL/&DSPFSRCF) + SRCMBR(&DSPFMBR) MONMSG MSGID(CPF7302) EXEC(GOTO CMDLBL(ENDPGM)) /* OBJECT NOT + CREATED */ CRTRPGPGM PGM(&RPGLIB/*CTLSPEC) SRCFILE(&RPGSRCL/&RPGSRCF) + SRCMBR(&RPGMBR) ENDPGM: + ENDPGM 
TechTalk: A New Compile Command

Figure 1C Creating a user-defined option

 Figure 1c: Creating a User-Defined Option Type changes, press Enter. Option . . . . . . . . . DR Value to change to Command . . . . . . . . . ?crtdspfrpg dspfmbr(&n) dspflib(&l) rpgmbr(&n) rpglib(&l) dspfsrcl(&l) rpgsrcl(&l) F3=Exit F4=Prompt F12=Cancel 
BLOG COMMENTS POWERED BY DISQUS