22
Sun, Dec
3 New Articles

Compiling the Easy Way

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

Imagine that a few weeks ago you developed a series of programs, all called by one CL program. In order to work, the CL program must be compiled with USRPRF(*OWNER) to adopt the authority of the owner. Now a change request causes you to change the CL program. So, it's been a few weeks since you last worked on the program, you forget to specify USRPRF(*OWNER) and, of course, your users can't run your programs because the authorities are not correct.

Or else imagine that you designed an externally-described printer file for your invoices. When you created the file, you specified FORMTYPE('INVOICE'), PAGESIZE(24 80) and SAVE(*YES). Now you ask your junior programmer to make a small cosmetic change in the printer file, and he forgets about the special attributes. Next time invoices are printed, they appear on standard paper, without being saved.

The problem is common. There are many compile options and commands, and OS/400 has no way to remember the previous compile options for each member. You are responsible for recalling the specific options for each member. If you don't remember them, errors can occur.

I have created two commands that will end the reliance on human memory. One command, Update Create Object Entry (UPDCRTOBJE), stores the compile options in a database file. The other command, Create Object from Source (CRTOBJSRC), compiles the source member using the stored options. The commands work for any type of compilable source member and are not release dependent.

Hocus Pocus

To give you a clear idea of what the utility will do for you, let's suppose your RPG program MYLIB/PGM001 uses the LOKUP operation to search an array for an element that is greater than a given value. You know that if you leave the generation severity level parameter to its default value of 9, the program won't compile; you have to change this severity level to at least 11. The utility presented here solves this problem by storing the GENLVL(11) along with the CRTRPGPGM command, so that each and every time PGM001 is compiled, GENLVL(11) will be used automatically.

In this example, the command string to be executed goes as follows:

 CRTRPGPGM PGM(MYLIB/PGM001) + SRCFILE(MYLIB/QRPGSRC) + GENLVL(11) 

That's what CRTOBJSRC will execute automatically, each time you compile program PGM001. You don't have to be bothered with GENLVL(11) anymore. This has several advantages:

* You're guaranteed a successful compile every time.

* You don't have to change the default values of QSYS commands.

* Each source member can have different compile options, tailored specifically to that source member.

* You're freed from the drudgery of selecting the correct compile command (CRTxxxPGM, CRTxxxF, CRTCMD) and prompting for special options.

Technically speaking, the utility uses a database file (COCMD, 1) to store the one or more commands needed to successfully compile a source member. It allows multiple sequential commands per source member, with each command being stored in a separate record (called "entry"). This solves another problem: that of remembering, for each compile, the correct sequence of commands that bring the compile to fruition.

Technically speaking, the utility uses a database file (COCMD, Figure 1) to store the one or more commands needed to successfully compile a source member. It allows multiple sequential commands per source member, with each command being stored in a separate record (called "entry"). This solves another problem: that of remembering, for each compile, the correct sequence of commands that bring the compile to fruition.

File COCMD is updated with the Update Create Object Entry (UPDCRTOBJE) command. With this command you can add, change, or remove entries. To create an object using the stored entries, you run the Create Object from Source (CRTOBJSRC) command. Let's take a closer look at both commands.

Command UPDCRTOBJE

Command UPDCRTOBJE is comprised of a command definition (2a), the command processing program (2b), the prompt override program (2c), and an RPG program (2d).

Command UPDCRTOBJE is comprised of a command definition (Figure 2a), the command processing program (Figure 2b), the prompt override program (Figure 2c), and an RPG program (Figure 2d).

Parameters SRCFILE and MBR of the UPDCRTOBJE command identify the source physical file and the member for which you wish to update an entry. Because multiple entries are valid for each member, you must also indicate the sequence number, which can be any number between .01 and 999.99. Normally, you would only use whole numbers; the fractional parts are provided in case you have to insert an entry between two consecutive entries.

Suppose you want to add two command entries for member MAINCL in source file MYLIB/QCLSRC. The first entry adds MYLIB to the library list, while the second entry actually creates the CL program.

To add MYLIB to the library list:

1. Type UPDCRTOBJE and press F4=Prompt. Type QCLSRC and MYLIB in the SRCFILE parameter. Type MAINCL in the MBR parameter. Type 1 in the SEQNBR parameter. Leave *NO in the RMVE parameter. Press Enter.

2. Type ADDLIBLE and press F4=Prompt. Notice that you're prompting for the ADDLIBLE command from within the prompt for the UPDCRTOBJE command. This prompt-within-prompt is possible because the command is being entered in a parameter defined as TYPE(*CMDSTR). Type MYLIB and press Enter. The prompter returns to the UPDCRTOBJE command, which will have ADDLIBLE LIB(MYLIB) as the command to be executed for this entry. Press Enter again. The message "Entry added successfully" will be displayed.

The entry to create the CL program is added similarly, except "2" is entered for the sequence number and CRTCLPGM is entered for the command.

If you need to change an entry, run UPDCRTOBJE again for the same entry. If you use the command prompter, the prompt override program (POP) will bring up the current value of the entry, making it easy for you to edit it. Since the entry is already on file, it won't be added but changed.

Removing an entry is also simple. Run UPDCRTOBJE for the entry you wish to remove, indicating RMVE(*YES).

Command CRTOBJSRC

The CRTOBJSRC command (Figures 3a and 3b) has four parameters. The first two, SRCFILE and MBR, identify the source member being compiled. Parameter SRCTYPE contains the standard source type identifiers used by the system (such as PF for physical file, RPG for an RPG program, etc.). Parameter MODE defaults to *BATCH, meaning that the compile will be performed in batch mode -- but you can change it to *INTER (interactive) if you wish.

Program OBJ005CL reads file COCMD sequentially by key. Notice the CHGVAR command that builds variable &KEY. Then the OVRDBF file is used with POSITION(*KEYAE 4 CCREC &KEY), indicating what record will be retrieved by the RCVF command. *KEYAE means "process by key, after or equal," and it is an exact equivalent to RPG's SETLL operation. The number 4 indicates the number of key fields, CCREC is the name of the record format, and &KEY is the value of the key being searched.

When CRTOBJSRC is executed, program OBJ005CL attempts to find an entry for the source member being compiled. If none is found and the program is running interactively, command UPDCRTOBJE is prompted to let you add an entry; if the program is running in batch, it branches to STD_CMD, where the standard OS/400 command is executed. If an entry is found, however, QCMDEXC is invoked to carry out the command contained in the entry, then the next entry is retrieved. This process continues until the end of file is reached or the next entry retrieved no longer applies to the member.

Customize PDM

As you probably know, you can customize PDM to run your own commands. At Midrange Computing, we created an Option C to run the CRTOBJSRC command, and it works beautifully. We also created Option UC to update the compile entries.

Option C can be entered as follows:

 ?CRTOBJSRC ?*SRCFILE(&L/&F) + ?*MBR(&N) + ?*SRCTYPE(&T) 

Option UC can be created as follows:

 ?UPDCRTOBJE ?*SRCFILE(&L/&F) + ?*MBR(&N) + ??SEQNBR(1) 

A Far-Fetched Example

Nothing drives the point home better than an exaggerated example. Imagine having designed a display file that must be compiled using DFRWRT(*NO), WAITRCD(30), and AUT(*EXCLUDE). The file DDS references your physical file MASTER, which is in another library not usually part of your library list. Further, you must grant *CHANGE authority to three group profiles. Complicated enough? Turn to 4 to see how our utility handles that.

Nothing drives the point home better than an exaggerated example. Imagine having designed a display file that must be compiled using DFRWRT(*NO), WAITRCD(30), and AUT(*EXCLUDE). The file DDS references your physical file MASTER, which is in another library not usually part of your library list. Further, you must grant *CHANGE authority to three group profiles. Complicated enough? Turn to Figure 4 to see how our utility handles that.

From now on, you can rest assured that your display file DSPFILE will be compiled correctly each time...until someone insists on taking PDM's Option 14, that is!


Compiling the Easy Way

Figure 1 Physical file COCMD

 A UNIQUE A R CCREC A CCLIB 10 COLHDG('SOURCE' 'LIBRARY') A ALIAS(SOURCE_LIBRARY) A CCFILE 10 COLHDG('SOURCE' 'FILE') A ALIAS(SOURCE_FILE) A CCMBR 10 COLHDG('SOURCE' 'MEMBER') A ALIAS(SOURCE_MEMBER) A CCSEQ 5S 2 COLHDG('SEQUENCE' 'NUMBER') A ALIAS(SEQUENCE_NUMBER) A CCCMD 512 COLHDG('COMMAND STRING') A ALIAS(COMMAND_STRING) * A K CCLIB A K CCFILE A K CCMBR A K CCSEQ 
Compiling the Easy Way

Figure 2A Command UPDCRTOBJE

 UPDCRTOBJE: CMD PROMPT('Update Create Object Entries') PARM KWD(SRCFILE) TYPE(Q1) MIN(1) KEYPARM(*YES) + PROMPT('Source file') PARM KWD(MBR) TYPE(*SNAME) LEN(10) MIN(1) + KEYPARM(*YES) PROMPT('Member') PARM KWD(SEQNBR) TYPE(*DEC) LEN(5 2) MIN(1) + KEYPARM(*YES) PROMPT('Sequence number') PARM KWD(RMVE) TYPE(*CHAR) LEN(4) RSTD(*YES) + DFT(*NO) VALUES(*YES *NO) PROMPT('Remove + entry') PARM KWD(CMDSTR) TYPE(*CMDSTR) LEN(512) + PMTCTL(PC1) PROMPT('Command string') Q1: QUAL TYPE(*SNAME) LEN(10) MIN(1) QUAL TYPE(*SNAME) LEN(10) DFT(*CURLIB) + SPCVAL((*CURLIB)) PROMPT('Library') PC1: PMTCTL CTL(RMVE) COND((*EQ *NO)) 
Compiling the Easy Way

Figure 2B CL program CRT001CL

 CRT001CL: + PGM PARM(&QSF &MBR &SEQNBR &RMVE &CMDSTR) DCL VAR(&CMDSTR) TYPE(*CHAR) LEN(512) DCL VAR(&MBR) TYPE(*CHAR) LEN(10) DCL VAR(&MSG) TYPE(*CHAR) LEN(80) DCL VAR(&QSF) TYPE(*CHAR) LEN(20) DCL VAR(&RMVE) TYPE(*CHAR) LEN(4) DCL VAR(&SEQNBR) TYPE(*DEC) LEN(5 2) DCL VAR(&SRCF) TYPE(*CHAR) LEN(10) DCL VAR(&SRCFLIB) TYPE(*CHAR) LEN(10) /* Break qualified name */ CHGVAR VAR(&SRCF) VALUE(%SST(&QSF 1 10)) CHGVAR VAR(&SRCFLIB) VALUE(%SST(&QSF 11 10)) /* Validate source library/file/member */ CHKOBJ OBJ(&SRCFLIB/&SRCF) OBJTYPE(*FILE) MBR(&MBR) MONMSG MSGID(CPF9801) EXEC(DO) CHGVAR VAR(&MSG) VALUE('Source file' *BCAT &SRCFLIB *TCAT '/' + *CAT &SRCF *BCAT 'not found.') GOTO CMDLBL(SNDERRMSG) ENDDO MONMSG MSGID(CPF9810) EXEC(DO) CHGVAR VAR(&MSG) VALUE('Source file library' *BCAT &SRCFLIB + *BCAT 'not found.') GOTO CMDLBL(SNDERRMSG) ENDDO MONMSG MSGID(CPF9815) EXEC(DO) CHGVAR VAR(&MSG) VALUE('Member' *BCAT &MBR *BCAT 'not found.') GOTO CMDLBL(SNDERRMSG) ENDDO /* Update entry */ CALL PGM(CRT001RG) PARM(&SRCFLIB &SRCF &MBR &SEQNBR &RMVE + &CMDSTR &MSG) SNDPGMMSG MSG(&MSG) MSGTYPE(*INFO) GOTO CMDLBL(ENDPGM) /* Send error message */ SNDERRMSG: + SNDPGMMSG MSG(&MSG) MSGTYPE(*DIAG) SNDPGMMSG MSGID(CPF0002) MSGF(QCPFMSG) MSGTYPE(*ESCAPE) /* End program */ ENDPGM: + ENDPGM 
Compiling the Easy Way

Figure 2C CL program CRT001CLA

 CRT001CLA: + PGM PARM(&QCMD &QSF &MBR &SEQNBR &RTNSTRING) DCL VAR(&COUNTER) TYPE(*DEC) LEN(5 0) DCL VAR(&KEY) TYPE(*CHAR) LEN(35) DCL VAR(&MBR) TYPE(*CHAR) LEN(10) DCL VAR(&QCMD) TYPE(*CHAR) LEN(20) DCL VAR(&QSF) TYPE(*CHAR) LEN(20) DCL VAR(&RTNSTRING) TYPE(*CHAR) LEN(5700) DCL VAR(&SEQNBR) TYPE(*DEC) LEN(5 2) DCL VAR(&SEQNBRCHAR) TYPE(*CHAR) LEN(5) DCL VAR(&SEQNBRINT) TYPE(*DEC) LEN(5 0) DCL VAR(&SRCF) TYPE(*CHAR) LEN(10) DCL VAR(&SRCFLIB) TYPE(*CHAR) LEN(10) DCL VAR(&TWO_BYTES) TYPE(*CHAR) LEN(2) DCLF FILE(COCMD) /* Break qualified name */ CHGVAR VAR(&SRCF) VALUE(%SST(&QSF 1 10)) CHGVAR VAR(&SRCFLIB) VALUE(%SST(&QSF 11 10)) /* Read COCMD record by key */ CHGVAR VAR(&SEQNBRINT) VALUE(&SEQNBR * 100) CHGVAR VAR(&SEQNBRCHAR) VALUE(&SEQNBRINT) CHGVAR VAR(&KEY) VALUE(&SRCFLIB *CAT &SRCF *CAT &MBR *CAT + &SEQNBRCHAR) OVRDBF FILE(COCMD) POSITION(*KEY 4 CCREC &KEY) RCVF MONMSG MSGID(CPF0000) EXEC(DO) CHGVAR VAR(&COUNTER) VALUE(0) CVTDECBIN FROMDEC(&COUNTER) TOBIN(&TWO_BYTES) CHGVAR VAR(&RTNSTRING) VALUE(&TWO_BYTES) GOTO CMDLBL(ENDPGM) ENDDO /* Compose return string */ CHGVAR VAR(&COUNTER) VALUE(512) CVTDECBIN FROMDEC(&COUNTER) TOBIN(&TWO_BYTES) CHGVAR VAR(&RTNSTRING) VALUE(&TWO_BYTES *CAT '??CMDSTR(' *CAT + &CCCMD *TCAT ')') ENDPGM: + ENDPGM 
Compiling the Easy Way

Figure 2D RPG program CRT001RG

 FCOCMD UF E K DISK A * E MSG 1 4 80 MESSAGES * ICMDSTR DS I 1 256 CMDST1 I 257 512 CMDST2 ICCCMD DS I 1 256 CCCMD1 I 257 512 CCCMD2 * C *ENTRY PLIST C PARM SRCLIB 10 C PARM SRCF 10 C PARM SRCMBR 10 C PARM SEQNBR 52 C PARM RMVE 4 C PARM CMDSTR C PARM RTNMSG 80 * C KOPT KLIST C KFLD SRCLIB C KFLD SRCF C KFLD SRCMBR C KFLD SEQNBR * C KOPT CHAINCOCMD 01 C *IN01 IFEQ '0' C RMVE IFEQ '*YES' C DELETCCREC C MOVE MSG,1 RTNMSG C ELSE C MOVE CMDST1 CCCMD1 C MOVE CMDST2 CCCMD2 C UPDATCCREC C MOVE MSG,2 RTNMSG C END C ELSE C RMVE IFEQ '*YES' C MOVE MSG,3 RTNMSG C ELSE C MOVE SRCLIB CCLIB C MOVE SRCF CCFILE C MOVE SRCMBR CCMBR C Z-ADDSEQNBR CCSEQ C MOVE CMDST1 CCCMD1 C MOVE CMDST2 CCCMD2 C WRITECCREC C MOVE MSG,4 RTNMSG C END C END * C MOVE '1' *INLR ** Entry removed successfully. Entry changed successfully. Entry not found. RMVE(*YES) ignored. Entry added successfully. 
Compiling the Easy Way

Figure 3A Command CRTOBJSRC

 CRTOBJSRC: CMD PROMPT('Create Object from Source') PARM KWD(SRCFILE) TYPE(Q1) MIN(1) PROMPT('Source + file') PARM KWD(MBR) TYPE(*SNAME) LEN(10) MIN(1) + PROMPT('Member') PARM KWD(SRCTYPE) TYPE(*CHAR) LEN(10) RSTD(*YES) + VALUES(CMD PF LF DSPF PRTF CLP RPG PLI C) + MIN(1) PROMPT('Source type') PARM KWD(MODE) TYPE(*CHAR) LEN(6) RSTD(*YES) + DFT(*BATCH) VALUES(*BATCH *INTER) + PROMPT('Mode of processing') Q1: QUAL TYPE(*SNAME) LEN(10) MIN(1) QUAL TYPE(*SNAME) LEN(10) DFT(*CURLIB) + SPCVAL((*CURLIB)) PROMPT('Library') 
Compiling the Easy Way

Figure 3B CL program OBJ005CL

 OBJ005CL: + PGM PARM(&QSF &MBR &SRCTYPE &MODE) DCL VAR(&CMDSTR) TYPE(*CHAR) LEN(512) DCL VAR(&JOBTYPE) TYPE(*CHAR) LEN(1) DCL VAR(&KEY) TYPE(*CHAR) LEN(35) DCL VAR(&MBR) TYPE(*CHAR) LEN(10) DCL VAR(&MODE) TYPE(*CHAR) LEN(6) DCL VAR(&MSG) TYPE(*CHAR) LEN(80) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(80) DCL VAR(&MSGF) TYPE(*CHAR) LEN(10) DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&QSF) TYPE(*CHAR) LEN(20) DCL VAR(&SRCF) TYPE(*CHAR) LEN(10) DCL VAR(&SRCFLIB) TYPE(*CHAR) LEN(10) DCL VAR(&SRCTYPE) TYPE(*CHAR) LEN(10) DCLF FILE(COCMD) MONMSG MSGID(CPF0000) /* Break qualified name */ CHGVAR VAR(&SRCF) VALUE(%SST(&QSF 1 10)) CHGVAR VAR(&SRCFLIB) VALUE(%SST(&QSF 11 10)) /* Validate source library/file/member */ CHKOBJ OBJ(&SRCFLIB/&SRCF) OBJTYPE(*FILE) MBR(&MBR) MONMSG MSGID(CPF9801) EXEC(DO) CHGVAR VAR(&MSG) VALUE('Source file' *BCAT &SRCFLIB *TCAT '/' + *CAT &SRCF *BCAT 'not found.') GOTO CMDLBL(SNDERRMSG) ENDDO MONMSG MSGID(CPF9810) EXEC(DO) CHGVAR VAR(&MSG) VALUE('Source file library' *BCAT &SRCFLIB + *BCAT 'not found.') GOTO CMDLBL(SNDERRMSG) ENDDO MONMSG MSGID(CPF9815) EXEC(DO) CHGVAR VAR(&MSG) VALUE('Member' *BCAT &MBR *BCAT 'not found.') GOTO CMDLBL(SNDERRMSG) ENDDO /* If job runs interactively, check if compile entry exists */ RTVJOBA TYPE(&JOBTYPE) IF COND(&JOBTYPE *EQ '1' *OR &MODE *EQ '*INTER') THEN(DO) CHGVAR VAR(&KEY) VALUE(&SRCFLIB *CAT &SRCF *CAT &MBR *CAT + '00000') OVRDBF FILE(COCMD) POSITION(*KEYAE 4 CCREC &KEY) RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(NO_ENTRY)) IF COND(&CCLIB *NE &SRCFLIB *OR &CCFILE *NE &SRCF *OR &CCMBR + *NE &MBR) THEN(GOTO CMDLBL(NO_ENTRY)) GOTO CMDLBL(ENTRY_OK) /* If no entry found, prompt for creation */ NO_ENTRY: + CHGVAR VAR(&CMDSTR) VALUE('? UPDCRTOBJE ?*SRCFILE(' *CAT + &SRCFLIB *TCAT '/' *CAT &SRCF *TCAT ') ?*MBR(' *CAT &MBR + *TCAT ') ?*SEQNBR(10.00) ?*RMVE(*NO) ??CMDSTR()') DLTOVR FILE(COCMD) CALL PGM(QCMDEXC) PARM(&CMDSTR 512) ENDDO /* If run in batch or *INTER requested, execute compile. + Otherwise, submit job to batch for further processing. */ ENTRY_OK: + IF COND(&JOBTYPE *EQ '0' *OR &MODE *EQ '*INTER') THEN(GOTO + CMDLBL(EXEC)) DLTOVR FILE(COCMD) SBMJOB CMD(CALL PGM(OBJ005CL) PARM(&QSF &MBR &SRCTYPE &MODE)) + JOB(&MBR) SNDPGMMSG MSG('Compile submitted to batch.') MSGTYPE(*INFO) GOTO CMDLBL(ENDPGM) /* If no entry exists, run standard command */ EXEC: + CHGVAR VAR(&KEY) VALUE(&SRCFLIB *CAT &SRCF *CAT &MBR *CAT '00000') DLTOVR FILE(COCMD) OVRDBF FILE(COCMD) POSITION(*KEYAE 4 CCREC &KEY) RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(STD_CMD)) IF COND(&CCLIB *NE &SRCFLIB *OR &CCFILE *NE &SRCF *OR &CCMBR *NE + &MBR) THEN(GOTO CMDLBL(STD_CMD)) /* Process an entry */ LOOP: + CALL PGM(QCMDEXC) PARM(&CCCMD 512) MONMSG MSGID(CPF0000) EXEC(DO) CHGVAR VAR(&MSGID) VALUE(' ') RCVMSG MSGTYPE(*EXCP) RMV(*NO) MSGDTA(&MSGDTA) MSGID(&MSGID) + MSGF(&MSGF) MSGFLIB(&MSGFLIB) IF COND(&MSGID *NE ' ') THEN(DO) SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) + MSGDTA(&MSGDTA) MSGTYPE(*DIAG) SNDPGMMSG MSGID(CPF0002) MSGF(QCPFMSG) MSGTYPE(*ESCAPE) GOTO CMDLBL(ENDPGM) ENDDO ENDDO RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDPGM)) IF COND(&CCLIB *NE &SRCFLIB *OR &CCFILE *NE &SRCF *OR &CCMBR *NE + &MBR) THEN(GOTO CMDLBL(ENDPGM)) GOTO CMDLBL(LOOP) /* Execute standard CRTxxx commands */ STD_CMD: + IF COND(&SRCTYPE *EQ 'CMD') THEN(CRTCMD CMD(&SRCFLIB/&MBR) + PGM(&MBR) SRCFILE(&SRCFLIB/&SRCF)) IF COND(&SRCTYPE *EQ 'PF') THEN(CRTPF FILE(&SRCFLIB/&MBR) + SRCFILE(&SRCFLIB/&SRCF)) IF COND(&SRCTYPE *EQ 'LF') THEN(CRTLF FILE(&SRCFLIB/&MBR) + SRCFILE(&SRCFLIB/&SRCF)) IF COND(&SRCTYPE *EQ 'DSPF') THEN(CRTDSPF FILE(&SRCFLIB/&MBR) + SRCFILE(&SRCFLIB/&SRCF)) IF COND(&SRCTYPE *EQ 'PRTF') THEN(CRTPRTF FILE(&SRCFLIB/&MBR) + SRCFILE(&SRCFLIB/&SRCF)) IF COND(&SRCTYPE *EQ 'CLP') THEN(CRTCLPGM PGM(&SRCFLIB/&MBR) + SRCFILE(&SRCFLIB/&SRCF)) IF COND(&SRCTYPE *EQ 'RPG') THEN(CRTRPGPGM PGM(&SRCFLIB/&MBR) + SRCFILE(&SRCFLIB/&SRCF)) IF COND(&SRCTYPE *EQ 'PLI') THEN(CRTPLIPGM PGM(&SRCFLIB/&MBR) + SRCFILE(&SRCFLIB/&SRCF)) IF COND(&SRCTYPE *EQ 'C') THEN(CRTCPGM PGM(&SRCFLIB/&MBR) + SRCFILE(&SRCFLIB/&SRCF)) GOTO CMDLBL(ENDPGM) SNDERRMSG: + SNDPGMMSG MSG(&MSG) MSGTYPE(*DIAG) SNDPGMMSG MSGID(CPF0002) MSGF(QCPFMSG) MSGTYPE(*ESCAPE) ENDPGM: + DLTOVR FILE(COCMD) ENDPGM 
Compiling the Easy Way

Figure 4 Solution to the last example

 Figure 4: Solution to the Last Example 1. Add an entry to add to your library list the name of the library where physical file MASTER resides: UPDCRTOBJE SRCFILE(xxx/QDDSSRC) + MBR(DSPFILE) + SEQNBR(1) CMDSTR(ADDLIBLE LIB(yyy)) 2. Add an entry to create the display file: UPDCRTOBJE SRCFILE(xxx/QDDSSRC) + MBR(DSPFILE) + SEQNBR(2) + CMDSTR(CRTDSPF FILE(xxx/DSPFILE) + SRCFILE(xxx/QDDSSRC) + DFRWRT(*NO) + WAITRCD(30) + AUT(*EXCLUDE)) 3. Add an entry to grant authority to the group profiles: UPDCRTOBJE SRCFILE(xxx/QDDSSRC) + MBR(DSPFILE) + SEQNBR(3) + CMDSTR(GRTOBJAUT OBJ(xxx/DSPFILE) + OBJTYPE(*FILE) + AUT(*CHANGE) + USER(GRP1 GRP2 GRP3) 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: