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

VSAM buffering


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 06, 2012 7:16 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Aug 06, 2012 7:28 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 08, 2012 7:20 pm
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
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
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

Moderator Emeritus


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

PostPosted: Wed Aug 08, 2012 10:13 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 08, 2012 10:28 pm
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
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Aug 08, 2012 10:54 pm
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
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: 1788
Location: Bloomington, IL

PostPosted: Wed Aug 08, 2012 11:58 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts CVDA value for RRDS VSAM dataset. CICS 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Open VSAM File in IMS DC Region - DFS... IMS DB/DC 0
Search our Forums:

Back to Top