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
 

 

VSAM buffering

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
milind suman
Warnings : 1

New User


Joined: 19 Aug 2009
Posts: 55
Location: Pune

PostPosted: Mon Aug 06, 2012 7:12 pm    Post subject: VSAM buffering
Reply with quote

Hi,
I have a problem in understanding how buffering works for VSAM files.

I created a VSAM ESDS file for logging purpose. Each time, when a CICS program is executed i add 15 records to this file. But, when i execute the transaction multiple times, recent additions are not visible immediately unless until i close the file explicitly?

Can you please let me know the reason for this?
Is there any way to write the records instantly in the ESDS file ?

Thanks for your help
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Mon Aug 06, 2012 7:16 pm    Post subject: Reply to: VSAM buffering
Reply with quote

Pretty much like any buffering.

Until a buffer is full (for writing) there will definitely be no physical write to the storage media.

Close will ensure that all buffer(s) remaining are written.

If the write was immediate, there would be no point in having the buffer.
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: Mon Aug 06, 2012 7:28 pm    Post subject: Reply to: VSAM buffering
Reply with quote

If the time-period allowed between writing all 15 ESDS records independently meets your needs, you could stack these records in a TSQ and automatically write all items to an ESDS using the MASSINSERT keyword when you see fit, which reduces the EXCP's significantly.

You have to close the ESDS file and re-open it to view the contents in Batch written by CICS, updating the High RBA in the catalog.
Back to top
View user's profile Send private message
milind suman
Warnings : 1

New User


Joined: 19 Aug 2009
Posts: 55
Location: Pune

PostPosted: Wed Aug 08, 2012 7:13 pm    Post subject:
Reply with quote

My log file is being used by online transaction , If i Open/close the file to flush the buffer the transaction may abend during file close time .
Is there any way to commit the buffer data into file without closing and opening it .

Thanks for your help .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Wed Aug 08, 2012 7:20 pm    Post subject:
Reply with quote

The whole point of a buffer is to improve I/O and not have the CPU waiting for the I/O device so much. Your best bet would be to discuss your application design and problems with your CICS support group (person). There are ways around your issue, but they can have negative consequences to the CICS region as well as the LPAR it runs in.

The primary question that hasn't been asked, or answered, yet is why is it so important to you that the data be written to the file immediately? As long as the data gets there eventually, why do you care when it is written to the file?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 08, 2012 7:40 pm    Post subject:
Reply with quote

Robert Sample wrote:
The primary question that hasn't been asked, or answered, yet is why is it so important to you that the data be written to the file immediately?

my money is on a batch real-time analysis 'tool' that the TS
wrote or is supporting.

and as far as the online transaction being prematurely terminated
because of this add-on/log-file:
that was probably poorly written
so that a closed file would lead to the unwanted result.
remember, the primary concern should be the completion of
a business activity
not the health of some analysis of a log file.

but then again, we are continuing the discussion of
vsam files both in cics and batch environment.

goto db2.
(or learn to write legacy style code better).
Back to top
View user's profile Send private message
milind suman
Warnings : 1

New User


Joined: 19 Aug 2009
Posts: 55
Location: Pune

PostPosted: Wed Aug 08, 2012 10:10 pm    Post subject:
Reply with quote

We have to read the log file every 30 minutes to create the transaction report . Journaling in CICS is a solution instead of logging for this case ?
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: Wed Aug 08, 2012 10:13 pm    Post subject:
Reply with quote

Hello,

Quote:
We have to read the log file every 30 minutes to create the transaction report
What business requirement might this support?

Or is this just because "they" want it . . .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Wed Aug 08, 2012 10:28 pm    Post subject:
Reply with quote

Why do you need a transaction report every 30 minutes? This sounds like some VERY inexperienced people coming up with "requirements" that they would like without realizing the impact.

Using journal writes will provide you what you want, as long as you use synchronous mode -- asynchronous puts you right back where you are now with the VSAM writes. However, be aware that using synchronous journal writes WILL impact the application performance as well as the CICS overall performance.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 08, 2012 10:31 pm    Post subject:
Reply with quote

well, as Mr Scherrer so aptly stated,
WTF does someone need a report every 30 min?

that said,
since the analysis is done in batch,
yes journal,
which allows you to flip between journal files,
thus no interruption in the online activity.

but then again, if some idiot wants a report every 30 minutes,
why not make the generation of the report a cics screen,
which would mean you can keep the esds file
(an all the code that populates the file)
in place.

the only thing that you would have to write is the online screen,
which could have an option to generate hard copy of something,
if it was really needed.

what i would do, is create a web app, so the clown could look at a graph.
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: Wed Aug 08, 2012 10:54 pm    Post subject: Reply to: VSAM buffering
Reply with quote

You could utilize an A/B log-file method, using ENQ/DEQ and the ability to store the active log-file suffix (A/B) in an area which can be accessed and ENQ'd/DEQ'd by all CICS resources, such as a CWA.

Define a transaction, which kicks off every 30 minutes, ENQ's on the current active log-file, switches it (A to B or vice-versa), DEQ's on the now inactive file, closes and reopens this file and then another task can read all the records. Also, ensure the new-active file is ENA, so that it opens upon first usage, using (for example) SET FILE(FILENAME) DELETE to clear it beforehand. Ensure your ESDS log-files are defined with the REUSE attribute.

Within the ENQ/DEQ scope, if an ENQ is entered by the background task and another CICS task/program is trying to write to this log-file (ENQBUSY is raised), ensure that after the ENQBUSY is completed in the background task, the file-name suffix is obtained from the shared-area by the CICS task/program which had been waiting.

Serial usage is the key to getting this to work properly (ENQ/DEQ).

Note: Once a background task has completed reading the file, the file needs to be cleared, so when it becomes active again, its first record written will be its initial record. This flip/flop applies to both the A and B file.

You also have the option (and perhaps a wise one at that) to backup this file to another file before clearing it.

Just another method....
Back to top
View user's profile Send private message
milind suman
Warnings : 1

New User


Joined: 19 Aug 2009
Posts: 55
Location: Pune

PostPosted: Wed Aug 08, 2012 11:43 pm    Post subject:
Reply with quote

The requirement is to get the alerts in the form of report for some specific kind of activities by online customers . seems its important for them to get the alerts for some reason which I dont know. Performance is important since its banking transaction . I am not sure what to suggest and do for this requirement icon_sad.gif
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Aug 08, 2012 11:58 pm    Post subject:
Reply with quote

milind suman wrote:
The requirement is to get the alerts in the form of report for some specific kind of activities by online customers . seems its important for them to get the alerts for some reason which I dont know. Performance is important since its banking transaction .

Then is not the obvious thing to do to go back to your team lead or system analyst with the information that you have so far and request more detail on the requirement so that it may be successfully fulfilled?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 09, 2012 12:01 am    Post subject:
Reply with quote

if you have the money,
i have the time,
to make state-of-the-art enhancements to international banking systems.
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 BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts VSAM define for large file jerryte JCL & VSAM 9 Wed Oct 05, 2016 1:51 am
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts 2 vsam file compare and update a fiel... ABINAYATHULASI DFSORT/ICETOOL 6 Sun May 29, 2016 11:15 am
No new posts trying to define a VSAM Cluster in JCL t5590ag JCL & VSAM 10 Thu May 19, 2016 5:52 am


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