9.54 DLT_FILE

Note: Built-In Function Rules     Usage Options

Submits a job to delete a file and its 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. In Visual LANSA blanks are valid for backward compatibility.

1

10

 

 

3

A

Opt

Name of job.

Ignored

1

10

 

 

4

A

Opt

Name of job description.

Ignored

1

21

 

 

5

A

Opt

Name of job queue.

Ignored

1

21

 

 

6

A

Opt

Name of output queue.

Ignored

1

21

 

 

 

Arguments for LANSA for i

For further information, refer to Delete a file from the System described in Submitting the Job to Delete a File Definition 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

Name of job

Default: File name

1

10

 

 

4

A

Opt

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

1

21

 

 

5

A

Opt

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

1

21

 

 

6

A

Opt

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

1

21

 

 

 

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 deletion of files and associated logical views and I/O module using their own version of the "Delete a file from the System" facility.

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

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

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

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

BEGIN_LOOP     

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

REQUEST     FIELDS(#FILNAM #LIBNAM)

*********   Execute built-in-function - DLT_FILE

USE         BUILTIN(DLT_FILE) WITH_ARGS(#FILNAM #LIBNAM)

            TO_GET(#RETCOD)

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

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

MESSAGE     MSGTXT('Delete of file submitted successfully')

CHANGE      FIELD(#FILNAM) TO(*BLANK)

ELSE     

MESSAGE     MSGTXT('Delete submit failed with errors,

                    refer to additional messages')

ENDIF     

END_LOOP