DLG
Link to a AMB program
[TP-]LINK programname [errorpara] ... [DLIUIB pcbname [pcbname] ...] ... [userparm [userparm]...] ... [COMMAREA(dataarea) LENGTH(value)]|[NOCA]
Linking to a non-AMB program
[TP-]LINK programname(NONAPS)[errorpara] ... [COMMAREA(dataarea) ... LENGTH(value)]|[NOCA]
Additionally, code the following before your NTRY statement.
% &TP-PROGRAM-INVOCATION = "NONAPS"
program-name |
Program name; can be a literal, variable, or combination, where the literal is moved to the variable (indicated by a slash (/) as the first character) by rule logic. |
errorpara |
User-defined error routine to perform when an abnormal condition occurs. Errorpara is positional; if omitted, code an asterisk (*) in its place. |
DLIUIB pcbname |
DLI User Interface Block and the Program Control Block for the next program. |
userparm |
Pass linkage data area(s). Code with TP-LINKAGE, which names the 01-level user-defined area in the Linkage Section. |
COMMAREA (dataarea) |
Pass data area to a program instead of TP-COMMAREA. |
LENGTH (value) |
Maximum length of data; can be a literal or COBOL data name; define as S9(04)COMP. |
(NONAPS) |
Program is not a AMB program. |
NOCA |
Do not pass COMMAREA. |
LINK PGM001
LINK /WS-PROGNAME
LINK PGM003/WS-PROGNAME
LINK PGM004 ERROR-PARA
LINK PGM005 * DLIUIB ABC-PCB
LINK PGM006 * SCR6-RECORD
LINK PROG001(NONAPS)
LINK PROG002(NONAPS) * COMMAREA(WS-COMMAREA) ... LENGTH(100)
LINK PROG003(NONAPS) * NOCA
[TP-]LINK subprogram ... [errorpara] ... [argument1 ... argument36]
subprogram |
AMB-painted subprogram that links the calling program. |
errorpara |
User-defined error routine to perform when an abnormal condition occurs. Errorpara is positional; if omitted, code an asterisk (*) in its place. |
argument |
Pass record area(s), such as a PCB. TP-COMMAREA, TP-USERAREA, or *NOSPA, may be an argument for conversational programs. |
The following examples show the CALL statements generated in the program after linking to subprograms.
Coding. . . | Yields. . . |
---|---|
LINK SUBPGM * ARG1 ARG2 ARG3 |
CALL 'SUBPGM' USING TP-COMMAREA ARG1 ARG2 ARG3 |
LINK SUBPGM * *NOSPA ARG1 ARG2 ARG3 |
CALL 'SUBPGM' USING ARG1 ARG2 ARG3 |
LINK SUBPGM * ARG1 ARG2 TP-COMMAREA ARG3 |
CALL 'SUBPGM' USING ARG1 ARG2 TP-COMMAREA ARG3 |
CALL format
[TP-]LINK programname [errorpara] ... [userparm [userparm]...] ... [COMMAREA]
SELECT format
[TP-]LINK programname ... [errorpara] ... [options]
% &DLG-COMMAREA-IN-LINKAGE = 'YES'
program-name |
Program name; can be a literal, variable, or combination, where the literal is moved to the variable (indicated by a slash (/) as the first character) by rule logic. |
errorpara |
User-defined error routine to perform when an abnormal condition occurs. Errorpara is positional; if omitted, code an asterisk (*) in its place. |
userparm |
Pass linkage data area(s). Code with TP-LINKAGE, which names the 01-level user-defined area in the Linkage Section. |
COMMAREA |
Pass the TP-COMMAREA, if the invoking program is the main program. Pass DLG-LINKAGE-COMMAREA, if the invoking program is a called program, that is, one where &DLG-COMMAREA-IN-LINKAGE = 'YES'. |
options |
DLG Management services SELECT PGM options. |
LINK PGM001 * NEWPOOL
DLG-VDEFINE 01 WS-EMPL-NBR PIC X(05) AS EMPNBR MOVE EMPL-NBR TO WS-EMPL-NBR LINK PGM001 * PARM('&EMPNBR') DLG-VDELETE EMPNBR
MOVE 'PGM001' TO WS-PROGRAM LINK /WS-PROGNAME
LINK PGM006 * SCR6-RECORD