Retrieving

a

File

Description

to

a

User

Space—Examples

 

 

 

 

 

This section includes the examples in “Retrieving a File

Description

to

 

 

 

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”

 

 

 

page A-11

for

the

original example. The following program

also works

with

 

 

 

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 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.

\

\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-152System API Programming V4R1

Page 430
Image 430
IBM Version 4 manual Space-Examples, Space-ILE Cobol Example, File-Used Pic, Space-Init Pic, SPACE-POINTER Pointer