IBM AS/400 manual Valid Keys for a Record, File, Disk

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 309
Image 309

 

 

 

 

 

 

 

 

 

 

 

 

 

Using

Externally

 

Described

Disk

Files

 

 

 

 

 

 

 

 

 

 

RPG program, an edit code must be specified for the field

 

 

 

specifications.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.2/

 

 

The

 

CHECK(MF)

entry

specifies

that the field is a mandatory f

 

 

 

when

it

is

entered

from

a

display

work

 

station.

Mandatory

 

fi

 

 

 

all

characters for

the

field

must be

entered

from

the

dis

.3/

 

 

The

 

ADDR

and

CITY

fields share

 

the

same

attributes

that

 

ar

 

 

 

for

the

NAME field, as indicated by the REFFLD keyword.

 

 

 

.4/

 

 

The

 

RANGE

keyword,

which

is

specified for the CUSTYP field,

 

 

 

that the only valid numbers

that can be entered into this f

 

 

 

display

work

station

are

1

through

5.

 

 

 

 

 

 

 

 

 

 

 

.5/

 

 

The

 

COLHDG

keyword

provides

a column head for the field if

 

 

 

by

 

the

Interactive Database Utilities (IDU).

 

 

 

 

 

 

.6/

 

 

The

 

ARBAL field

is

edited

by

the

J

edit

code,

as

indica

 

 

 

keyword

EDTCDE(J).

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.7/

 

 

A

text

 

description

(TEXT

keyword)

is

provided

for

 

some

field

 

 

 

TEXT keyword is used for documentation purposes

 

and

appears

 

 

 

 

various

 

listings.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Valid Keys for a Record

or

File

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

For a keyed-sequence

access

path,

you

 

can

define

one

or

more

fiel

to

be

used

as

the

key

fields

for

a

 

record

format.

(However,

var

cannot

be used

as

key

fields

in

an RPG program.) All record

types

i

have

to

have

the

same

key

fields.

For

 

example,

an

order

header

re

the

ORDER

field

defined as the key field, and the

 

order

detail

ORDER

and

LINE

fields

defined

as

the

key

fields.

 

 

 

 

 

 

 

 

 

The

 

key

for

a

file

is

determined

by

the

valid

keys

 

for

the

reco

The

 

file’s

key

 

is

determined

in

the

following manner:

 

 

 

 

 

 

 

 

 

¹

If

all

record

types

in

a

file

have the same number of key fi

 

DDS

that

 

are

identical in attributes,key for thetheconsfilests of

all

fields

in

 

 

the

key

 

for

the record types. (The corresponding

 

fields

do

not

 

same name.) For example, if the

file has three record types and

 

each

record

type consists of fields A,

B,

and

C,

 

the

file’s

key

 

A,

 

B,

and

C.

That

is,

the

file’s

key

is

the

same

 

as

 

the

record

¹If all record types in the file do not have the same key fie

consists of the keycommonfieldsto all record types. For example, a file three record types and the key fields are defined as follows:

– REC1 contains key field A.

– REC2 contains key fields A and B.

– REC3 contains key fields A, B, and C.

The file’s key is field A–the key field common to all record typ

¹ If

no

key

field

is

common to

all

record

types, there

is

no key

In

an

ILE

RPG

program,

you

can

specify

a

search

argument

on

certai

tion

codes

to

identify

the record you want to process.

The

ILE

RP

pares the search argument with the key of

the

file

or record, an

specified

operation

on

the

record

whose

key matches

the

search

ar

Chapter 16. Accessing Database 285Files

Page 309
Image 309
IBM AS/400 manual Valid Keys for a Record, File, Disk