9 151 LOAD_OTHER_FILE

LANSA Technical

9.151 LOAD_OTHER_FILE

Þ Note: Built-In Function Rules.

Loads the definition of an "OTHER" file.

An edit session must be commenced by using the START_FILE_EDIT Built-In Function, prior to using this Built-In Function.

For use with

LANSA for i

YES

Do not use on IBM i in an RDMLX partition.

Visual LANSA for Windows

NO

 

Visual LANSA for Linux

NO

 

 

 

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

N

Req

Maximum number of logical files to load

Default: 5

1

2

0

0

2

L

Opt

Working list to contain the names of logical files to be loaded. Each logical file name must be 10 bytes.

If this argument is provided, then Argument 1 (Maximum number of logical files to load) must be zero.

100

100

 

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Return code: OK, ER.

In case of "ER" return code, error message(s) are issued automatically.

2

2

 

 

 

 

Example

A user wants to control the load of an "OTHER" file definition using their own version of the 'Load an "OTHER" file' option. A maximum of 2 logicals to load has been specified in this example.

********** Define arguments and lists
DEFINE     FIELD(#FILNAM) TYPE(*CHAR) LENGTH(10)
DEFINE     FIELD(#LIBNAM) TYPE(*CHAR) LENGTH(10)
DEFINE     FIELD(#MAXLOG) TYPE(*DEC) LENGTH(2) DECIMALS(0)
DEFINE     FIELD(#RETCOD) TYPE(*CHAR) LENGTH(2)
BEGIN_LOOP
********** Request File and library name and maximum number of
********** logicals to load
REQUEST    FIELDS(#FILNAM #LIBNAM #MAXLOG)
**********
USE        BUILTIN(START_FILE_EDIT) WITH_ARGS(#FILNAM #LIBNAM 'DEM') TO_GET(#RETCOD)
USE        BUILTIN(LOAD_OTHER_FILE) WITH_ARGS(2) TO_GET(#RETCOD)
USE        BUILTIN(END_FILE_EDIT) WITH_ARGS('Y') TO_GET(#RETCOD)
********** Submit job to make file operational
USE        BUILTIN(MAKE_FILE_OPERATIONL) WITH_ARGS(#FILNAM #LIBNAM) TO_GET(#RETCOD)
**********
END_LOOP