Retrieving the Hold Parameter (Error Code Structure)—ILE COBOL

Example

Refer to “Retrieving the Hold Parameter (Error Code Structure)—OPM RPG Example” on page 3-11 for the original example. The following program also for OPM COBOL.

IDENTIFICATION DIVISION.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\

\Program Name:

JOBDAPI

\

 

\Programming Language:

COBOL

\

 

\Description:

This example shows how to make use of an

\

error returned in the error code

\

structure.

\

 

\Header Files Included: QUSEC - Error Code Parameter

\

QWDRJOBD - Retrieve Job Description API

\

 

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

\

PROGRAM-ID. JOBDAPI.

\

ENVIRONMENT DIVISION.

CONFIGURATION SECTION. SOURCE-COMPUTER. IBM-AS4ðð. OBJECT-COMPUTER. IBM-AS4ðð.

\

DATA DIVISION. WORKING-STORAGE SECTION.

\

\Error Code parameter include. As this sample program

\uses COPY to include the error code structure, only the fi￿rst

\16 bytes of the error code structure are available. If the

\application program needs to access the variable length￿

\exception data for the error, the developer should physic￿ally

\copy the QSYSINC include and modify the copied include to￿

\define additional storage for the exception data.

\

COPY QUSEC OF QSYSINC-QLBLSRC. .14/

\

\Retrieve Job Description API Include

COPY QWDRJOBD OF QSYSINC-QLBLSRC.

\Command String Data Structure

\

ð1 COMMAND-STRING.

ð5 TEXT1 PIC X(26) VALUE 'SNDMSG MSG(''HOLD value is'. ð5 HOLD PIC X(1ð).

ð5 TEXT2 PIC X(15) VALUE ''') TOUSR(QPGMR)'.

\

\Message Identifier Data Structure

B-12System API Programming V4R1

Page 290
Image 290
IBM Version 4 manual Identification Division