Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Doubt regarding MASSINSERT.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
ramiyer999

New User


Joined: 08 Jul 2010
Posts: 3
Location: Gurgaon

PostPosted: Sun Aug 22, 2010 1:42 pm    Post subject: Doubt regarding MASSINSERT.
Reply with quote

I have a requirement, in one of my CICS program to Copy several records in a VSAM file.
ie: If my record is like
NY001
NY002
NY003
If the users wants to COPY all the records for NY and create for LA

I have to read the above and write the records as

LA001
LA002
LA003

In such a scenario, can i use a WRITE MASSINSERT ?
i loading all the NY records to an internal table and then how will i be able to use the massinsert?
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


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

PostPosted: Sun Aug 22, 2010 4:56 pm    Post subject: Reply to: Doubt regarding MASSINSERT.
Reply with quote

MASSINSERT is a very handy API feature when writing records to a VSAM file. Instead of many EXCP's, there's only a few, because the records are written (under the covers), usually via a "PUT" at the CI-level.

The key in using MASSINSERT is that the records must be sequential in nature.

As you can probably surmise, MASSINSERT works well for ESDS, because the writing of records is always sequential and this is primarily where I've used it.

But, KSDS can be different as it relies upon the fact that the programmer has ensured that these keyed-records are in sequential order and therefore, would be written in key-sequenced order. You wouldn't want to use MASSINSERT for a group of random writes, spread out all over the cluster.

Note; After issuing a WRITE MASSINSERT, you must issue an UNLOCK or if you're close to task termination, an implicit UNLOCK would be issued by CICS. But I'd be more inclined to use the explicit UNLOCK in the program, because you don't want to lockout CI's to another task and the UNLOCK provides this immediate ability.

Bill
Back to top
View user's profile Send private message
ramiyer999

New User


Joined: 08 Jul 2010
Posts: 3
Location: Gurgaon

PostPosted: Sun Aug 22, 2010 7:11 pm    Post subject:
Reply with quote

Hi Bill,
Thanks for the INFO.

In my case, the file i am writing to is a KSDS file with a group-key
(NY + 001),(NY + 002) is my key. So the records that i am writing will be in a sequential order.
I have loaded them in the same sequence into an internal table.
But loading the file completely and writing out the records one by one is taking a lot of time. Time for writing out 6000 records is atleast 10 seconds.
Will you be able to provide me a sample code the MASSINSERT ?

This is the first time i am using a MASSINSERT, dont wanna create a lock or make my CICS region go in hung state.

Thanks in advance.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Sun Aug 22, 2010 8:19 pm    Post subject: Reply to: Doubt regarding MASSINSERT.
Reply with quote

I'm not surprised it takes some time to randomly add 6000 individual records, but 10 minutes is high.

Actually, the API is a WRITE, except you add the MASSINSERT keyword. I also recommend specifying the KEYLENGTH keyword. Your System Programmer will thank you for this. icon_wink.gif

So, you would write each record using individual WRITE API's, but with MASSINSERT. But, when you're done writing all records, you should issue an immediate UNLOCK API.

During the time you're issuing the WRITE's, each record is being buffered into a temporary memory location and the actual PUT to the cluster is deferred.

The CONTROLINTERVALSIZE will certainly impact the amount of time it takes for all of these new records to be written to the Cluster.

As far as efficiencies, a small CISZ will not be much better than individual WRITE's, without MASSINSERT.

A larger optimized data CISZ (IE: 18432) will cause CICS to write all records it can contain within the larger CI and therefore, reduce your EXCP's significantly. Also, optimized index CISZ's (IE: 2048) are equally important.

Also, ensure you have adequate FREESPACE (FPSC) for the CI and CA.

CI splits are a nature of VSAM but, you want to try and reduce the number of CA splits to a minimum as a CA split causes VSAM to perform a mini on-line/in-place "REORG" and could take (at worse case) 1-2 minutes to complete.

Download the following link (VSAM Demystified) -

http://www.redbooks.ibm.com/redbooks/pdfs/sg246105.pdf

Bill
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Doubt in MFS abdulrafi IMS DB/DC 2 Fri Oct 21, 2016 3:09 pm
No new posts Doubt on GETMAIN, FREEMAIN behaviour Arunkumar Chandrasekaran CICS 3 Sun Aug 30, 2015 9:22 pm
No new posts Doubt in using command code O Appu IMS DB/DC 4 Tue Jan 13, 2015 3:14 pm
No new posts Doubt in using command code D and N t... Appu IMS DB/DC 7 Mon Dec 29, 2014 5:52 pm
This topic is locked: you cannot edit posts or make replies. ISREDIT macro command doubt sakrat TSO/ISPF 60 Wed Feb 05, 2014 6:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us