M..
M..

Reputation: 19

ONLINE VSAM FILE

I've an idea and I don't know if it is doable in Cobol or not, I want to use Online VSAM file in online program, so my online VSAM file has multiple of records and i want if there is new record added to the file my online program detect that and do some of process, is it doable and please give me some of hint

Upvotes: 1

Views: 702

Answers (3)

David Crayford
David Crayford

Reputation: 571

Check out CICS Events. You can set an event for when the VSAM file is written to and action it with a COBOL program. There are several event adapters, you will probably be interested in the one that writes to a TS queue.

Upvotes: 0

James Anderson
James Anderson

Reputation: 27478

If this is a high volume application you could consider IBM's "Change Data Capture" product. On every update to a chosen VSAM file it will dump a before and after image of the record into a message queue. Which can then be processed by the language and platform of your choice.

Also worth considering is if by "online" you mean a CICS application, then, the VSAM file will be exclusively owned by a single CICS region, and all updates will be processed by programs running in this region. You may be able to tweak the application to kick off some post processing (As simple as adding "EXEC CICS START yourtransacion ..." to the existing program(s).

Upvotes: 0

Hogstrom
Hogstrom

Reputation: 3761

What your describing is basically a trigger based on an event. You described COBOL as the language but in order to achieve what you want you also need to choose a runtime environment. Something like CICS, IMS Db2, WebSphere (Java), MQ, etc.

VSAM itself does not provide a triggering mechanism. An approach that would start to achieve what you want would be to create an MQ queue that processes the records to be written and they could write the record and take additional action. MQ cuts across all the runtimes listed above and is probably the most reliable.

Another option is to look at using Db2 where you could create a Triggers or user defined function that might achieve what your looking for. Here is a reference article that describes many methods.

Here is a list of some of the articles in the link mentioned above:

Utilizing Triggers within DB2 by Aleksey Shevchenko

Using Stored Procedures as Communication Mechanism to a Mainframe by Robert Catterall

Workload Manager Implementation and Exploitation

Stored Procedures, UDFs and Triggers-Common Logic or Common Problem?

If you are looking to process records simply written from any source to VSAM there are really no inherent capabilities to achieve that in the Access Method Services where VSAM datasets are defined.

You need to consider your runtime environment, capabilities and goals as you continue your design.

Upvotes: 3

Related Questions