Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
Using ENQ and DEQ macros

Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message

New User

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

PostPosted: Tue Jan 25, 2011 6:44 am    Post subject: Using ENQ and DEQ macros
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

Site Director

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

PostPosted: Tue Jan 25, 2011 7:18 am    Post subject:
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:

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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1


Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing macros to all the members a... sakrat TSO/ISPF 1 Sun Apr 06, 2014 11:54 am
No new posts Automating the job flows by using the... chandrupegasus All Other Mainframe Topics 10 Mon Jul 01, 2013 3:48 pm
No new posts Loading BMS macros to SDF II Graham Hobbs CICS 4 Sun Mar 04, 2012 11:49 pm
No new posts Facing problem in call from CICS to ... anjuraj PL/I & Assembler 1 Fri Feb 18, 2011 4:59 pm
No new posts How to pass array between two macros ... ofer71 CLIST & REXX 2 Thu Jan 13, 2011 2:36 pm

Back to Top
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us