Previous Topic: EDTRCD3 Device Function

Next Topic: Using Batch Processing

EXCEXTFUN User Function

The Execute External Function (EXCEXTFUN) allows you to specify a high-level program using an action diagram. You can also use an EXCEXTFUN as a user-defined *Notepad function that can serve as a repository of standardized action diagram constructs that you can easily copy into the action diagrams of other functions.

For more information on user-defined *Notepad functions, see Using NOTEPAD in the chapter "Modifying Action Diagrams"

The function is implemented as a separate program and has its own action diagram. The function can be created with an access path of *NONE. You can submit an EXCEXTFUN function for batch processing from within an action diagram.

The EXCEXTFUN has no default logic. It presents an empty action diagram. Any function or set of functions of any type can be included in an EXCEXTFUN and compiled so that it can be executed as a program.

For documentation purposes, the EXCEXTFUN can be optionally attached to Retrieval (RTV), Resequence (RSQ), or Update (UPD) access paths.

A good practice is to have only a single action diagram construct with an EXCEXTFUN. This single construct is a call to an internal function (EXCINTFUN) that contains all the functionality required. Both functions define the same parameters. This way, you can choose to reference an EXCEXTFUN (function you can call) or EXCINTFUN without duplicating the action diagram constructs.

The following table shows the parameters available.

Parameters

Usage

Role

Default

Option

Return code

B

Y

R

Other fields

Any

O

Parameters of role Varying (VRY) are allowed for this function type.

The following table shows the function options available.

Options

Default Value

Other Values

Send all error messages

M(YSNDMSG)

Y, N

Confirm prompt

Y

N

Confirm initial value

M(YCNFVAL)

Y, N

Commit control

N(*NONE)

M(*MASTER), S(*SLAVE)

Generate error routine

M(YERRRTN)

Y, N

Reclaim resources

N

Y

Closedown program

Y

N

Copy back messages

M(YCPYMSG)

Y, N

Generation mode

A

D, S, M

Overrides if submitted job

*

F

Workstation implementation

M(YWSNGEN)

N(NPT), G(GUI), J(JAVA), V(VB)

Distributed file I/O Control

M(YDSTFIO)

S, U, N

For more information on function options, see the chapter, "Setting Default Options for Your Functions."