IBM Version 4 manual System APIs or CL Commands-When Use, Functions, Cobol ILE RPG

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 19
Image 19

ŸYour application is more straightforward if you are coding in a

 

guage

other than

CL,

which is

not

a

fully

defined

language

(it

d

 

the

full

capabilities

of

a

high-level

language). For

example,

you

ma

 

code

 

separate

CL

programs

to

perform

specific

functions.

 

 

 

 

Ÿ

You

can

access system

information

and

functions

that

are

not

availa

 

CL

commands.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ÿ

Data

is

often

easier

 

to

work

with when returned to

you

by

an

A

Ÿ

At

times,

you

may

need

access

to

system

functions

at

a

lower

 

le

 

was initially provided on the AS/400 system. APIs and

a

set of

doc

 

machine interface (MI) instructions are available to

allow

the

exp

 

grammer

access

to

these

system

functions.

 

 

 

 

 

 

 

 

System APIs or CL Commands—When

 

to

Use

Each

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Before

system

APIs were offered on the AS/400,

 

you

had

to

either

CL

programs

to

perform

the

needed

functions

using

the

appropriate

 

CL

or code a call to the Execute Command

(QCMDEXC)

API

in

your

program. B

methods made coding an application on the AS/400 more cumbersome (less

straightforward

and

not

as fast as possible).

 

 

 

 

 

 

 

 

 

CL

commands

will

always be

needed;

they

are

ideal

for

the

interacti

CL applications that are performing basic tasks. They provide a comple

functions

on

the

AS/400

system.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

APIs

are

not

 

provided

as

 

a replacement

for

CL

commands,

although

in

m

there

may

be

 

both

an

API

and

a

CL

command

that

perform

the

same

f

CL

command

and

an API provide the same

function,

at

times

the

API

pr

more flexibility and information. The CL command is intended to be ente

interactively

or

in

a

CL

program,

and

the API is

designed

as a

prog

face.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Some APIs

have

no equivalent CL command. These APIs have been provided

areas

where

 

customers

and

business

 

partners

have

 

indicated that

the

level

language

(HLL)

access.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Actions and System

Functions

of

APIs

 

An

API

can

be categorized by the type of action it performs and

function that it relates to.

 

Following

are

some of the types of

APIs that perform actions; severa

these

APIs

are

discussed in more

detail in later chapters of this

ŸList APIs, which return lists of information about something on the

 

Refer

to

“List

Object

API—Examples” on

page B-94

for an example

of

 

API

in

both ILE

COBOL

and

ILE RPG.

 

 

 

 

Ÿ

Retrieve

APIs,

which

return information

to the application

program.

Ÿ

Create,

change,

and

delete

APIs, which

work with

objects

of a

s

 

on

the

system.

 

 

 

 

 

 

 

 

ŸOther APIs, which perform a variety of actions on the system.

While many APIs are used alone,

some

can

be used together to perf

function. The following is a list

of a

few functions:

Chapter 1.

Application

Programming Interface—1Overview-3

Page 19
Image 19
IBM Version 4 manual System APIs or CL Commands-When Use, Functions, Cobol ILE RPG