9.143 MAKE_FILE_OPERATIONL

Note: Built-In Function Rules     Usage Options

Submits a job to create or recreate a file plus associated logical files and I/O module.

This is a Specialized Built-In Function for use in a Development Environment only.

Arguments for Visual LANSA

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

File name

1

10

 

 

2

A

Req

Library name

1

10

 

 

3

A

Opt

Recreate options if file is already created

Byte 1:
Y = rebuild the table and save data
N = do not rebuild the table
Default: Y

Byte 2:
Y = rebuild indexes/views
N = do not rebuild indexes/views
Default: Y

Byte 3:
Y = rebuild OAM
N = do not rebuild OAM
Default: Y

1

3

 

 

4

A

Opt

Name of job

Ignored

1

10

 

 

5

A

Opt

Name of job description

Ignored

1

21

 

 

6

A

Opt

Name of job queue

Ignored

1

21

 

 

7

A

Opt

Name of output queue

Ignored

1

21

 

 

8

A

Opt

Produce file and I/O module source listings ?

Y = keep source
N = do not keep source

1

1

 

 

9

A

Opt

Ignore decimal data error in associated I/O module?

Ignored

1

1

 

 

10

A

Opt

Strip debug data options in associated I/O module?

Ignored

1

1

 

 

11

A

Opt

User program to call

Ignored

1

21

 

 

12

A

Opt

Delete $$ File? (Used for Keep Saved Data)

Y = Keep saved data.

N = Do not keep saved data.

Default: N

1

1

 

 

 

Arguments for LANSA for i

For further information, refer to Create/Recreate a file from its definition screen in Submitting Job to Make File Definition Operational in the LANSA for i User Guide.

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

File name

1

10

 

 

2

A

Req

Library name

1

10

 

 

3

A

Opt

Recreate options if file is already created

Byte 1:
Y = recreate the table
N = do not recreate the table
Default: Y

Byte 2:
Y = recreate indexes
N = do not recreate indexes
Default: Y

Byte 3:
Y = rebuild OAM
N = do not rebuild OAM
Default: Y

1

3

 

 

4

A

Opt

Name of batch job

Default: File name

1

10

 

 

5

A

Opt

Name of job description

Default: the job description from the requesting job's attributes.

1

21

 

 

6

A

Opt

Name of job queue

Default: the job queue from the requesting job's attributes.

1

21

 

 

7

A

Opt

Name of output queue

Default: the output queue from the requesting job's attributes.

1

21

 

 

8

A

Opt

Produce file and I/O module source listings ?

Y = produce listings

N = do not produce listings

Default N (do not produce listings)

1

1

 

 

9

A

Opt

Ignore decimal data error in associated I/O module?

Y = ignore decimal data errors

N = do not ignore errors

Default: N (do not ignore errors)

1

1

 

 

10

A

Opt

Strip debug data options in associated I/O module?

Y = debugging information should be stripped.

N = debugging information should not be stripped.

Default: Y (debugging information should be stripped)

1

1

 

 

11

A

Opt

User program to call Default: Blank

1

21

 

 

12

A

Opt

Delete $$ File?

Y = $$ version of file should be deleted.

N = $$ version of file should not be deleted.

Default: N ($$ version of file should not be deleted)

1

1

 

 

 

Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Return code

OK = successful submission

ER = argument details are invalid or an authority problem has occurred.

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

2

2

 

 

 

Example

A user wants to control the compilation of files and associated logical views and I/O module using their own version of the "Create / Re-Create a File" facility.

FUNCTION  OPTIONS(*DIRECT)

********** Define arguments and lists

DEFINE    FIELD(#FILNAM) TYPE(*CHAR) LENGTH(010)

DEFINE    FIELD(#LIBNAM) TYPE(*CHAR) LENGTH(010)

DEFINE    FIELD(#RETCOD) TYPE(*CHAR) LENGTH(002)

BEGIN_LOOP

********** Request File and library name

REQUEST   FIELDS((#FILNAM)(#LIBNAM))

USE       BUILTIN(START_FILE_EDIT) WITH_ARGS(#FILNAM #LIBNAM LAN 'SALES RESULTS' NORMAL) TO_GET(#RETCOD)

USE       BUILTIN(END_FILE_EDIT) WITH_ARGS(Y) TO_GET(#RETCOD)

********** Execute Built-In Function - MAKE_FILE_OPERATIONL

USE       BUILTIN(MAKE_FILE_OPERATIONL) WITH_ARGS(#FILNAM #LIBNAM) TO_GET(#RETCOD)

********** Check if submission was successful

IF        COND('#RETCOD *EQ ''OK''')

MESSAGE   MSGTXT('Create/recreate of file submitted successful')

CHANGE    FIELD(#FILNAM) TO(*BLANK)

ELSE     

MESSAGE   MSGTXT('Create/recreate submit failed with errors, refer to additional messages')

ENDIF    

END_LOOP