Appendix

B.

Original

Examples

in

Additional

Languages

 

 

This appendix

contains examples from the following areas

of this book. The program exa

appendix

are

rewritten from

the

original examples into

other programming

languages.

Ÿ

Chapter 3,

“Common

Information

across APIs—Basic (OPM) Example”

 

Ÿ

Chapter 4,

“Common Information across APIs—Advanced (ILE)

Example”

 

Ÿ

Chapter 5,

“List APIs”

 

 

 

 

 

Ÿ

Chapter 6,

“Original Program Model

(OPM) and

Integrated

Language Environment

(ILE) Differ

ŸAppendix A, “Performing Tasks Using APIs—Examples”

This appendix also contains examples

written

in

 

ILE

C,

ILE

COBOL, and

ILE RPG for using

file system.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The following tables describe the example tasks

and refer you to the corresponding

guage

topic. In

theseYes tables,means

the

task can be

accomplished in the language identifi

example is not providedNo means. the task cannot

be

accomplished in the language identifie

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure

B-1. Original

Program

Model

 

(OPM) API

Examples

from

Chapter

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Programming

Language

and

Location

of

Example

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Task

 

 

 

 

 

 

 

 

 

 

 

ILE C

OPM

COBOL

 

 

 

ILE

COBOL

 

 

OPM

RPG

 

ILE

RPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Retrieving the HOLD Parameter (ExceptionB-2

 

B-4

 

 

 

 

B-4

 

 

 

3-6

 

 

B-6

 

Messages)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Handling

Error Conditions

 

 

 

 

 

 

No

 

No

 

 

 

 

No

 

 

 

3-8

 

 

B-8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Retrieving the HOLD Parameter (Error BCode-10

 

B-12

 

 

 

B-12

 

 

3-11

 

 

B-14

 

Structure)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Accessing the HOLD

Attribute

 

 

 

 

B-16

 

B-18

 

 

 

 

B-18

 

 

3-17

 

 

B-21

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Accessing a Field Value (Initial LibraryB-22

List)

B-25

 

 

 

 

B-25

 

 

 

3-19

 

 

B-29

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Using Keys with List Spooled Files APIB-33

 

B-38

 

 

 

 

B-38

 

 

 

3-24

 

 

B-42

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure

B-2. Integrated

Language

Environment

(ILE)

API

 

Examples

 

from

Chapter 4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Programming

Language

and

Location

of

Example

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Task

 

 

 

 

 

 

 

 

 

 

 

ILE C

OPM

COBOL

 

 

 

ILE

COBOL

 

 

OPM

RPG

 

ILE

RPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Register Exit Point and Add Exit

Program4-9

 

B-47

 

 

 

 

B-50

 

 

 

B-54

 

 

B-58

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Retrieve Exit

Point

and

Exit

Program

 

Informa4-13

-

B-61

 

 

 

 

B-66

 

 

 

B-71

 

 

B-75

 

tion

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Remove

Exit

Program

and

Deregister

 

Exit4-19

 

B-85

 

 

 

 

B-87

 

 

 

B-90

 

 

B-92

 

Point

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure

B-3. List API

Examples

from

Chapter

5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Programming

Language

and

Location

of

Example

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Task

 

 

 

 

 

 

 

 

 

 

 

ILE C

OPM

COBOL

 

 

 

ILE

COBOL

 

 

OPM

RPG

 

ILE

RPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Listing

Objects

 

 

 

 

 

 

 

 

 

B-94

 

B-101

 

 

 

B-101

 

 

5-4

 

B-106

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure

B-4

(Page

 

1

of

2).

Pointer API Examples from Chapter 6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Programming

Language

and

Location

of

Example

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Task

 

 

 

 

 

 

 

 

 

 

 

ILE C

OPM

COBOL

 

 

 

ILE

COBOL

 

 

OPM

RPG

 

ILE

RPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Logging

Software

Error

(OPM

API without 6-2

 

B-112

 

 

 

N/A

 

 

 

B-116

 

B-119

 

Pointers)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright

IBM

Corp.

1997

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B-1

Page 279
Image 279
IBM Version 4 manual Appendix, Additional Languages