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

how to execute MASSINSERT concurrently?


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Thu Jan 10, 2013 9:38 am
Reply with quote

if transaction A produces the following 4 messages:
Code:

aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa

and issue WRITE FILE with MSSINSERT option.

at the same time, anothe transaction B produces the following 4 messages:
Code:

BBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBB

and issue WRITE FILE with MSSINSERT option.

but according to my test, when TRAN A is writing file with MSSINSERT option, tran B cannot execute the same command against the same file.

Can anybody please tell me how to make WRITE FILE with MASSINSERT currently possible?

I want to procedure below result:
Code:

aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa
BBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBB



thanks in advance.[/quote]
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Jan 10, 2013 9:56 am
Reply with quote

Are these KSDS or ESDS records?
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Thu Jan 10, 2013 10:41 am
Reply with quote

it's a ESDS file.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Jan 11, 2013 2:23 am
Reply with quote

Hi dejunzhu,

What is the issue that you are facing ?

You say
Quote:
but according to my test, when TRAN A is writing file with MSSINSERT option, tran B cannot execute the same command against the same file.


If TRAN-B is executing only after TRAN-A then output should have come as you would have wanted...
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Jan 11, 2013 2:32 am
Reply with quote

I forgot to mention that when the MASSINSERT "WRITE" is complete, you must issue an explicit UNLOCK FILE (my advice) as soon as possible or, if you're at task termination, CICS will issue an implicit UNLOCK for you.

In your example, it's basically a horse race and TRNA was invoked first to issue the MASSINSERT, then TRNB can then issue the MASSINSERT as soon as the explicit or implcit UNLOCK is issued.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Fri Jan 11, 2013 5:03 am
Reply with quote

Quote:
Can anybody please tell me how to make WRITE FILE with MASSINSERT currently possible?
If you read the CICS Application Programming Guide manual, you will find that MASSINSERT locks the empty record area to be used so no other transaction can access it. For an ESDS, that means MASSINSERT is a purely sequential operation, and concurrent transactions CANNOT be executed to do MASSINSERT against the same ESDS file at one time. Hence, the behavior you are seeing is normal and expected and cannot be changed by you.
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Fri Jan 11, 2013 7:58 pm
Reply with quote

Good day to all!
I would like to add to what Robert has already mention, because you are working with a ESDS file the records are appended to the file. So the first MASS INSERT has to be completed before the second could append more records to the file. Does it make sense?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Jan 11, 2013 9:15 pm
Reply with quote

Hi Jose,

Quote:
Does it make sense?
Yup, at least to everyone except TS . . . icon_neutral.gif

d
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Fri Jan 11, 2013 9:17 pm
Reply with quote

Quote:
Yup, at least to everyone except TS . . .


but is enough to look at all the others TS posts to see that very little of what we say is appreciated

He just accepts only the answers that agree with his point of view !
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Jan 11, 2013 9:21 pm
Reply with quote

What Jose has described is similar to a program, which reads a record for update, which locks out all other updates as the CI is locked to other tasks. As soon as a rewrite or unlock is issued, the CI is free. That's why it is important to get in/get out as quickly as possible and with completion of a MASSINSERT, an immediate/explicit (programmatic) UNLOCK FILE is the recommended approach. Don't wait until task termination for CICS to issue an implicit UNLOCK FILE because others tasks are waiting.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Jan 11, 2013 9:22 pm
Reply with quote

Hi Enrico,

I am just ever so thankful than i will never technically support that "development" or have any customer dealings with that institution . . .

d
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Jan 11, 2013 9:24 pm
Reply with quote

Dick,

It's funny how you frame the TS's environment as an "institution" icon_lol.gif

Freudian slip, perhaps? icon_wink.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Jan 11, 2013 9:43 pm
Reply with quote

Hi Bill,

Just trying to get extra mileage . . . icon_cool.gif

d
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Mon Jan 14, 2013 6:58 am
Reply with quote

calm down, experts, no need to blame on me, I have already agreed with your helpful view points.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Jan 14, 2013 8:11 am
Reply with quote

Hello,

Quote:
calm down, experts
From what i read, things have been quite calm.

Quote:
no need to blame on me
Ah, well, it appears there is . . .

After more than 4 years, you still insist on trying or asking about things that are already documented as bad choices. Then (often) you want to challange the replies given by some exceptional IT people.

Quote:
I have already agreed with your helpful view points.
How would anyone here know that icon_confused.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Mon Jan 14, 2013 1:45 pm
Reply with quote

Quote:
calm down, experts, no need to blame on me, I have already agreed with your helpful view points.


given Your attitude and Your stubbornness

we are and have been very calm and patient ( even too much )

lot of blame to be put on You

You mostly disagree with what we tell You

if You have a bit of honesty inside You ( probably I expect too much ) and reread Your topics
You will see that usually there is <one/some> constructive reply to Your question
and MANY ( TOO MANY ) more to convince You that Your expectations are wrong

if You do not change Your attitude You will face lots of problems in Your life, in Your career

and pretty soon also in the forum icon_cool.gif
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Fetch data from programs execute (dat... DB2 3
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
No new posts Evaluate variable to execute a jcl step JCL & VSAM 3
No new posts Execute REXX on logon with ISPF CLIST & REXX 3
Search our Forums:

Back to Top