Previous Topic Table Of Contents Parent Topic Next Topic |  | # SWSENQ Function Related Topics Web Server API Function Index
| May be used in Shadow/REXX
| May not be used from Other REXX Interpreters
| No high-level language interface
This function interacts with MVS's ENQ/DEQ services to serialize usage of resources. Any REXX procedure using the SWSENQ function should use a SIGNAL ON SYNTAX statement to dequeue resources if the program fails to run properly. (Leaving the resources queued can leave your system inoperable.) ## SWSENQ Syntax The SWSENQ function call takes this form: `var = SWSENQ( func, major, minor, type, scope, ret )` SWSENQ uses the following arguments: func This operand is required. Specify either 'E' to enqueue on a resource. 'D' to dequeue from a resource. major The major name of the resource, up to eight characters in length. The function converts this value to upper case. The operand may be omitted, in which case the value 'SWS2' is used. minor The minor name of the resource, containing up to 255 characters. The function does not perform upper case conversion on this parameter value. If the operand is omitted, the function supplied a value based upon the name of the event procedure from which the request was issued. type This operand is optional for enqueue requests. If omitted, the enqueue service request enclusive access to the resource. Valid values for this argument are: 'E' for exclusive enqueues 'S' for shared enqueues. The operand should be omitted for dequeue requests. If other operands follow, code a comma to indicate it's omission. scope This argument is optional. If omitted, the value 'SYSTEM' is used by default. It specifies the scope of the request, which can be: 'STEP' for a jobstep-wide enqueue request 'SYSTEM' for a system-wide enqueue request 'SYSTEMS' for a systems-wide enqueue request ret The type of return value for the enqueue or dequeue request. This value is one of the following: Specify 'HAVE' to return control when the enqueue has been obtained. Specify 'NONE' to return control when the enqueue has been obtained. Specify 'TEST' to test whether the desired enqueue is available immediately but does not enqueue on the resource. Specify 'USE' to enqueue the desired resource only if it is available immediately. ## Return Values The function returns a numeric value equivalent to the return code issued by the underlying MVS service. Top