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
 
A question on EXEC cics write/delete

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

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Sat Oct 30, 2010 9:18 am    Post subject: A question on EXEC cics write/delete
Reply with quote

there is two vsam file, seperately to store inactive accounts (inactive-file) and active accounts (active-file), when using read-random-update method to access an accounts, the program first to read the active-file, if not found, then to read inactive-file, if found it in inactive-file, the program will migrate that record from inactive-file to active-file, the code is:
first, write active file:

EXEC CICS WRITE
DATASET (ACTIVE-FILE)
RIDFLD (FILE-KEY)
FROM (INACTIVE-RECORD)
LENGTH (FILE-LENGTH)
END-EXEC.

if write successfully, then delete the accout from inactive-file:
EXEC CICS DELETE
DATASET (INACTIVE-FILE)
END-EXEC.

Now I meet a problem, I have an accouts list, about 10 million, to random read the two account file (this is done via batch, not CICS, and this will not migrate account from inactive-file to active-file), to determine whether the account really exists in our system. my solution is to read inactive-file first, if not found, to read active-file, if still not found, then print it to the error file, accounts in error file means the accounts not really exist in our system. but when i check the error file, I found some accounts in it still can be locate in our system, which means there's some wrong with logic, but I am sure it is the general solution (if an account exist in our system, it must be in inactive-file or active-file, when it is not found in inactive-file, then it must be migrated to active-file)

now I am focus on the mechanism of exec cics write/delete, i want to know, when write/delete a record, it is to update buffer first, then file, or update file immediately?

the secord is, as VSAM has Index and DATA, when write/delete, it update INDEX first, or DATA first?

please give me you hand

thanks.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Sat Oct 30, 2010 9:27 am    Post subject:
Reply with quote

Quote:
when write/delete a record, it is to update buffer first, then file, or update file immediately?
CICS updates in the buffer -- just like the rest of MVS -- and then applies the change(s) to the file. Depending upon the amount of file activity, and how the file buffering is set up in CICS, it could be anywhere from a few seconds to many hours between the time the file change is made by the program and the time the change is actually applied to the VSAM file.

Quote:
the secord is, as VSAM has Index and DATA, when write/delete, it update INDEX first, or DATA first?
I have no idea and have no idea why you would think this important enough to ask about. This may be a case where only IBM could tell you the answer, and there's no reason for IBM to tell you this since such internal matters could change at any time.
Back to top
View user's profile Send private message
quanzhong

New User


Joined: 12 Aug 2008
Posts: 46
Location: china

PostPosted: Sat Oct 30, 2010 9:53 am    Post subject:
Reply with quote

thanks. robert

can you also help to expain why some record not found when I am trying random read during batch proceesing, and how to prevent this situation. (I can't close these two online files, and can't stop the migrate process).
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Sat Oct 30, 2010 12:08 pm    Post subject: Reply to: A question on EXEC cics write/delete
Reply with quote

concurrent access ( batch/cics/whatsoever) to files being updated is prone to give inconsistent results...
You and Your storage support should take some time to meditate on the
SHAREOPTIONS attributes and the caveats for the different values

what You are experiencing is due to a poor understanding of the above!
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sun Oct 31, 2010 12:47 am    Post subject:
Reply with quote

Hello,

Quote:
can you also help to expain why some record not found when I am trying random read during batch proceesing, and how to prevent this situation.
Robert has already explained how this can happen. . .

One way to prevent this is to convert the vsam to database. . .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Sun Oct 31, 2010 1:11 am    Post subject:
Reply with quote

Your solution choices are three:

1. Convert to a database as Dick suggested.

2. Change the SHROPTIONS and add queueing to your CICS and batch programs. Note that this requires using an Assembler program to handle the batch enqueue / dequeue logic as COBOL does not have anything built in to do so. You may also find a vendor program that can be purchased to handle the enqueue / dequeue logic -- but that requires purchase and most mainframe products cost tens of thousands (or more) of dollars.

3. Give up on the idea of simultaneous CICS and batch updates to the VSAM file and redesign your system to not do so. In most cases, this is the best option to go with.
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 ASP3 ABEND IN CICS Vedant CICS 0 Fri Oct 20, 2017 3:18 pm
No new posts Identifying Interfaces in CICS/mainframe Ashishpanpaliya CICS 5 Fri Oct 13, 2017 3:21 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts question about dfsms management clas... Hervey Martinez IBM Tools 0 Tue Oct 10, 2017 6:19 pm
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm

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