Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Restrict the use of a load module to only one time

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Fri Oct 06, 2006 7:00 pm    Post subject: Restrict the use of a load module to only one time
Reply with quote

In a Multi processor environment like Z/OS, is it possibe to restrict the use of a load module to only one time, during any particular time. In other words, if Module A calls X and Module B calls X then B should wait untill A is done with X.
Back to top
View user's profile Send private message

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Oct 08, 2006 12:37 am    Post subject:
Reply with quote

I think the ans to your ques depends on your ans to this one:

What are you trying to accomplish doing that?
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Sun Oct 08, 2006 7:07 pm    Post subject:
Reply with quote

We have a program X that generates a unique ID based on a Timestamp that goes upto Microseconds. Many programs call program X to create the unique ID for the Primary key Columns for DB2. We never had this problem from the time when this system was created 10 yrs ago, but now two pgms calling X created the same unique ID.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Oct 08, 2006 10:35 pm    Post subject:
Reply with quote

I haven't encountered this problem personally, so I can't give a definitive ans. Have you checked the compile/link params (REUSE/RENT/DYNAM) currently in effect? They may have been changed with the last compiler conversion.

Another thought: with the continual (or is it continuous?) increase in CPU speeds, the next request may have started before the microsec expired.
Back to top
View user's profile Send private message
TizMe

New User


Joined: 05 Jan 2006
Posts: 72

PostPosted: Mon Oct 09, 2006 9:27 am    Post subject:
Reply with quote

In assembler there is ENQ and DEQ macros.

Must be something similar in COBOL.
Back to top
View user's profile Send private message
die7nadal

Active User


Joined: 23 Mar 2005
Posts: 156

PostPosted: Mon Oct 09, 2006 6:55 pm    Post subject:
Reply with quote

Jack,
Thanks for ur views. I checked the Compile and Link parms they are the same REUS,NORENT,DYNAM for all the programs. In the pgm X we use a DB2 Sequel call

EXEC SQL
SET :WS-TIMESTAMP = CURRENT TIMESTAMP
END-EXEC

and we do an algorithm to convert this Timestamp to generate an Alphanumeric Key which we use as Primary key in DB2 Tables. Since two pgms called pgm X they should have executed the SQL at the same time and fetched the same Timestamp and hence the same Unique ID. Thats why I am looking for a way to avoid executing pgm X at the same time.

Tizme,
Can u be a little brief abt ENQ and DEQ if possible.
Back to top
View user's profile Send private message
TizMe

New User


Joined: 05 Jan 2006
Posts: 72

PostPosted: Tue Oct 10, 2006 7:15 am    Post subject:
Reply with quote

ENQ and DEQ macros allow serialisation of resources within a single MVS system or across multiple MVS systems.

The ENQ macro instruction requests the control program to assign control of a reusable resource to the active task. If another task already has control, then this task will wait until the controlling task issues the DEQ. Each resource is represented by a unique name combination.

The DEQ macro instruction is used to remove control of one or more serially reusable resources from the active task.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparing 2 Files using Current time arunsoods DFSORT/ICETOOL 5 Fri Sep 22, 2017 6:00 pm
No new posts Regarding time parameter shanthi gude JCL & VSAM 7 Mon Sep 04, 2017 2:31 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm
No new posts Dump analysis of an assembler module monica1 PL/I & Assembler 4 Tue May 09, 2017 10:05 am
No new posts DSNACCOX (can it be run on 1 db/ts, t... SRICOBSAS DB2 5 Sat May 06, 2017 12:59 am

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