INDEX
??N??, indirect referencing using, 468–469, 468469
Aactivation groups, 284–286Add Breakpoint (ADDBKP) command,
419–420, 421Add Library List Entry (ADDLIBLE), 157, 158Add Logical File Member (ADDLFM), 176Add Message Description (ADDMSGD), 88, 89Add Physical File Member (ADDPFM)
command, 176, 177, 177Add Program (ADDPGM) command, 257Add Reply List Entry (ADDRPYLE), 124Add Trace (ADDTRC) command, 422–423ADDBKP. See Add Breakpoint (ADDBKP)ADDLFM. See Add Logical File Member
(ADDLFM) commandADDLIBLE. See Add Library List Entry
(ADDLIBLE)ADDMSGD. See Add Message Description
(ADDMSGD) commandADDPFM. See Add Physical File Member
(ADDPFM) commandADDPGM. See Add Program (ADDPGM)
ADDRPYLE. See Add Reply List Entry(ADDRPYLE) command
ADDTRC. See Add Trace (ADDTRC)ALCOBJ. See Allocate Object (ALCOBJ)alignment of similar lines of code, 408, 408–410Allocate Object (ALCOBJ) command, 204–207,
205t, 206allocation
Allocate Object (ALCOBJ) command in,204–207, 205t, 206
Deallocate Object (DLCOBJ) command in,204, 206–207
AND, 53–54, 54, 62tapostrophe, 189arithmetic operators, 46–47, 46t, 46, 47arrays, simulating, 51AS/400, 1
S/38 coding vs., 427–438. See alsoprogramming aids/shortcuts; S/38 code
asterisk (*) as comment delimiter, 21–23, 21, 22, 23attributes, job, 163–164authority
adopted, from other programs in call stack, 243adopted, risks of, 244adopting, 241–244
NOTE: Boldface indicates illustrations and code; t indicates a table. 471
authority, continuedChange Object owner (CHGOBJOWN)
command in, 241Edit Object Authority (EDTOBJAUT)
command in, 240, 241Grant Object Authority (GRTOBJAUT)
command in, 240granting to users, example of, 243townership and, 241*PUBLIC and, 241Revoke Object Authority (RVKOBJAUT)
command in, 240, 241authorization lists
Retrieve Authorization List Entry(RTVAUTLE) command in, 167t
Bbackups
Retrieve Backup (RTVBCKUP) in, 167tbased variables, 41, 41basic operators and functions, 43–57batch job processing, 2, 209–219
debugging and, 271–276, 271–276Duplicate Job Option (DUPJOBOPT)
command in, 274job queues for, 210, 215QSYSOPR message queue and, 216–217, 216self-submitting programs and, CALL
command and, 217–219, 217, 218Start Service Job (STRSRVJOB) command
in, 273, 275Submit Job (SBMJOB) command in,
210–215, 212Work with Active Job (WRKACTJOB)
command in, 217Work with Job Queue (WRKOBJQ)
command in, 215Work with Submitted Jobs (WRKSBMJOB)
command in, 215–216, 217Work with Subsystem Job (WRKSBSJOB)
command in, 216, 217Work with User Jobs (WRKUSRJOB)
command in, 215%BIN/BINARY See binary conversion
(%BIN/BINARY)
binary conversion (%BIN/BINARY), 51–53, 52, 53binding, 280–282, 280, 281blank lines in source code, 20–21, 390, 391–393
removing, 396, 396–399body of procedure, 9, 9branching, GOTO command in, 71–73, 72break messages, 121Breakpoint Condition (BRKPCOND) command,
421–422, 422breakpoints
Add Breakpoint (ADDBKP) command in,419–420, 421
conditional, Breakpoint Condition(BRKPCOND) command, 421–422, 422
debugging and, 262–263, 262, 264Remove Breakpoint (RMVBKP) command
in, 421BRKPCOND. See Breakpoint Condition
(BRKPCOND) command
CCall (CALL) command, 20, 20, 76–77, 76, 134
data queues and, sending/receiving data with, 146dynamic calls and, 282parameters use of, 135–136self-submitting (to batch) programs and,
217–219, 217, 218Submit Job (SBMJOB) command and,
213–215, 213, 214, 215Transfer Control (TFRCTL) command and,
80–81, 80Call Procedure (CALLPRC) command, 76–77Call Subroutine (CALLSUBR) command, 74, 74calling programs, 2CALLPRC. See Call Procedure (CALLPRC)
commandCALLSUBR. See Call Subroutine
(CALLSUBR) commandcapabilities of CL, 2case sensitivity, 14, 15, 15*CAT/BCAT/TCAT. See concatenating strings
(*CAT/BCAT/TCAT)Change Command (CHGCMD) command, 245Change Current Library (CHGCURLIB)
command, 157, 159
472
Index
Change Data Area (CHGDTAARA) command,137–138, 137, 138
Change Job (CHGJOB) command, 140, 140,164, 164variables used with, 37–38, 37, 38
Change Job Description (CHGJOD) command, 248Change Library List (CHGLIBL) command,
157, 158, 158Change Logical File Member (CHGLFM)
command, 176Change Message Description (CHGMSGD)
command, 88Change Message Queue (CHGMSGQ)
command, 85, 85Change Object Description (CHGOBJD)
command, 203–204Change Object Owner (CHGOBJOWN)
command, 241Change Physical File Member (CHGPFM)
command, 176Change Profile (CHGPRF) command, 166Change Program Variables (CHGPGMVAR), 421Change System Library List (CHGSYSLIBL),
157, 159Change System Value (CHGSYSVAL)
command, 162, 162Change User Profile (CHGUSRPRF) command,
166, 245, 248Change Variable (CHGVAR) command, 14, 16,
40, 43–45, 44, 45, 175, 190, 468–469, 469arithmetic operators in, 46–47, 46t, 46, 47
CHAR type, 8character constants, 26–27, 26t, 27tcharacter strings, quotes and, 191–192character variables, translate, using
QDCXLATE API, 233, 234Check Object (CHKOBJ) command, 103,
197–198, 198, 198–199t, 242, 242escape messages for, 198–199t
CHGCMD. See Change Command (CHGCMD)command
CHGCURLIB. See Change Current Library(CHGCURLIB)
CHGDTAARA. See Change Data Area(CHGDTAARA) command
CHGJOB. See Change Job (CHGJOB)command
CHGJOD. See Change Job Description(CHGJOD) command
CHGLFM. See Change Logical File Member(CHGLFM) command
CHGLIBL. See Change Library List(CHGLIBL)
CHGMSD. See Change Message Description(CHGMSGD) command
CHGMSGQ. See Change Message Queue(CHGMSGQ) command
CHGOBJD. See Change Object Description(CHGOBJD) command
CHGOBJOWN. See Change Object owner(CHGOBJOWN) command
CHGPFM. See Change Physical File Member(CHGPFM) command
CHGPGMVAR. See Change Program Variables(CHGPGMVAR)
CHGPRF. See Change Profile (CHGPRF)command
CHGSYSLIBL. See Change System LibraryList (CHGSYSLIBL)
CHGSYSVAL. See Change System Value(CHGSYSVAL) command
CHGUSRPRF. See Change User Profile(CHGUSRPRF) command
CHGVAR. See Change Variable (CHGVAR)command
CHKOBJ. See Check Object (CHKOBJ)command
CLapplications and uses for, 1–2capabilities of, 2Format CL Source (FMTCLSRC) command
in, 313–315, 314–325history of, 1limitations of, 3procedures in, 5–10S/36, equivalents for, 441–461
CL coding style, 385–411alignment of similar lines in, 408, 408–410blank lines in, 390, 391–393code editors for, selecting, 410–411
NOTE: Boldface indicates illustrations and code; t indicates a table. 473
Index
CL coding style, continuedcomments and, 388, 388–390identifiers in lowercase in, 402, 402–405indentation in, 399, 399–402keywords in, removal of unnecessary, 405,
405–407labels in, separate lines for, 393, 393–396leading blanks in, removing, 396, 396–399SEU and command prompter in, 386–387,
386–387cleanup
Retrieve Cleanup (RTVCLNUP) command, 167tClear Data Queue (CLRDTAQ) command,
355–356, 356–357Clear Message Queue (CLRMSGQ) command,
123–124Clear Physical File Member (CLRPFM)
command, 176Clear Trace Data (CLRTRCDTA) command, 422Close (CLOSE) command, 175, 175CLRDTAQ. See Clear Data Queue
(CLRDTAQ) commandCLRMSGQ. See Clear Message Queue
(CLRMSGQ) commandCLRPFM. See Clear Physical File Member
(CLRPFM) commandCLRTRCDTA. See Clear Trace Data
(CLRTRCDTA) commandCMPSRCMBR. See Compare Source Members
(CMPSRCMBR) commandCNTOBJ. See Count Objects (CNTOBJ)
commandCOBOL, 1code. See programming aids/shortcuts; program
execution; source codecommand lines and security, 244–246command prompter and SEU, 386–387, 386–387command strings, quotes and, 191–192command-level (global) MONMSG, 104, 104commands, 14
Change Command (CHGCMD) in, 245command lines, security and, 244–246Create Command (CRTCMD) command in, 245Display Command (DSPCMD) command in,
230, 245
new to AS/400, vs. S/38, 433, 433–435tQCMDCHK API for, 226–228, 226–227QCMDEXC API for, 228–230, 229S/36, with i5 equivalents, 459, 459–461tS/38 vs. i5, 427–438S/38 vs. i5, table of changes to, 429, 429–433tselective prompting for. See selective
promptingComment (COMMENT) command, 365–366,
365–367comment lines, 21–23, 21, 22, 23, 388, 388–389
Comment (COMMENT) command and,365–366, 365–367
communications, 2interprogram/intermodule. See
interprogram/intermodule communicationsCompare Source Members (CMPSRCMBR)
command, 325–333, 326–338comparison operators, 61, 61compilation, 282–283, 439–440
parameter descriptions for, 286–291, 288tcompiling CL, 18–19, 19
Create Bound CL Program (CRTBNDCL)command in, 19
output of CRTBNDCL in, 19completion messages, 86tcomplex logical expressions, 62–63, 62t, 62, 63concatenating strings (*CAT/BCAT/TCAT), 49conditional breakpoints, Breakpoint Condition
(BRKPCOND) command, 421–422, 422configuration, 2
Retrieve Configuration Status(RTVCFGSTS) command, 167t
constants, 25–30character type, 26–27, 26t, 27tdecimal type, 27–28, 27t, 28texpressions using, 54–55hexadecimal type, 28–29, 29tinteger type, 28invalid, 27t, 28t, 29tlogical type, 29NULL, 29–30, 30parameters using, 135–136passing as parameters, 78–79quotation marks used with, 26
474
Index
continuing code to next line, 17–18, 18control characters, selective prompting and,
224–226, 225tcontrol languages, 169control records in files, S/36, 462–463, 462control statements, 59–81
End Program (ENDPGM) command as, 79, 80Return (RETURN) command as, 79, 80Transfer Control (TFRCTL) command as,
80–81, 80Convert Date (CVTDAT) command, 55–57, 56t,
57t, 57parameters for, 55separator characters for, 56–57t
Convert Print to Physical File (CVTPRTF)command, 187, 381, 382–383
converting S/38 to i5/iSeries code, 438Copy Object (CPYOBJ) command, 202Copy Spooled File (CPYSPLF) command, 186copy, binding by, 280–281, 280, 281COPYRIGHT command, 7, 7Count Objects (CNTOBJ) command, 376–380,
377–380CPYOBJ. See Copy Object (CPYOBJ)
commandCPYSPLF. See Copy Spooled File (CPYSPLF)
commandCreate (CRTxxx) commands, 195–196, 196, 429Create Bound CL Program (CRTBNDCL)
command, 19, 283Create CL Module (CRTCLMOD) command, 282Create Command (CRTCMD) command, 245Create Data Area (CRTDTAARA) command,
137, 196, 196Create Data Queue (CRTDTAQ) command, 145Create Duplicate Object (CRTDUPOBJ)
command, 16, 183, 202–203, 203, 341Create Job Description (CRTJOBD) command, 248Create Message File (CRTMSGF) command, 88Create Message Queue (CRTMSGQ) command, 84Create Output Queue (CRTOUTQ) command, 195Create Physical File (CRTPF) command, 170,
171, 176Create Program (CRTPGM) command, 283
Create Service Program (CRTSRVPGM)command, 282–283
Create Subsystem Description (CRTSBSD)command, 202
Create Table (CRTTBL) command, 234Create Work File (CRTWRKF) command, 183,
183, 339–340, 339–340, 463CRTBNDCL. See Create Bound CL Program
(CRTBNDCL) commandCRTCLMOD. See Create CL Module
(CRTCLMOD) commandCRTCMD. See Create Command (CRTCMD)
commandCRTDTAARA. See Create Data Area
(CRTDTAARA) commandCRTDTAQ. See Create Data Queue
(CRTDTAQ) commandCRTDUPOBJ. See Create Duplicate Object
(CRTDUPOBJ)CRTJOBD. See Create Job Description
(CRTJOBD) commandCRTMSGF. See Create Message File
(CRTMSGF) commandCRTMSGQ. See Create Message Queue
(CRTMSGQ) commandCRTOUTQ. Send Create Output Queue
(CRTOUTQ) commandCRTPF. See Create Physical File (CRTPF)
commandCRTPGM. See Create Program (CRTPGM)
commandCRTSBSD. See Create Subsystem Description
(CRTSBSD) commandCRTSRVPGM. See Create Service Program
(CRTSRVPGM) commandCRTTBL. See Create Table (CRTTBL)
commandCRTWRKF. See Create Work File
(CRTWRKF) commandCVTDAT. See Convert Date (CVTDAT)
commandCVTPRTF. See Convert Print to Physical File
(CVTPRTF) command
NOTE: Boldface indicates illustrations and code; t indicates a table. 475
Index
Ddata areas, 133, 137–139
Change Data Area (CHGDTAARA)command in, 137–138, 137, 138, 196, 196
Create Data Area (CRTDTAARA) commandin, 137
Delete Data Area (DLTDTAARA) commandin, 137
Display Data Area (DSPDTAARA)command in, 138
group, 139local, 138–139local, to pass data, 464–465, 464, 465Retrieve Data Area (RTVDTAARA)
command in, 138, 138, 167tspecial types of, 138–139work files vs., 463, 463
data queues, 133, 144–156, 349–364advantages and disadvantages of using,
155–156Clear Data Queue (CLRDTAQ) command in,
355–356, 356–357clearing data from, 146clearing, QCLRDTAQ program for, 149, 149Create Data Queue (CRTDTAQ) command
in, 145Delete Data Queue (DLTDTAQ) command
in, 145description of, retrieving with QMHQRDQD
API, 150–152, 150, 151FIFO type, 144keyed type, 144–145, 148, 148LIFO type, 144Receive Data Queue Message (QMRHDQM)
API for, 152–154, 153, 154Receive from Data Queue (RCVDTAQ)
command in, 352–354, 353–354receiving from, QRCVDTAQ program for,
147, 147Reorganize Data Queue (RGZDTAQ)
command for, 156, 361–362, 361–364Retrieve Data Queue Description
(RTVDTAQD) command in, 357–359,358–360
Send to Data Queue (SNDDTAQ) commandin, 350–351, 350–352
sending and receiving data to/from, CALLcommand and, 146
sending to, QSNDDTAQ program for,146–147, 146, 147
size of, 156types of, 144–145utility commands for, 154–155
data types, 3database management, 3, 133
Add Logical File Member (ADDLFM)command in, 176
Add Physical File Member (ADDPFM)command in, 176, 177, 177
Change Logical File Member (CHGLFM)command in, 176
Change Physical File Member (CHGPFM)command in, 176
Clear Physical File Member (CLRPFM)command in, 176
control records in files in, S/36, 462–463, 462Delete File (DLTF) command in, 197, 197Display File Field Description (DSPFFD)
command in, 184Display Record Locks (DSPRCDLCK)
command in, 207Override with Database File (OVRDBF)
command and, 172–173, 172, 178–179,178, 466–467, 466
Remove Member (RMVM) command in,176, 177
Reorganize Physical File Member(RGZPFM) command in, 176
Retrieve Member Description (RTVMBRD)command in, 201, 202
date and timeConvert Date (CVTDAT) command for,
55–57, 56t, 57t, 57Delay Job (DLYJOB) command and,
234–236, 235DCL. See Declare (DCL) commandDCLF. See Declare File (DCLF) commandDCLPRCOPT. See Declare Processing Option
(DCLPRCOPT) command
476
Index
Deallocate Object (DLCOBJ) command, 204,206–207
debugging, 257–277, 417–423Add Breakpoint (ADDBKP) command in,
419–420, 421Add Program (ADDPGM) command for, 257Add Trace (ADDTRC) command in,
422–423breakpoints in, 262–263, 262, 264Change Program Variables (CHGPGMVAR)
in, 421Clear Trace Data (CLRTRCDTA) command
in, 422commands for, summary of, 267–268tconditional breakpoints in, Breakpoint
Condition (BRKPCOND) command for,421–422, 422
Display Module Source (DSPMODSRC)command in, 275
Display Program Variables (DSPPGMVAR)command in, 421
Display Trace (DSPTRC) command in,422–423
Display Trace Data (DSPTRCDTA)command in, 422
Dump CL Program (DMPCLPGM) commandin, 276, 276, 277
Duplicate Job Option (DUPJOBOPT)command in, 274
End Debug (ENDDBG) command in, 258Evaluation (EVAL) command in, 263–266,
265, 266example of interactive session in, 259–262,
259–261Integrated Language Environment (ILE)
programs in, 258, 270–271line-oriented debugging in, 419–423List view in, 269, 269Original Program Model (OPM) programs
and, 270–271, 417–423PGM files in, 257programs that can use STRDBG for, 257Remove Breakpoint (RMVBKP) command
in, 421Remove Program (RMVPGM) for, 257
Remove Trace (RMVTRC) command in,422–423
Source view in, 262–266, 262–266SRVPGM (Service Programs) in, 258Start Debug (STRDBG) command in,
257–258, 417–419Start Service Job (STRSRVJOB) command
in, 273, 275Statement view in, 269–270, 270Step Through (STEP) command in, 267UPDPROD (Update Production Files) in, 258views in, 258–259Watch (WATCH) command in, 267within another job, simultaneous use of,
271–276, 271–276decimal constants, 27–28, 27t, 28tdeclarations, 7–8, 8Declare (DCL) command, 7–8, 8, 9
clear coding of, with variables, 34–36, 34, 35parameters for, 30–31variable declaration using, 30–33
Declare File (DCLF) command, 8, 169–171, 171Declare Processing Option (DCLPRCOPT)
command and stack, 76, 76Delay Job (DLYJOB) command, 234–236, 235Delete (DLTxxx) commands, 196–197, 197Delete Data Area (DLTDTAARA) command, 137Delete Data Queue (DLTDTAQ) command, 145Delete File (DLTF) command, 101, 176, 197delete line of code, 14Delete Spooled File (DLTSPLF) command, 187diagnostic messages, 86tDisplay (DSPxxx) commands, 184–186Display Command (DSPCMD) command, 230, 245Display Data Area (DSPDTAARA) command, 138Display File Field Description (DSPFFD)
command, 184display files
message subfiles in, 125–133, 126–128Override with Display File (OVRDSPF)
command in, 179Display Job (DSPJOB) command, 140Display Library (DSPLIB) command
variables used with, 36–37, 36, 37
NOTE: Boldface indicates illustrations and code; t indicates a table. 477
Index
Display Message (DSPMSG) command, 25,101, 122–123, 249
Display Message Description (DSPMSGD)command, 89
Display Module Source (DSPMODSRC)command, 275
Display Object Description (DSPOBJD)command, 184
Display Object Information (DSPOBJINF)command, 367–368, 368–376
Display Overrides (DSPOVR) command, 179Display Program (DSPPGM) command, 184Display Program Message (DSPPGMMSG)
command, 117, 301, 301–304Display Program Variables (DSPPGMVAR)
command, 421Display Record Locks (DSPRCDLCK)
command, 207Display Trace (DSPTRC) command, 422–423Display Trace Data (DSPTRCDTA) command, 422Display User Profiles (DSPUSRPRF), 186DLCOBJ. See Deallocate Object (DLCOBJ)
commandDLTDTAARA. See Delete Data Area
(DLTDTAARA) commandDLTDTAQ. See Delete Data Queue
(DLTDTAQ) commandDLTF. See Delete File (DLTF) commandDLTSPLF. See Delete Spooled File (DLTSPLF)
commandDLYJOB. See Delay Job (DLYJOB) commandDMPCLPGM. See Dump CL Program
(DMPCLPGM) commandDMPCLPGRM. See Dump CL Program
(DMPCLPGRM) commandDO command, 63–65, 63, 64, 65
ELSE with, 67–68, 67nesting, 64–65, 64, 65single-level groups in, 63–64, 63
DOFOR command, 70, 70, 71DOUNTIL command, 69, 70, 71DOWHILE command, 69, 69, 71DSPCMD. See Display Command (DSPCMD)
command
DSPDTAARA. See Display Data Area(DSPDTAARA) command
DSPFFD. See Display File Field Description(DSPFFD) command
DSPJOB. See Display Job (DSPJOB) commandDSPLIB. See Display Library (DSPLIB)
commandDSPMODSRC. See Display Module Source
(DSPMODSRC) commandDSPMSG. See Display Message (DSPMSG)
commandDSPMSGD. See Display Message Description
(DSPMSGD) commandDSPOBJD. See Display Object Description
(DSPOBJD) commandDSPOBJINF. See Display Object Information
(DSPOBJINF) commandDSPOVR. See Display Overrides (DSPOVR)
commandDSPPGM. See Display Program (DSPPGM)
commandDSPPGMMSG. See Display Program Message
(DSPPGMMSG) commandDSPPGMVAR. See Display Program Variables
(DSPPGMVAR) commandDSPRCDLCK. See Display Record Locks
(DSPRCDLCK) commandDSPTRC. See Display Trace (DSPTRC)
commandDSPTRCDTA. See Display Trace Data
(DSPTRCDTA) commandDSPUSRPRF. See Display User Profiles
(DSPUSRPRF) commandDump CL Program (DMPCLPGM) command,
76, 276, 276, 277DUPJOBOPT. See Duplicate Job Option
(DUPJOBOPT) commandDuplicate Job Option (DUPJOBOPT), 274Duplicate Object (DUPOBJ) command,
341–342, 341–344DUPOBJ. See Duplicate Object (DUPOBJ)dynamic calls, 282dynamically built statement execution, 465–466,
465, 466
478
Index
EEdit Object Authority (EDTOBJAUT)
command, 240, 241editors, code, 410–411EDTOBJAUT. See Edit Object Authority
(EDTOBJAUT) commandELSE command, 66–68, 66, 67
DO with, 67–68, 67embedded quotes, 190–191, 191End Debug (ENDDBG) command, 258End Program (ENDPGM) command, 9–10, 10,
79, 80End Receive (ENDRCV) command, 170, 172End Subroutine (ENDSUBR) command, 73–75ENDDBG. See End Debug (ENDDBG)
commandENDDO command, 63–65, 63, 64, 65ENDPGM. See End Program (ENDPGM)
commandENDRCV. See End Receive (ENDRCV) commandENDSELECT command, 68ENDSUBR. See End Subroutine (ENDSUBR)
commandEQ, 61error handling
error messages in, 100–101Create Data Area (CRTDTAARA) command
and, 196, 196Monitor Message (MONMSG) command in,
101–103, 101, 102, 103command-level (global), 104, 104program-level (global), 103–104, 103
MONMSG and global error trapping in, 8–9selective prompting and, 224specific vs. generic monitoring in, 105–106, 105
error messages, 100–101escape messages, 86t
for CHKOBJ, 198–199teServer iSeries, 1Evaluation (EVAL) command, 263–266, 265, 266expressions, 54–55
logical, 59–61, 60, 61t, 61quotes used in, 191–192S/36, procedure control, 446–452, 447–451S/36, substitution, 441–446, 441–446
FF4 key to format statements, 11–15, 11, 13, 14, 18FIFO data queues, 144FILE LABEL–xxx use, S/36, 466–467, 466file management, 169–187
Add Logical File Member (ADDLFM)command in, 176
Add Physical File Member (ADDPFM)command in, 176, 177, 177
Change Logical File Member (CHGLFM)command in, 176
Change Physical File Member (CHGPFM)command in, 176
Clear Physical File Member (CLRPFM)command in, 176
Close (CLOSE) command in, 175, 175control records in files in, S/36, 462–463, 462Convert Print to Physical File (CVTPRTF)
command in, 187, 381, 382–383Create Duplicate Object (CRTDUPOBJ)
command in, 183Create Physical File (CRTPF) command in,
170, 171, 176Create Work File (CRTWRKF) command in,
183, 183, 339–340, 339–340, 463database file member processing in, 176–177.
See also database managementDeclare File (DCLF) command in, 169–171, 171Delete File (DLTF) command in, 101, 176, 197Display (DSPxxx) commands in, 184–186Display File Field Description (DSPFFD)
command in, 184Display Overrides (DSPOVR) command in, 179End Receive (ENDRCV) command in, 170, 172Format Data (FMTDTA) command in,
469–470Open Query File (OPNQRYF) command in,
469–470, 470outfiles and, 184–186override commands in, 178–179Override with Database File (OVRDBF)
command and, 172–173, 172, 178–179,178, 466–467, 466
Override with Display File (OVRDSPF)command in, 179
NOTE: Boldface indicates illustrations and code; t indicates a table. 479
Index
file management, continuedOverride with Printer File (OVRPRTF)
command in, 179, 179, 467–468printing output from, using
OUTPUT(*PRINT), 186–187QTEMP library to capture output in, 182–184random input and, using RCVF for, 172–174,
172, 173Receive File (RCVF) command in, 170,
171–174record-by-record processing of files in, 169Remove Member (RMVM) command in,
176, 177Reorganize Physical File Member
(RGZPFM) command in, 176Retrieve Member Description (RTVMBRD)
command in, 168tSend File (SNDF) command in, 174–175, 174Send/Receive File (SNDRCVF) command in,
170, 174–175, 174sort files with Open Query File (OPNQRYF)
command in, 180–182, 181, 193, 193sorting files with #GSORT in, 469–470, 470Wait (WAIT) command in, 170, 171–172whole-file processing in, 176–182work file creation/deletion in, S/36, 463, 463work files (permanent) in, 182–184, 183
Find Object (FNDOBJ) command, 200, 200floating point data, 78FMTCLSRC. See Format CL Source
(FMTCLSRC) commandFMTDTA. See Format Data (FMTDTA)
commandFNDOBJ. See Find Object (FNDOBJ) commandFormat CL Source (FMTCLSRC) command,
313–315, 314–325Format Data (FMTDTA) command, 469–470formatting statements using F4, 11–15, 11, 13,
14, 18Forward Program Message (FWDPGMMSG)
command, 200, 294–297, 294–298function keys, selective prompting and,
222–224, 223–224functions, 43–57
FWDPGMMSG. See Forward Program Message(FWDPGMMSG) command
GGE logical operator, 61tgeneric messages, 105global error trapping and MONMSG, 8–9GOTO command, 9, 17, 71–73, 72Grant Object Authority (GRTOBJAUT)
command, 240group data areas, 139group profiles, change all, 185, 185GRTOBJAUT. See Grant Object Authority
(GRTOBJAUT) commandGSORT, 469–470, 470GT logical operator, 61t
Hhexadecimal constants, 28–29, 29thierarchy of operators, 54–55high-level languages, 1Holt, Ted, 180
Ii5/OS. See IBM i operating systemIBM i operating system, 1identifiers in lowercase, 402, 402–405IF command, 59–63
complex logical expressions and, 62–63, 62t,62, 63
logical expressions and, 59–61, 60, 61t, 61nesting, 65–66, 65, 66THEN and, 65
ILE. See Integrated Language Environmentindenting source code, 14, 18indirect referencing using ??N??, S/36,
468–469, 468 469informational messages, 87tinitial programs, 247. See sign-on programsInitialize Library (INZLIB) command, 308–310,
309–312INLPGM attribute, sign-on programs and, 247inquiry messages, 86t
480
Index
insert line code, 14integer constants, 28Integrated Language Environment (ILE), 279–291
activation groups in, 284–286binding in, 280–282, 280, 281compilation in, 282–283compilation, parameter descriptions for,
286–291, 288tCreate Bound CL (CRTBNDCL) command
in, 283Create CL Module (CRTCLMOD) command
in, 282Create Program (CRTPGM) command in, 283Create Service Program (CRTSRVPGM)
command in, 282–283debugging and, 258, 270–271dynamic calls in, 282object code in, 279–280OPM vs. 425, 426tprocedures in, 279–280programs in, 279–280
interactive jobs, 209interpreted vs. compiled languages, 439–440interprogram/intermodule communications,
133–156. See also database management;parameters; data areas; switches; messages; dataCall (CALL) command and, 134data areas for, 137–139
Change Data Area (CHGDTAARA)command in, 137–138, 137, 138
Create Data Area (CRTDTAARA)command in, 137
Delete Data Area (DLTDTAARA)command in, 137
Display Data Area (DSPDTAARA)command in, 138
group, 139local, 138–139Retrieve Data Area (RTVDTAARA)
command in, 138, 138special types of, 138–139
data queues in, 144–156advantages and disadvantages of using,
155–156clearing data from, 146
clearing, QCLRDTAQ program for, 149, 149Create Data Queue (CRTDTAQ)
command in, 145Delete Data Queue (DLTDTAQ) in, 145description of, retrieving with
QMHQRDQD API, 150–152, 150, 151keyed, 148, 148Receive Data Queue Message (QMRHDQM)
API for, 152–154, 153, 154receiving from, QRCVDTAQ program for,
147, 147Reorganize Data Queue (RGZDTAQ)
command for, 156sending and receiving data to/from, CALL
command and, 146sending to, QSNDDTAQ program for,
146–147, 146, 147size of, 156types of, 144–145utility commands for, 154–155
message for, 142–144. See also messagemanagementReceive Message (RCVMSG) in,
143–144, 143, 144Send Program Message (SNDPGMMSG)
command in, 142–143,parameters for, 134–136, 135switches for, 139–142
Change Job (CHGJOB) command and,140, 140
Display Job (DSPJOB) command and, 140on/off, 140, 140Retrieve Job Attributes (RTVJOBA)
command and, 140–141, 141%SWITCH function for, 141, 141testing, 140–141, 141
Transfer Control (TFRCTL) command and, 134INZLIB. See Initialize Library (INZLIB)
commandITERATE command, 9, 71, 71
Jjob management, 157–168. See also switches
Add Library List Entry (ADDLIBLE) in, 157,158
NOTE: Boldface indicates illustrations and code; t indicates a table. 481
Index
job management, continuedAllocate Object (ALCOBJ) command in,
204–207, 205t, 206attributes or settings of, manipulating, 163–164batch job processing in. See batch job processingChange Current Library (CHGCURLIB) in,
157, 159Change Job (CHGJOB) command and, 140,
140, 164, 164Change Job Description (CHGJOD)
command in, 248Change Library List (CHGLIBL) in, 157,
158, 158Change Profile (CHGPRF) command in, 166Change System Library List (CHGSYSLIBL)
in, 157, 159Change User Profile (CHGUSRPRF)
command in, 166, 248Create Job Description (CRTJOBD)
command and, 248data areas for, 138–139Deallocate Object (DLCOBJ) command in,
204, 206–207Delay Job (DLYJOB) in, 234–236, 235Display Job (DSPJOB) command in, 140Duplicate Job Option (DUPJOBOPT)
command in, 274interactive jobs and, 209job message queues for, 84–85job queues for, 210library list support in, 157–159QSYSOPR message queue, 216–217, 216Remove Library List Entry (RMVLIBLE) in,
157, 158, 158Retrieve (RTVxxx) commands used in, 167,
167–168tRetrieve Job Attributes (RTVJOBA)
command and, 140–141, 141, 163–164,163, 164, 168t
Retrieve Network Attributes (RTVNETA)command in, 166, 166
Retrieve User Profile (RTVUSRPRF)command in, 165–166, 166
scheduler program for, using RTVSYSVALcommand, 159–160, 160
sign-on programs and job descriptions,248–249, 248
Start Service Job (STRSRVJOB) in, 273, 275Submit Job (SBMJOB) command in, 192,
210–215, 212switches in, 139–142system values and, 159–162
Change System Value (CHGSYSVAL)command in, 162, 162
list of, 160, 161–162t, 160Retrieve System Value (RTVSYSVAL)
command in, 159user profiles in, manipulating, 165–166Work with Active Job (WRKACTJOB)
command in, 217Work with Job Queue (WRKOBJQ)
command in, 215Work with Submitted Jobs (WRKSBMJOB)
command in, 215–216, 217Work with Subsystem Job (WRKSBSJOB)
command in, 216, 217Work with User Jobs (WRKUSRJOB)
command in, 215job message queues, 84–85job queues, 210
Work with Job Queue (WRKOBJQ)command in, 215
job scheduler program, using RTVSYSVALcommand, 159–160, 160
job–system interface. See job management
Kkeyed data queue, 144–145, 148, 148keys, message, KEYVAR parameter, 97, 97KEYVAR parameter, 97, 97keywords, 8, 14, 16–17, 16, 17
removal of unnecessary, 405, 405–407
Llabels, 9, 14
FILE LABEL–xxx use in, 466–467, 466GOTO command and, 72–73, 72separate lines for, 393, 393–396subroutine use of, 73–75
482
Index
LE logical operator, 61tleading blanks in code, removing, 396, 396–399LEAVE command, 9, 71, 71LEN parameter in a variable, 8, 32–33, 33, 33tlibraries/library lists, 2, 157–159
Add Library List Entry (ADDLIBLE) in,157, 158
Change Current Library (CHGCURLIB) in,157, 159
Change Library List (CHGLIBL) in, 157,158, 158
Change System Library List (CHGSYSLIBL)in, 157, 159
Display Library (DSPLIB) command, 36Initialize Library (INZLIB) command in,
308–310, 309–312QTEMP library to capture output in, 182–184Remove Library List Entry (RMVLIBLE) in,
157, 158, 158Restore Library List (RSTLIBL) command
in, 345–348, 345–348Retrieve Library Description (RTVLIBD)
command in, 168tSave Library List (SAVLIBL) command in,
345–348, 345–348selection of, 10utility commands placed in, 293
LIFO data queues, 144limitations of CL, 3line-oriented debugging, 419–423List view debugging, 269, 269literals, 25. See also constantslocal data areas (LDAs), 133, 138–139,
464–465, 464, 465locks and locking
Display Record Locks (DSPRCDLCK)command in, 207
Work with Object Locks (WRKOBJLCK)command in, 207
logical constants, 29logical expressions, 59–61, 60, 61t, 61
complex, 62–63, 62t, 62, 63logical operators, 59–61, 60, 61t, 61logical variables, 53–54, 54, 59–61, 60, 61t, 61
AND, OR, NOT and, 53–54, 54
loopsChange Variable (CHGVAR) command in,
468–469, 469DOFOR command and, 70, 70DOUNTIL command and, 69, 70DOWHILE command and, 69, 69GOTO command in, 71–73, 72indirect referencing using ??N?? in, 468–469,
468 469ITERATE command and, 71, 71LEAVE command and, 71, 71
LT logical operator, 61t
MMalaga, Ernie, xix–xxMaterials Requirements Planning (MRP), 133menu program (PRTCTLMNU), using subfiles,
129–132, 129–131message management, 83–132, 133, 294–304
Add Message Description (ADDMSGD)command in, 88, 89
Add Reply List Entry (ADDRPYLE)command in, 124
Change Message Description (CHGMSGD)command in, 88
Change Message Queue (CHGMSGQ)command in, 85, 85
Clear Message Queue (CLRMSGQ)command in, 123–124
command-level (global) MONMSG in, 104,104
completion messages in, 86t, 86Create Message File (CRTMSGF) command
in, 88Create Message Queue (CRTMSGQ)
command for, 84descriptions of messages in, 88–90diagnostic messages in, 86tDisplay Message (DSPMSG) command in,
25, 101, 122–123, 249Display Message Description (DSPMSGD)
command in, 89Display Program Message (DSPPGMMSG)
command in, 117, 301, 301–304error messages in, 100–101
NOTE: Boldface indicates illustrations and code; t indicates a table. 483
Index
message management, continuedescape messages in, 86tForward Program Message (FWDPGMMSG)
command in, 200, 294–297, 294–298generic messages in, 105impromptu vs. predefined messages in, 87, 98informational messages in, 87tinquiry messages in, 86tinterprogram/intermodule communications
and, 142–144job message queues in, 84–85keys with, KEYVAR parameter for, 97, 97menu program for (PRTCTLMNU), using
subfiles, 129–132, 129–131message files in, 88Monitor Message (MONMSG) command in,
101–103, 101, 102, 103, 224monitored messages in, 100–106MYLIB library for, 88new versus old messages in, 85notify messages in, 87tpermanent message queues in, 84predefined message queues for, 84predefined messages in, 87, 88–90, 98program message queues for, 84–85program-level (global) MONMSG in,
103–104, 103purpose of message in, categorization by, 85–87QSYSOPR message queue and, 216–217, 216queues in, 84–85Receive Data Queue Message (QMRHDQM)
API for, 152–154, 153, 154Receive Message (RCVMSG) command, 85,
96, 96, 106–117, 143–144, 143, 144, 246Display Program Messages
(DSPPGMMSG) use of, 117from where, PGMQ/MSGQ parameters
for, 107–108, 107tinformation about message in, 110–115,
112t, 113–114t, 114–115tremove received messages in, 115–116return types in, 114–115, 114–115twait time for, 116which message to receive,
MSGTYPE/MSGKEY parameters for, 108
receiving replies to, MSGRPY parameter for, 99recipient who should get message in
(TOPGMQ parameter), defining, 92–95,93t, 93, 94, 99
recipient who should get message in (TOUSRparameter), defining, 95, 99
Remove Message Description (RMVMSGD)command in, 88
Remove Messages (RMVMSG) command in,117–119, 118t, 119
remove received messages in, 115–116replies to, requesting in, RPYMSGQ
parameter for, 96, 96reply messages in, 86trequest message in, 86tRetrieve Message (RTVMSG) in, 168treturn types in, 114–115, 114–115tSend Break Message (SNDBRKMSG)
command in, 121Send Message (SNDMSG) command in,
120–121, 192, 222, 222Send Program Message (SNDPGMMSG)
command in, 91–97, 92, 142–143, 142Send Reply (SNDRPY) command in,
119–120, 120Send Status Message (SNDSTSMSG)
command in, 298–299, 299–300Send User Message (SNDUSRMSG)
command in, 98–100, 100severity levels of messages in, 90, 90tspecific vs. generic monitoring in, 105–106, 105status messages in, 87tsubfiles for, 125–133, 126–128system reply list in, 124–125translate (TRNTBL) parameter in, 99–100types of messages in, 85–87, 86–87ttypes of messages in, defining with
MSGTYPE parameter, 95–96, 95, 98utility commands for, 294–304wait time for, 116what to say in message (contents of), 91–92Work with Message Descriptions
(WRKMSGD) command in, 89Work with Messages (WRKMSG) command
in, 122–123
484
Index
message queues, Monitor Message (MONMSG)command in, 8–9
message subfiles, 125–133, 126–128minus (–) sign as continuation character, 17–18, 18modules, 19
interprogram/intermodule communicationsin, 133–156. See interprogram/intermodulecommunications
Monitor Message (MONMSG) command, 8–9,101–103, 101, 102, 103selective prompting and, errors in, 224
monitored messages, 100–106MONMSG. See Monitor Message (MONMSG)
commandMove Object (MOVOBJ) command, 203–204MOVOBJ. See Move Object (MOVOBJ)
commandMSGTYPE parameter, defining message type,
95–96, 95, 98MYLIB library, message management and, 88
Nnames, qualified, 428, 428naming variables, 31t, 32tNE logical operator, 61tnested DO, 64–65, 64, 65nested IF, 65–66, 65, 66networks, Retrieve Network Attributes
(RTVNETA) command, 166, 166NG logical operator, 61tnibble, 28NL logical operator, 61tNOT, 53–54, 54, 62tnotify messages, 87tNULL, 29–30, 30
Oobject code, ILE, 279–280object management, 2, 195–207
Allocate Object (ALCOBJ) command in,204–207, 205t, 206
Change Object Description (CHGOBJD)command in, 203–204
Change Object owner (CHGOBJOWN)command in, 241
Check Object (CHKOBJ) command in, 103,197–198, 198, 198–199t, 242, 242
Copy Object (CPYOBJ) command in, 202Count Objects (CNTOBJ) command in,
376–380, 377–380Create (CRTxxx) commands, 195–196, 196Create Duplicate Object (CRTDUPOBJ)
command in, 16, 183, 202–203, 203, 341Deallocate Object (DLCOBJ) command in,
204, 206–207Delete (DLTxxx) commands in, 196–197, 197Display Object Description (DSPOBJD)
command in, 184Display Object Information (DSPOBJINF)
command in, 367–368, 368–376Display Record Locks (DSPRCDLCK)
command in, 207Duplicate Object (DUPOBJ) command in,
341–342, 341–344Edit Object Authority (EDTOBJAUT)
command in, 240, 241escape messages for CHKOBJ and, 198–199tFind Object (FNDOBJ) command in, 200, 200Grant Object Authority (GRTOBJAUT)
command in, 240manipulating objects in, 203–204Move Object (MOVOBJ) command in,
203–204ownership of, 241*PUBLIC and, 241Rename Object (RNMOBJ) command in,
203–204Retrieve Member Description (RTVMBRD)
command in, 201, 202Retrieve Object Description (RTVOBJD)
command in, 168t, 199–200, 199–200Revoke Object Authority (RVKOBJAUT)
command in, 240, 241S/38 vs. i5, 427–428securing *PGM object in, 239–241Work with Object Locks (WRKOBJLCK)
command in, 207obsolete commands, 429
NOTE: Boldface indicates illustrations and code; t indicates a table. 485
Index
OCL statements, S/36, 452–455, 453Open Query File (OPNQRYF) command,
180–182, 181, 193, 193, 469–470, 470operators, 43–57
arithmetic, 46–47, 46t, 46, 47comparison, 61, 61hierarchy of, 54–55logical (AND, OR, NOT), 53–54, 54, 59–61,
60, 61t, 61OPM. See Original Program Model (OPM)OPNQRYF. See Open Query File (OPNQRYF)
commandOR, 53–54, 54, 62tOriginal Program Model (OPM), 19, 279, 425, 426
debugging in, 270–271, 417–423Add Breakpoint (ADDBKP) command in,
419–420, 421Add Trace (ADDTRC) command in,
422–423Change Program Variables
(CHGPGMVAR) in, 421Clear Trace Data (CLRTRCDTA)
command in, 422conditional breakpoints in, Breakpoint
Condition (BRKPCOND) for, 421Display Program Variables
(DSPPGMVAR) command in, 421Display Trace (DSPTRC) command in,
422–423Display Trace Data (DSPTRCDTA)
command in, 422line-oriented debugging in, 419–423Remove Breakpoint (RMVBKP)
command in, 421Remove Trace (RMVTRC) command in,
422–423Start Debug (STRDBG) command in,
417–419Integrated Language Environment (ILE) vs.,
425, 426tOS/400. See IBM i operating systemOTHERWISE command, 68outfiles, 184–186output queue management, Create Output Queue
(CRTOUTQ) command in, 195
OUTPUT(*PRINT), 186–187overlaid/overlaying variables, 39, 39, 48–49, 49Override with Database File (OVRDBF)
command, 172–173, 172, 178–179, 178,466–467, 466
Override with Display File (OVRDSPF)command, 179
Override with Printer File (OVRPRTF)command, 179, 179, 467–468
override commands, 178–179OVRDBF. See Override with Database File
(OVRDBF) commandOVRDSPF. See Override with Display File
(OVRDSPF) commandOVRPRTF. See Override with Printer File
(OVRPRTF) commandownership and authority, 241
Pparameters, 8, 14, 133
Call (CALL) command and, 134, 135–136changing placement of, 15constants for, 135–136interprogram/intermodule communication
using, 134–136, 135keywords as, 16–17, 16 17limitations to passing of, 136passing variables as, 77–78, 78passing, 134–136, 135positional, 16–17, 16, 17sign-on programs and, 247Transfer Control (TFRCTL) command and,
134, 136variables as, 38–39, 134–135
PARM parameter, 7, 7passing constants as variables, 78–79passing parameters, 134–136, 135passing values, 77–78, 78
local data area for, 464–465, 464, 465Receive Message (RCVMSG) in, 143–144,
143, 144Send Program Message (SNDPGMMSG)
command in, 142–143, 142Submit Job (SBMJOB) command and, 213
486
Index
patterns, scan, using QCLSCAN API, 231–233,231–232t, 232–233
PDM. See Start PDM (PDM) commandpermanent message queues, 84PGM. See Program (PGM) command*PGM object, security and, 239–241physical files, 10plus (+) sign as continuation character, 17–18, 18pointers/pointer variables, 40, 40, 41positional parameters, 16–17, 16, 17power schedules, Retrieve Power Schedule
Entry (RTVPWRSCDE) command in, 168tpower up/down, 2predefined message queues, 84predefined messages, 87, 98, 88–90. See also
message managementprinter management
Convert Print to Physical File (CVTPRTF)command in, 187, 381, 382–383
Copy Spooled File (CPYSPLF) in, 186Delete Spooled File (DLTSPLF) in, 187Override with Printer File (OVRPRTF)
command in, 179, 179, 467–468//PRINTER use in, 467–468printing output to, using OUTPUT(*PRINT),
186–187//PRINTER, 467–468procedure control expressions, S/36, 446–452,
447–451procedures in CL, 5–10, 5–6, 279–280. See also
CL coding stylebinding in, 280–282, 280, 281blank lines in, 20–21body of, 9, 9Call (CALL) command for, 76–77, 76Call Procedure (CALLPRC) command in, 76–77commands in, 5comment lines in, 21–23, 21, 22, 23compiling, 18–19, 19COPYRIGHT command in, 7, 7declarations in, 7–8, 8Declare (DCL) command in, 7–8, 8, 9Declare File (DCLF) commands in, 8Delay Job (DLYJOB) in, 234–236, 235End Program (ENDPGM) in, 9–10, 10
global error trapping and MONMSG in, 8–9keywords in, 8labels in, 9Monitor Message (MONMSG) in, 8–9OCL, in S/36, with i5 equivalents, 456, 456–459toptional components of, 20–23parameters in, 8PARM parameter in, 7, 7Program (PGM) command in, 6–7, 7, 9program execution and, 20, 20program message queues for, 84–85Retrieve User Profile (RTVUSRPRF) in, 9S/36, procedure control expressions and,
446–452, 447–451S/36, running, 441selective prompting within. See selective
promptingsource code entry in, using SEU, 1–18starting SEU for, 10–11, 11structure of, 6, 6subroutines used in, 73–76, 75uppercase/lowercase in, 15, 15
Program (PGM) command, 6–7, 7, 9Program Development Manager (PDM), 10
Work with Members Using PDM(WRKMBRPDM) in, 10
program execution, 20, 20activation groups in, 284–286binding in, 280–282, 280, 281command-level (global) MONMSG in, 104, 104compilation in, 282–283compilation, parameter descriptions for,
286–291, 288tcontrol statements in, 59–81Create Bound CL (CRTBNDCL) command
in, 283Create CL Module (CRTCLMOD) command
in, 282Create Program (CRTPGM) command in, 283Create Service Program (CRTSRVPGM)
command in, 282–283Display Program (DSPPGM) command in, 184Dump CL Program (DMPCLPGM) command
in, 276, 276, 277dynamic calls in, 282
NOTE: Boldface indicates illustrations and code; t indicates a table. 487
Index
program execution, continueddynamically built statement execution in,
465–466, 465, 466interprogram/intermodule communications
in, 133–156. See alsointerprogram/intermodule communications
program message queues for, 84–85program-level (global) MONMSG in,
103–104, 103QCMDCHK API for, 226–228, 226–227QCMDEXC API for, 228–230, 229Reclaim Resources (RCLRSC) command in,
236–237subroutines and, 73–76
program message queues, 84–85program-level (global) MONMSG, 103–104, 103programming aids/shortcuts, 304–338. See also
CL coding styleCompare Source Members (CMPSRCMBR)
command in, 325–333, 326–338converting S/38 to i5/iSeries from, 438Create Work File (CRTWRKF) command in,
339–340, 339–340Duplicate Object (DUPOBJ) command in,
341–342, 341–344Format CL Source (FMTCLSRC) command
in, 313–315, 314–325Initialize Library (INZLIB) command in,
308–310, 309–312obsolete commands in, 429Restore Library List (RSTLIBL) command
in, 345–348, 345–348S/36 code and, 439–470S/36 specific, 462–470S/38 vs. i5 code/features, 427–438Save Library List (SAVLIBL) command in,
345–348, 345–348Start PDM (PDM) command in, 305–306,
305–308programming languages, 1programs, 279–280prompting, selective. See selective promptingPRTCTLMNU menu program, using subfiles,
129–132, 129–131*PUBLIC, 241
QQCLRDTAQ program for clearing data queue,
149, 149QCLSCAN API to scan for patterns, 231–233,
231–232t, 232–233QCLSRC physical source file, 10QCMD, security and, 246QCMDCHK API, 226–228, 226–227QCMDEXC API, 228–230, 229
unallowed commands with, 230QDCXLATE API to translate characters, 233, 234QMHQRDQD API, data queue description,
150–152, 150, 151QMRHDQM. See Receive Data Queue Message
(QMRHDQM) APIQRCVDTAQ program for receiving from data
queues, 147, 147QSNDDTAQ program for sending to data
queues, 146–147, 146, 147QSYS, security and, 246QSYSOPR message queue, 216–217, 216QSYSTRNTBL translation table, 234QTEMP
to capture file output, 182–184Create Duplicate Object (CRTDUPOBJ)
command in, 183Create Work File (CRTWRKF) in, 183, 183work files (permanent) in, 182–184, 183
qualified names, 428, 428question mark (?), selective prompting and, 221, 221queue management, 2queues, message, 84–85. See also message
managementquotation marks, 14, 26"E variable, 192–193, 193quotes, 189–193
"E variable and, 192–193, 193apostrophe vs., 189character strings and, 191–192command strings and, 191–192embedded, 190–101, 191expressions using, 191–192multiple, 192, 192single vs. double, 189
QUSCMDLN, security and, 246
488
Index
Rrandom input, using RCVF, 172–174, 172, 173RCLRSC. See Reclaim Resources (RCLRSC)
commandRCVDTAQ. See Receive from Data Queue
(RCVDTAQ) commandRCVF. See Receive File (RCVF) commandRCVMSG. See Receive Message (RCVMSG)
commandReceive Data Queue Message (QMRHDQM)
API, 152–154, 153, 154Receive File (RCVF) command, 170, 171–174Receive from Data Queue (RCVDTAQ)
command, 352–354, 353–354Receive Message (RCVMSG) command, 85, 96,
96, 106–117command lines and, 246Display Program Messages (DSPPGMMSG)
use of, 117from where, PGMQ/MSGQ parameters for,
107–108, 107tinformation about message in, 110–115, 112t,
113–114t, 114–115tinterprogram/module communication using,
143–144, 143, 144remove received messages in, 115–116return types in, 114–115, 114–115twait time for, 116which message to receive,
MSGTYPE/MSGKEY parameters for,108–110, 108–109t
recipient of message (TOPGMQ parameter),defining, 92–95, 93t, 93, 94, 99
recipient of message (TOUSR parameter),defining, 95, 99
Reclaim Resources (RCLRSC) command,236–237
record-by-record file processing, 169reference, binding by, 281–282Remove Breakpoint (RMVBKP) command, 421Remove Library List Entry (RMVLIBLE), 157,
158, 158Remove Member (RMVM) command, 176, 177Remove Message Description (RMVMSGD)
command, 88
Remove Messages (RMVMSG) command,117–119, 118t, 119
Remove Program (RMVPGM) command, 257Remove Trace (RMVTRC) command, 422–423Rename Object (RNMOBJ) command, 203–204Reorganize Data Queue (RGZDTAQ)
command, 156, 361–362, 361–364Reorganize Physical File Member (RGZPFM)
command, 176replies to messages, RPYMSGQ parameter, 96, 96reply messages, 86trequest messages, 86tresource management
Reclaim Resources (RCLRSC) command in,236–237
Restore Library List (RSTLIBL) command,345–348, 345–348
Retrieve (RTVxxx) commands, 167, 167–168tQCMDEXC API not allowed with, 230
Retrieve Authorization List Entry(RTVAUTLE) command, 167t
Retrieve Backup (RTVBCKUP) command, 167tRetrieve CL Source (RTVCLSRC) command,
237–238Retrieve Cleanup (RTVCLNUP) command, 167tRetrieve Configuration Status (RTVCFGSTS)
command, 167tRetrieve Data Area (RTVDTAARA) command,
138, 138, 167tRetrieve Data Queue Description
(RTVDTAQD) command, 357–359, 358–360Retrieve Job Attributes (RTVJOBA) command,
140–141, 141, 163–164, 163, 164, 168tRetrieve Library Description (RTVLIBD)
command, 168tRetrieve Member Description (RTVMBRD)
command, 168t, 201, 202Retrieve Message (RTVMSG) command, 168tRetrieve Network Attributes (RTVNETA)
command, 166, 166, 168tRetrieve Object Description (RTVOBJD)
command, 168t, 199–200, 199–200Retrieve Power Schedule Entry
(RTVPWRSCDE) command, 168tRetrieve System Value (RTVSYSVAL) 159, 168t
NOTE: Boldface indicates illustrations and code; t indicates a table. 489
Index
Retrieve System/36 Attributes (RTVS36A), 168tRetrieve User Profile (RTVUSRPRF), 9,
165–166, 166, 168tReturn (RETURN) command, 79, 80return types, messages, 114–115, 114–115tRevoke Object Authority (RVKOBJAUT)
command, 240RGZDTAQ. See Reorganize Data Queue
(RGZDTAQ) commandRGZPFM. See Reorganize Physical File
Member (RGZPFM) commandRMVBKP. See Remove Breakpoint (RMVBKP)RMVLIBLE. See Remove Library List Entry
(RMVLIBLE)RMVM. See Remove Member (RMVM)RMVMSG. See Remove Messages (RMVMSG)RMVMSGD. See Remove Message Description
(RMVMSGD) commandRMVPGM. See Remove Program (RMVPGM)RMVTRC. See Remove Trace (RMVTRC)RNMOBJ. See Rename Object (RNMOBJ)RPG, 1, 3RPYMSGQ parameter, requesting message
replies, 96, 96RSTLIBL. See Restore Library List (RSTLIBL)RTVAUTLE. See Retrieve Authorization List
Entry (RTVAUTLE) commandRTVBCKUP. See Retrieve Backup
(RTVBCKUP) commandRTVCFGSTS. See Retrieve Configuration
Status (RTVCFGSTS) commandRTVCLNUP. See Retrieve Cleanup
(RTVCLNUP) commandRTVCLSRC. See Retrieve CL Source
(RTVCLSRC) command,RTVDTAARA. See Retrieve Data Area
(RTVDTAARA) commandRTVDTAQD. See Retrieve Data Queue
Description (RTVDTAQD) commandRTVJOBA. See Retrieve Job Attributes
(RTVJOBA) commandRTVLIBD. See Retrieve Library Description
(RTVLIBD) commandRTVMBRD. See Retrieve Member Description
(RTVMBRD) command
RTVNETA. See Retrieve Network Attributes(RTVNETA) command
RTVOBJD. See Retrieve Object Description(RTVOBJD) command
RTVPWRSCDE. See Retrieve Power ScheduleEntry (RTVPWRSCDE) command
RTVS36A. See Retrieve System/36 Attributes(RTVS36A) command
RTVSYSVAL. See Retrieve System Value(RTVSYSVAL) command
RTVUSRPRF. See Retrieve User Profile(RTVUSRPRF) command
RVKOBJAUT. See Revoke Object Authority(RVKOBJAUT) command
SS/36 code, 439–470
CL equivalents for, 441–461coding techniques, upgrading skills, 462–470control commands in, with i5 equivalents,
459, 459–461tdynamically built statement execution in,
465–466, 465, 466entering/leaving, 440environment for, 440–441expressions
procedure control, 446–452, 447–451substitution, 441–446, 441–446
FILE LABEL–xxx use in, 466–467, 466indirect referencing using ??N?? in, 468–469,
468 469interpreted vs. compiled languages and, 439–440local data areas to pass data in, 464–465,
464, 465OCL procedures in, with i5 equivalents, 456,
456–459tOCL statements in, 452–455, 453//PRINTER use in, 467–468Retrieve System/36 Attributes (RTVS36A)
command in, 168trunning procedures in, 441sorting files with #GSORT in, 469–470, 470work file creation/deletion in, 463, 463
S/38 code, 1, 279, 427–438
490
Index
commands in, changes to AS/400, 429,429–433t
converting to i5/iSeries from, 438environment of, 437–438, 437new AS/400 commands vs., 433, 433–435tobjects/object types in, 427–428obsolete commands in, 429qualified names in, 428, 428system values in, 435–437, 435–436t
Save Library List (SAVLIBL) command,345–348, 345–348
SAVLIBL. See Save Library List (SAVLIBL)command
SBMJOB. See Submit Job (SBMJOB)command, 192
scan for patterns using QCLSCAN API,231–233, 231–232t, 232–233
scheduler program, using RTVSYSVALcommand, 159–160, 160
security, 2, 239–246adopting authority in, 241–244Change Object owner (CHGOBJOWN)
command in, 241command lines and, 244–246Edit Object Authority (EDTOBJAUT)
command in, 240, 241Grant Object Authority (GRTOBJAUT)
command in, 240objects and, securing, 240ownership, authority, and, 241*PGM object and, 239–241*PUBLIC and, 241Revoke Object Authority (RVKOBJAUT)
command in, 240, 241SELECT command, 68, 68selective prompting, 221–228
common mistakes in, 222–224, 223–224control characters for, 224–226, 225tfunction keys and, 222–224, 223–224Monitor Message (MONMSG) and, 224QCMDCHK API for, 226–228, 226–227QCMDEXC API for, 228–230, 229question mark used in, 221, 221Send Message (SNDMSG) command
example of, 222, 222
self-submitting (to batch) programs and CALLcommand, 217–219, 217, 218
Send Break Message (SNDBRKMSG)command, 121
Send File (SNDF) command, 174–175, 174Send Message (SNDMSG), 120–121, 192
selective prompting and, 222, 222, 222Send Program Message (SNDPGMMSG)
command, 91–97, 92interprogram/module communication using,
142–143, 142Send Reply (SNDRPY) command, 119–120, 120Send Status Message (SNDSTSMSG)
command, 298–299, 299–300Send to Data Queue (SNDDTAQ) command,
350–351, 350–352Send User Message (SNDUSRMSG) command,
98–100, 100Send/Receive File (SNDRCVF) command, 170,
174–175, 174separator characters, in CVTDAT/dates, 56–57tSET CAPS OFF/ON command, 15, 15SEU. See Source Entry Utilityseverity levels of messages, 90, 90tshortcuts. See programming aids/shortcutssign-on programs, 247–255
Change Job Description (CHGJOD)command in, 248
Change User Profile (CHGUSRPRF)command in, 248
Create Job Description (CRTJOBD)command and, 248
INLPGM attribute and, 247job descriptions and, 248–249, 248parameters forbidden in, 247sample of, 249–255, 249–255, 413–415writing, 247
SNDBRKMSG. See Send Break Message(SNDBRKMSG) command
SNDDTAQ. See Send to Data Queue(SNDDTAQ) command
SNDF. See Send File (SNDF) commandSNDMSG. See Send Message (SNDMSG)SNDPGMMSG. See Send Program Message
(SNDPGMMSG) command
NOTE: Boldface indicates illustrations and code; t indicates a table. 491
Index
SNDRCVF. See Send/Receive File (SNDRCVF)
SNDRPY. See Send Reply (SNDRPY)
SNDSTSMSG. See Send Status Message(SNDSTSMSG) command
SNDUSRMSG. See Send User Message(SNDUSRMSG) command
sort files with Open Query File (OPNQRYF),180–182, 181, 193, 193
sorting files
Format Data (FMTDTA) command in, 469–470
#GSORT for, 469–470, 470Open Query File (OPNQRYF) command in,
469–470, 470source code, 1–18. See also CL coding style;
programming aids/shortcuts
blank lines in, 20–21
command-level (global) MONMSG in, 104, 104comment lines in, 21–23, 21, 22, 23continuing to next line, 17–18, 18converting S/38 to i5/iSeries from, 438
editors for, 410–411
formatting statements in, using F4, 11–15,11, 13, 14, 18
indentation in, 18
obsolete commands in, 429
physical files for, 10
program-level (global) MONMSG in,103–104, 103
QCLSRC physical file in, 10
Retrieve CL Source (RTVCLSRC) commandin, 237–238
S/36, updating of, 439–470
S/38 vs. i5, 427–438
starting SEU with STRSEU for, 10–11, 11uppercase/lowercase in, 15, 15variables and, clarity of, 34–36, 34, 35
Source Entry Utility (SEU), 1–18. See alsosource code
command prompter in, 386–387, 386–387Source view debug session, 262–266, 262–266specific vs. generic monitoring, 105–106, 105
spool filesCopy Spooled File (CPYSPLF) command in,
186Delete Spooled File (DLTSPLF) command
in, 187%SST. See substring function
(%SST/%SUBSTRING), 47stack for subroutines, 75–76, 76Start Debug (STRDBG) command, 257–258,
417–419Start PDM (PDM) command, 305–306,
305–308Start Service Job (STRSRVJOB) command,
273, 275Start SEU (STRSEU) command, 10–11, 11Statement view debugging, 269–270, 270status messages, 87tStep Through (STEP) command, 267storage management
data areas in, 137–139Reclaim Resources (RCLRSC) command in,
236–237STRDBG. See Start Debug (STRDBG)
commandstring manipulation
"E variable and, 192–193, 193character strings and, quotes in, 191–192command strings and, quotes in, 191–192concatenation (*CAT/BCAT/TCAT) in,
49–50, 49t, 50embedded quotes in, 190–191, 191expressions in, 191–192overlaid variables as alternative to, 48–49, 49quotes used in, 190–193, 190substring function for, 47–48, 47, 48
STRSEU. See Start SEU (STRSEU) commandSTRSRVJOB. See Start Service Job
(STRSRVJOB) commandsubfiles, message, 125–133, 126–128Submit Job (SBMJOB) command, 192,
210–215, 212Call (CALL) command and, 213–215, 213,
214, 215problems with, 212–215, 212, 213, 214, 215
SUBR. See Subroutine (SUBR) command
492
Index
Subroutine (SUBR) command, 73–75subroutines, 73–76
Call Subroutine (CALLSUBR) command in,74, 74
Declare Processing Option (DCLPRCOPT)command and stack for, 76, 76
Dump CL Program (DMPCLPGRM)command and, 76
End Subroutine (ENDSUBR) command for,73–75
stack for, 75–76, 76Subroutine (SUBR) command for, 73–75syntax of, 73–75, 74, 75
substitution expressions, S/36, 441–446,441–446
substring function (%SST/%SUBSTRING),47–48, 47, 48
%SUBSTRING. See substring function(%SST/%SUBSTRING)
subsystem managementCreate Subsystem Description (CRTSBSD)
command in, 202Work with Subsystem Job (WRKSBSJOB)
command in, 216, 217switches, 133, 139–142
Change Job (CHGJOB) command and, 140, 140Display Job (DSPJOB) command and, 140on/off, 140, 140Retrieve Job Attributes (RTVJOBA)
command and, 140–141, 141%SWITCH function for, 141, 141testing, 140–141, 141
%SWITCH function, 141, 141System 36. See S/36System i, 1system reply list, 124–125system values
Change System Value (CHGSYSVAL)command in, 162, 162
job management and, 159–162list of, 160, 161–162tRetrieve System Value (RTVSSVAL)
command in, 159, 168tS/38 vs. AS/400, 435–437, 435–436t
Work with System Values (WRKSYSVAL)command and, 293–294, 293
System/38. See S/38
Ttable management
Create Table (CRTTBL) command in, 234translation table QSYSTRNTBL in, 234
temporary files, 182. See also QTEMPTFRCTL. See Transfer Control (TFRCTL)THEN, 65TOPGMQ parameter, defining message
recipients, 92–95, 93t, 93, 94, 99TOUSR parameter, defining message recipients,
95, 99trace
Add Trace (ADDTRC) in, 422–423Clear Trace Data (CLRTRCDTA) in, 422Display Trace (DSPTRC) in, 422–423Display Trace Data (DSPTRCDTA) in, 422Remove Trace (RMVTRC) in, 422–423
Transfer Control (TFRCTL) command, 80–81,80, 134, 136
translate (TRNTBL) parameter, 99–100translate characters using QDCXLATE API,
233, 234translation table QSYSTRNTBL, 234TRUE/FALSE logical statements, 61, 61TYPE parameter, 8
Uuppercase/lowercase, 14, 15, 15
identifiers in lowercase in, 402, 402–405translate using QDCXLATE API, 233, 234translation table QSYSTRNTBL for, 234
user profiles, 165–166change group profile of all, 185, 185Change Profile (CHGPRF) command in, 166Change User Profile (CHGUSRPRF)
command in, 166, 245, 248Display User Profiles (DSPUSRPRF) in, 186Retrieve User Profile (RTVUSRPRF)
command in, 9, 165–166, 166, 168tuses for CL, 1–2
NOTE: Boldface indicates illustrations and code; t indicates a table. 493
Index
utility commands, 154–155, 293–383data queues and, 349–364installing, 293library for, 293message management, 294–304programming aid, 304–338programming shortcuts in, 338–349Work with System Values (WRKSYSVAL)
command and, 293–294, 293
VVALUE parameter, 8VAR parameter, 8variables, 30–41
arrays and, simulating, 51based, 41, 41binary conversion (%BIN/BINARY) in,
51–53, 52, 53Change Program Variables (CHGPGMVAR)
in, 421Change Variable (CHGVAR) command for, 14,
40, 43–45, 44, 45, 175, 190, 468–469, 469coding of, striving for clarity in, 34–36, 34, 35declaring, using DCL command, 30–33Display Program Variables (DSPPGMVAR)
command in, 421expressions using, 54–55floating point data and, 78length (LEN) parameter of, 32–33, 33, 33tlogical type, 53–54, 54logical, 59–61, 60, 61t, 61names for, 31t, 32toverlaid/overlaying, 39, 39, 48–49, 49parameters as, 38–39parameters using, 134–135passed as parameters, 77–78, 78passing constants as, 78–79pointer, 40, 40, 41scan for patterns in, using QCLSCAN API,
231–233, 231–232t, 232–233translate characters in, using QDCXLATE
API, 233, 234types of, 30where used, 36–38
views, in debugging, 258–259
WWait (WAIT) command, 170, 171–172Watch (WATCH) command, 267WHEN command, 68Work (WRKxxx) commands, command line
security and, 244–246work files (permanent), 182–184, 183work management, 2Work with Active Job (WRKACTJOB)
command, 217Work with Job Queue (WRKOBJQ) command, 215Work with Members Using PDM
(WRKMBRPDM), 10Work with Message Descriptions (WRKMSGD)
command, 89Work with Messages (WRKMSG) command,
122–123, 122Work with Object Locks (WRKOBJLCK)
command, 207Work with Submitted Jobs (WRKSBMJOB)
command, 215–216, 217Work with Subsystem Job (WRKSBSJOB)
command, 216, 217Work with System Values (WRKSYSVAL)
command, 293–294, 293Work with User Jobs (WRKUSRJOB)
command, 215WRKACTJOB. See Work with Active Job
(WRKACTJOB) commandWRKMBRPDM. See Work with Members
Using PDM (WRKMBRPDM)WRKMSG. See Work with Messages
(WRKMSG) commandWRKMSGD. See Work with Message
Descriptions (WRKMSGD) commandWRKOBJLCK. See Work with Object Locks
(WRKOBJLCK) commandWRKOBJQ. See Work with Job Queue
(WRKOBJQ) commandWRKSBMJOB. See Work with Submitted Jobs
(WRKSBMJOB) commandWRKSBSJOB. See Work with Subsystem Job
(WRKSBSJOB) commandWRKUSRJOB. See Work with User Jobs
(WRKUSRJOB) command
494
Index