Retrieving a File Description to a User Space—Examples
This section includes the examples in “Retrieving a File Description to a User
Space—ILE C Example” on page A-11.
Retrieving a File Description to a User Space—ILE COBOL Example
Refer to “Retrieving a File Description to a User Space—ILE C Example” on
page A-11 for the original example. The following program also works with OPM
COBOL.
IDENTIFICATION DIVISION.
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍ
ᑍ Program: RTVFD
ᑍ
ᑍ Language: COBOL
ᑍ
ᑍ Description: This program retrieves a file definition
ᑍ template to a user space.
ᑍ
ᑍ APIs Used: QDBRTVFD - Retrieve File Description
ᑍ QUSCRTUS - Create User Space
ᑍ QUSCUSAT - Change User Space Attributes
ᑍ QUSPTRUS - Retrieve a pointer to a User Space
ᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
PROGRAM-ID. RTVFD.
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 first
ᑍ 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 physically
ᑍ copy the QSYSINC include and modify the copied include to
ᑍ define additional storage for the exception data.
ᑍ
COPY QUSEC OF QSYSINC-QLBLSRC.
ᑍ
ᑍ Misc. elements
ᑍ
1 MISC.
5 EXIT-POINT-NAME PIC X(2) VALUE "EXAMPLE_EXIT_POINT".
5 EXIT-PGM-NBR PIC S9(9) VALUE -1 BINARY.
5 EXIT-PARAMETERS PIC X(1).
5 FILE-USED PIC X(2).
5 LIBRARY-NAME PIC X(1).
5 SPACE-SIZE PIC S9(9) BINARY.
5 SPACE-INIT PIC X(1) VALUE "X''".
5 SPACE-POINTER POINTER.
B-152 System API Programming V4R1