Previous Topic: $DSCALL OPT=EDIT

Next Topic: $DSCALL OPT=FCLOSE


$DSCALL OPT=ENQ

Performs an ENQ on a data set or member.

&CONTROL SHRVARS=($DS)
EXEC $DSCALL    OPT=ENQ
                { DSN=dataset_name | DD=DD_name } 
                [ MEMBER=member_name ]

This call is used to serialize access to a data set or member of a PDS in the same way ISPF does. It is used to prevent another user editing the data set or member while it is being used by your product region.

Operands:

OPT=ENQ

Specifies that an ENQ be issued.

DSN=dataset_name

Specifies the data set name to issue the ENQ for. If the data set is a PDS, a member name may be specified using the MEMBER operand.

DD=DD_name

Specifies the ddname of the data set to issue the ENQ for. If the ddname represents a concatenated DD, the ENQ is issued for the first data set in the concatenation. If the data set is a PDS, a member name may specified using the MEMBER operand.

MEMBER=member_name

Specifies a member name for the ENQ but is only valid if the ENQ is for a PDS.

Return Codes:

Note: For more information about &SYSMSG, &$DSRC, and &$DSFDBK, see Return Codes and Feedback Codes.

Example: OPT=ENQ

EXEC $DSCALL  DD=DDSYS1

Note: Issue an ENQ before opening a data set when you intend to update the data set. The ENQ option does not protect the data set from simultaneous physical writing, however an internal ENQ is issued on the OPEN to protect the physical data set. If the ENQ function is not explicitly released, it is released when the owning NCL process terminates.