ENQ

Restriction: This topic applies to Windows environments only.

[label] ENQ (qname-addr

,rname-addr

,E|S

[,rname-length]

[,{STEP|SYSTEM|SYSTEMS}])

[,RET=CHNG|HAVE|TEST|USE|NONE]

[,RNL=YES|NO]

[,RELATED=value]

Requests control of one or more serially reusable resources.

List and execute forms are also available.

Parameters

qname-addr
Address of major resource name. The name may contain up to 8 characters.
rname-addr
Address of minor resource name. The name may contain up to 255 characters. The first byte must contain the length if rname-length is 0.
E|S E
indicates exclusive ownership. S indicates shared ownership.
rname-length
Length of rname, between 0 and 255. 0 indicates that the length is in the first byte of rname. If omitted the assembled rname label length is used.
STEP|SYSTEM |SYSTEMS

Defines the scope of the request:

STEP=This job step only (default)

SYSTEM=This system only

SYSTEMS=Multiple systems

RET=CHNG| HAVE|TEST| USE|NONE

Type of resource request:

CHNG=Change from shared to exclusive

HAVE=Request now if not previously requested

TEST=Test if available

USE=Request if immediately available. Program continues if not available.

NONE=Request unconditionally (default). Program waits.

RNL=YES|NO
YES requests that global resource serialization perform resource name list (RNL) processing, which can cause the scope value of a resource to change.
RELATED= value
Specifies where related documentary text is located.

Comments

The first five parameters (qname-addr through STEP|SYSTEM|SYSTEMS) may be repeated to specify multiple requests, up to a limit of 255 characters.

The final three parameters (RET through RELATED) apply to all the requests specified.

Examples

Example 1:

ENQ (MAJOR1,MINOR1,E,,SYSTEM)

This example requests exclusive ownership of one resource. The length of the minor resource name defaults to the assembled length.

Example 2:

ENQ (MAJOR2,MINOR2,E,12,,MAJOR3,MINOR3,S,,)RET=USE,RNL=YES