IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using ENQ and DEQ macros


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
PHILIP MANGANO

New User


Joined: 01 Jan 2010
Posts: 1
Location: Boise, Idaho

PostPosted: Tue Jan 25, 2011 6:44 am
Reply with quote

I have a situation where multiple iterations of the same batch program will execute within multiple batch jobs (multiple address spaces) and will concurrently add unique records to the same VSAM KSDS file, SHAREOPTION(3,3). I am aware that I need to employ ENQ/DEQ processing for write integrity, including OPEN and CLOSE processing, to eliminate possible VSAM program checks, lost or inaccessible data, uncorrectable data set failures, and other unpredictable results.

Current referenced materials include:
MVS Authorized Assembler Services Guide
MVS Authorized Assembler Services Reference
DFSMS/MVS Using Data Sets
VSAM Demystified

I could not find any coding examples employing the ENQ and DEQ macros. Can anyone provide me with, or direct me to, ENQ/DEQ coding examples?

Also, I am not clear on the required usage of ENQ/DEQ processing as defined above. That is, should my batch program issue an ENQ then issue an OPEN for the data set, then issue a DEQ. Then issue an ENQ for a PUT (write) of a record, then issue a DEQ, for each record written to the file. Then issue an ENQ for a CLOSE of the data set, and then issue a DEQ. Can anyone provide a detailed definition of the ENQ/DEQ processing I need to employ in my batch program?

Thank you.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jan 25, 2011 7:18 am
Reply with quote

Hello and welcome to the forum,

Probably not what you want to hear, but as this is something new, you might consider using database to do what you need rather than vsam. . . Possibly the biggest single advantage of database is the concurrent update capability that is managed by the system.

Do you intend to "lock out" the entire vsam file or only some set of keys for each process? Something else?

One of the disadvantages/concerns of a roll-your-own enq/deq is that there is no way to enforce compliance. If someone runs code that does not follow the enq "rules", data can be corrupted/lost. Another is the situation where an enq is issued and not released and lots of processes come to a grinding halt.

You might find something you can use here also:
ibmmainframes.com/viewtopic.php?p=251457

The Assembler Services Guide appears to have considerable explanation and example.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Excel VBA integration with AS400 Macr... All Other Mainframe Topics 1
No new posts ISRE771 error while invoking macros CLIST & REXX 5
No new posts Executing macros to all the members a... TSO/ISPF 1
No new posts Automating the job flows by using the... All Other Mainframe Topics 10
No new posts Loading BMS macros to SDF II CICS 4
Search our Forums:

Back to Top