Definition Specifications
The definition specifications are for variables and fields, copy statements, and procedure prototype statements.
For subdivisions of data structures, group them, in order, directly below the definition.
All variable and field names used in a program follow strict naming conventions. This lets you more easily determine the source and function of a variable. The type of variable can often be determined by the prefix used as part of the variable name. See the table below:
Prefix | Examples | Description |
---|---|---|
<none> |
PRSNM PQCMPN |
Used in the form definition (xxxxxD.SCRN) and report definition (xxxxxP.PRNT) for the RPG name for a field. This is then used to build the field names in the form definition copybook (xxxxxDSD.SCRN) and the report definition copybook (xxxxxPRD.PRNT). |
D | Used for various database-related fields. (This is the same as the "DB" fields in earlier versions.) | |
D@STATE | D@FieldName is for key variables. | |
D#START#VENDOR D#END#VENDOR | D#START#Name and D#END#Name are for subrange key variables. | |
DCRLFRCRCD | DPrefixFieldname is for the fields. | |
DPSA@NOTFOUND | DPrefix@Name is for such variables as the record found flag. | |
DAGP@C@NAME | DPrefix@C@Name is for comment attachment variables. | |
DAGP@U@TYPE | DPrefix@U@Name is for URL attachment variables. | |
DCRL@AV@CRRTBL | DPrefix@Abbreviation@Name is for database aggregate fields, where Abbreviation can be AV for "average," AG for "aggregate," SU for "sum," MI for "minimum," or MA for "maximum." | |
E U |
E@ERRORMSG |
Used for variables for Environment programs, such as lapm .
|
Fn@ FnFN@ FnND@ FnPT@ FnAF@ |
F1@PQCMPN F1FN@PQCMPN F3@PBBSSL F3FN@PBBSSL F3ND@PBBSSL F2PT@EMPCMP F1AF@MNTB |
Created in the form definition copybook (xxxxxDSD.SCRN) from the form definition (xxxxxD.SCRN) to hold field values and field numbers for the form. "Fn" indicates that it is for field values. "FnFN" indicates that it is for field numbers (so that the cursor can be properly positioned). "FnND" indicates the number of decimals. "FnPT" indicates protected fields. "FnAF" is a field that can be used to control the status (such as protected or in focus) of a form tab. The number (n) indicates which screen or form the field belongs to. The remaining characters are the RPG name for the field from the form definition. |
G | GOTO G1@ADT | Tag for GOTO in a program. |
H | Tag for the end of a procedure in a program. | |
IPgmcodeScreenNbr@ | IACAC1@EMPLY | Used for variable/field names in the DSDC interface source files. |
J | GOTO JACCEDT@NXACGR | Tag for GOTO in a library. |
K | Tag for the end of a procedure in a library. | |
L | LFNDVL (Find Value) | Used for library procedure. |
OPrefix@ | OG2@EMPRSL | Used for fields in reports that contain the number of decimals for another field. The prefix is defined by the $PREFIX lines in the report. |
PPgmcodeWS@ PWSFilePrefix# |
PPA01WS@USAUTH PWSPCM#COUNT |
Used for variables within an application program. |
Q | Reserved for non-Lawson use. | |
RPrefix@ | RR1G1@CMPNY | Created in the report definition copybook (xxxxxPRD.PRNT) from the report definition (xxxxxP.PRNT) to hold field values. The prefix is defined by the $PREFIX lines in the report. |
S | S1@EDTTRN | Use for program procedures (previously, subroutines). |
T | T@1@12@2 |
Used for temporary variables: T@number@size for alpha variables. T@number@size@Decimals for numeric variables. |
U | U@PRT@CLOSE | Used for Environment procedures and variables. |
V | VACMKWS@OBJTYP | Used for variable names in procedure and working storage (program variable) copybooks for applications. |
WPrefix |
WHPACMPNY WDD@EMPLY |
Used for work file variable/field names. (If the file prefix is only two characters, the @ character is appended to it.) |
X, Y, Z | Reserved for non-Lawson use. |
Definition Specifications Example
The following example shows a portion of the definition specifications for PA01.
From PA01WS.COPYPGM:
D PPA01WS@TOTALS DS EXPORT
D PPA01WS@TTBDHD 5S 0 INZ
D PPA01WS@TTBDFT 8S 3 INZ
D PPA01WS@TTATHD 5S 0 INZ
D PPA01WS@TTATFT 8S 3 INZ
D PPA01WS@TTASHD 5S 0 INZ
D PPA01WS@TTASFT 8S 3 INZ
D PPA01WS@TTVRHD 5S 0 INZ
D PPA01WS@TTVRFT 8S 3 INZ
D PPA01WS@TTBDSL 11S 2 INZ
D PPA01WS@TTATSL 11S 2 INZ
.
.
.
From PA01.COPYPGM
D/COPY /DELMID9/apps/rpg/COMRPGSRC/lawsond.copyile
D/COPY /DELMID9/apps/rpg/COMPROSRC/iseries.rpgleproto
D/COPY /DELMID9/apps/rpg/COMPROSRC/begin17.rpgleproto
D/COPY /DELMID9/apps/rpg/COMPROSRC/common.rpgleproto
D/COPY /DELMID9/apps/rpg/COMPROSRC/crtws.rpgleproto
D/COPY /DELMID9/apps/rpg/COMPROSRC/database.rpgleproto
D/COPY /DELMID9/apps/rpg/COMPROSRC/filterd.rpgleproto
D/COPY /DELMID9/apps/rpg/COMPROSRC/filterp.rpgleproto
D/COPY /DELMID9/apps/lawapp9/rpg/parpg/PARPGSRC/PA01WS.COPYPGM
D/COPY /DELMID9/apps/lawapp9/rpg/parpg/PARPGSRC/PA01DSD.SCRN
D/COPY /DELMID9/apps/lawapp9/rpg/ifrpg/IFRPGSRC/IFCUDSDC.SCRN
D/COPY /DELMID9/apps/rpg/COMPROSRC/invoked.rpgleproto
D/COPY /DELMID9/apps/rpg/COMPROSRC/datews.rpgleproto
D/COPY /DELMID9/apps/rpg/COMPROSRC/calws.rpgleproto
D/COPY /DELMID9/apps/lawapp9/rpg/ifrpg/IFLIBSRC/EDCC60WS.COPYILE
D/COPY /DELMID9/apps/lawapp9/rpg/parpg/PALIBSRC/PAAT71WS.COPYILE
D/COPY /DELMID9/apps/lawapp9/rpg/parpg/PALIBSRC/PAPAB71WS.COPYILE
D/COPY /DELMID9/apps/lawapp9/rpg/parpg/PALIBSRC/PAPOS71WS.COPYILE
D/COPY /DELMID9/apps/lawapp9/rpg/parpg/PALIBSRC/PAPPR71WS.COPYI.
.
.
From PA01.COPYPGM
D S1@TRANSACT PR
D S1@EDTTRN PR
D S1@EDTACC PR
D S1@EDTDT PR
D S1@EDDTTR PR
D S1@EDDTDT PR
D S1@PRCTRN PR
D S1@A410 PR
D S1@C420 PR
D S1@L422 PR
D S1@D440 PR
D S1@I480 PR
D S1@MVSC PR
D S1@MVDTSC PR
D S1@CLCLCN PR
D S1@MVDT PR
D S1@MVDTDT PR
D S1@SCRXFR PR
D S2@TRANSACT PR