# DEQ

## Syntax:

    DEQ(qname,rname[,scope][,reqtype])

## Arguments:

qname
  (also referred to as the "major name") is the 1 to 8 character name that identifies the first level of qualification for the resource you want to process. If you code fewer than 8 characters the name is blank padded on the right out to a length of 8. This name needs to have been previously used in the ENQ function. The qname can be any arbitrary set of characters. The only requirement is that all users of a resource use the same qname (and rname) to represent the same resource.

  Note: Certain qnames are reserved for authorized programs only. You should especially avoid using qnames that begin with 'SYS' since some of these are reserved for the control program. SYSDSN, for example, cannot be used because it is reserved by the access methods.

rname
  (also referred to as the "minor name") is the 1 to 255 character name that identifies the second level of qualification for the resource you want to process. Note that the rname (unlike the qname) is not blank padded. This name needs to have been previously used in the ENQ function. The rname can be any arbitrary set of characters. The only requirement is that all users of a resource use the same rname (and qname) to represent the same resource.
scope
  indicates scope of control for the resource. The valid values are:
  'STEP'
    The resource is only used on one address space.
  'SYSTEM'
    The resource is used on one system.
  'SYSTEMS'
    The resource is used on several systems. Note that 'SYSTEMS' will only work if global resource serialization (GRS) is active.

  The default value is 'STEP'.

reqtype
  This argument is used to indicate the type of DEQ request. The valid values are:
  'HAVE'
    The request for releasing control of a resource is conditional. If the resource is not held, a return code is issued.
  'NONE'
    The request for releasing control of a resource is unconditional. If the resource is not held, an error occurs.

  The default value is 'NONE'.

## Module Name:

SWXDEQ

## Service Description:

The DEQ function is used to release control of resources that were previously acquired via the ENQ function. All users of the resource must agree upon and use the same qname/rname/scope combination.

## Returned Information:

The DEQ function returns the DEQ macro return code. If you CALL the DEQ function, the returned value is contained in the RESULT special variable. In addition, the REXX special variable, RC, is also set to contain the DEQ macro return code.

The following DEQ return code values are possible:

0
  Successful execution. Control of the resource is released.
4
  Successful execution. The task has requested the resource but has not been give control of it yet. The task remains in a wait condition.
8
  Execution failed. The current task does not hold the resource.
Other
  The abend code in REXX decimal (use the REXX D2X function to convert to hexadecimal).

Note: Abend code X'130' (resource is not owned by the current task) is ignored and the return code is set to zero.

## Examples:

1. Call the DEQ function to release control of a data set:

       call deq 'APPLDSN', 'USER1.EXEC', 'system'

2. Call the DEQ function to release control of an arbitrary resource:

       call deq 'THEQNAME', 'THERNAME', 'system'

© Copyright 1998 by Open Software Technologies, Inc.