5 FORMAT-NAME-1 PIC X(8).
5 OVERRIDES PIC X(1) VALUE "".
5 SYSTEM PIC X(1) VALUE "ᑍLCL".
5 FORMAT-1 PIC X(1) VALUE "ᑍINT".
5 EXT-ATTR PIC X(1).
5 SPACE-AUT PIC X(1) VALUE "ᑍCHANGE".
5 SPACE-TEXT PIC X(5) VALUE "QDBRTVFD".
5 SPACE-REPLACE PIC X(1) VALUE "ᑍYES".
5 SPACE-DOMAIN PIC X(1) VALUE "ᑍUSER".
5 API-NAME PIC X(1).
1 CHG-US-ATTR.
5 NBR-OF-ATTR PIC S9(9) VALUE 1 BINARY.
5 ATTR-KEY PIC S9(9) VALUE 3 BINARY.
5 DATA-SIZE PIC S9(9) VALUE 1 BINARY.
5 ATTR-DATA PIC X(1) VALUE "1".
ᑍ
LINKAGE SECTION.
1 SPACE-NAME PIC X(2).
1 FILE-NAME PIC X(2).
1 FORMAT-NAME-PARM PIC X(1).
ᑍ
ᑍ Retrieve File Description API include.
ᑍ
COPY QDBRTVFD OF QSYSINC-QLBLSRC.
ᑍ
ᑍ Beginning of mainline
ᑍ
PROCEDURE DIVISION USING SPACE-NAME, FILE-NAME,
FORMAT-NAME-PARM.
MAIN-LINE.
ᑍ
PERFORM INITIALIZE-SPACE.
PERFORM PROCESS-SPACE.
PERFORM PROGRAM-DONE.
ᑍ
ᑍ Start of subroutines
ᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
PROCESS-SPACE.
ᑍ
ᑍ The template returned from QDBRTVFD is now addressable by way
ᑍ of SPACE-POINTER; as an example the program will now display
ᑍ the access method for the file:
ᑍ
DISPLAY QDBFPACT OF QDB-QDBFH.
ᑍ
ᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍᑍ
ᑍ
INITIALIZE-SPACE.
ᑍ
ᑍ One time initialization code for this program
ᑍ
ᑍ Set Error Code structure to not use exceptions
ᑍ
MOVE 16 TO BYTES-PROVIDED OF QUS-EC.
ᑍ
ᑍ Create a User Space for QDBRTVFD
ᑍ
Appendix B. Original Examples in Additional Languages B-153