IFENQ (HLI function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
m (add category)
 
Line 86: Line 86:
.
.
   CALL "IFENQ" USING RETCODE, RESOURCE, ACTION, TIME. </p>
   CALL "IFENQ" USING RETCODE, RESOURCE, ACTION, TIME. </p>
[[Category: HLI functions]]

Latest revision as of 21:03, 20 April 2018

Summary

Description
The IFENQ call (ENQUEUE) enqueues on the arbitrary resource name specified.
Thread type
multiple cursor IFSTRT, single cursor IFSTRT
IFCALL function number
39

Syntax

IFENQ(RETCODE,RESOURCE,ACTION,TIME)

Compile-only form
Not available
Execute-only form
Not available

Specify the parameters in the syntax order shown above.

Parameter Description
RETCODE [O,i,r] The Model 204 return code is the required first parameter. The code is a binary integer value.
RESOURCE [I,s,r] The resource is a required input parameter that specifies the name of the resource to be enqueued. Specify a short character string up to 32 characters in length. You can specify any data in the input string except for 32 bytes of binary zeroes.
ACTION [I,i,r] The action is a required input parameter that specifies whether to enqueue on the named resource in share or exclusive mode. Specify one of the following integer values:

1 = Enqueues in share mode

2 = Enqueues in exclusive mode

TIME [I,i,r] The time is a required input parameter. Specify an integer value that is the wait time in seconds.

Usage notes

All users share an internal enqueuing table and should develop standard resource naming conventions to make arbitrary resource enqueuing effective.

Completion return code (RETCODE)

Model 204 returns the following completion codes for IFENQ:

Code Condition
0 Resource was enqueued successfully.
3 Control of the requested resource could not be obtained within the specified time limit.

If the first attempt to enqueue on the specified resource fails, Model 204 waits the number of seconds specified in the time parameter, then tries again. If the second attempt to enqueue fails, Model 204 returns a completion code of 3 to the HLI program.

For more information, see the ENQRETRY parameter.

Coding example (COBOL)

WORKING-STORAGE SECTION. 01 ARGS-FOR-CALL. 05 RETCODE PIC 9(5) COMP SYNC. 05 RESOURCE PIC X(9) VALUE "CUSTFILE;". 05 ACTION PIC 9(5) COMP SYNC VALUE 1. 05 TIME PIC 9(5) COMP SYNC VALUE 10. . . . PROCEDURE DIVISION. . . . CALL "IFENQ" USING RETCODE, RESOURCE, ACTION, TIME.