mainframerexx

Access a VSAM File from Rexx


How can I read a VSAM File in REXX ? Is there any tools available that will help me read and update a VSAM file through REXX. Right now I repro the file to a flat file and do the updates and then repro the file back to VSAM. The problem is that this VSAM file could be updated by another program before my REXX program finish processing.


Solution

  • Rexx has no native support for processing VSAM files. Given that Rexx can readily interface with other languages, this is not a problem. You can write your own program which the Rexx program will direct through parameters.

    There are products which have already done that work for you. However, whether there is such a product installed at your site, we can have no idea.

    Why have you encountered these problems after the program has been written? It is something which shouldn't get beyond the design stage.

    If your site uses some of the more advanced SHAREOPTIONS available for a VSAM file, then there should be technical answers available to you, for your site, for how to implement this task.

    So, why did you use Rexx? Why is there no file-locking? If no file-locking why is there no record-locking?

    There is nowhere near enough information to provide a more reasonable answer.

    Go to your colleagues, technical support. Find out how this should have been done. If then necessary, consider tossing away the Rexx you have, and do it how you should have done it.

    If that gets you somewhere: add an Answer here which explains. Make it clear that it is your site-specific solution, and for other people the mileage may vary. Accept the Answer when you are able to do so.

    If that does not get you somewhere: update your question with a lot more information, how and where the Rexx is run, what it is doing, why the other update JOBs may be running, relevant parts of the output from LISTCAT ALL ENT(, what you have discovered through your enquiries and research.