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

Restrict the use of a load module to only one time


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts How to load to DB2 with column level ... DB2 6
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts REASON 00D70014 in load utility DB2 6
Search our Forums:

Back to Top