Access a VSAM File from Rexx

1.5k views Asked by At

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.

2

There are 2 answers

1
Bill Woodger On BEST ANSWER

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.

0
Leo de Jong On

A bit late but for anyone coming to this page with the same question. If you have File manager for z/OS installed you can code somthing like:

 "FILEMGR $VX  INPUT=VSAMINTW.USER1.HPS021D1.VIDTEXT',",   
         "VARNAME=STEM.,KEY='78789-V'"                
 /* Show stem contents                      */             
                                                      
 do i = 1 to stem.0   
 End                                     

You have to look in the File Manager manuals for the details.