View previous topic :: View next topic
|
Author |
Message |
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 156
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 156
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
TizMe
New User
Joined: 05 Jan 2006 Posts: 72
|
|
|
|
In assembler there is ENQ and DEQ macros.
Must be something similar in COBOL. |
|
Back to top |
|
|
die7nadal
Active User
Joined: 23 Mar 2005 Posts: 156
|
|
|
|
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 |
|
|
TizMe
New User
Joined: 05 Jan 2006 Posts: 72
|
|
|
|
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 |
|
|
|