Posted: Wed May 10, 2006 3:04 pm Post subject: Use Rexx to copy member
I did a search and coud not find anything relevant. I was hoping some of you might help as I am completely new to the mainframe and rexx enviroment.
Can REXX do something like this?
A REXX exec that will take input from a user at a terminal that will perform a simple member copy from one pds to a static pds. This process will also be allow the user to change the member name on the output side. Once the copy is performed, do a CALL to execute CA7CCI (ca7 rexx interface) using the output member name as the jobname to the demand parameter.
For example, if a user invokes REXCOPY (sample name) it would be interactive where it would ask for
INPUT DSN =
INPUT MEMBER=
OUTPUT MEMBER =
No need to ask for OUTPUT DSN as it is always going to be the same.
So after executing the REXX it would look like this
INPUT DSN = MY.INPUT.DSN
INPUT MEMBE = AEIOU
IOUT DSN = MY.STATIC.DSN
OUTPUT MEMBER = BLDFSFD
The end result, member aeiou would be copied to my.static.dsn as member bldfsd.
Once the copy is done, a CA7CCI would be invoked to demand the job BLDFSFD to CA-7.
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
Posted: Wed May 10, 2006 4:35 pm Post subject:
Hi Marco. There are many ways to do this. The easiest, but not the best, is to use the COPY command that is part of TSO (well, technically it is not part of TSO but that is a different topic). The problem with COPY is that it requires exclusive use of the dataset(s) (DISP=OLD if you familiar with that from JCL).
A better way, assuming you are running this under ISPF, is to use the ISPF services LMINIT, LMCOPY and LMFREE. They will handle the synchornization (sharing, ENQs) for you and will copy ISPF statistics in case that matters.
Another way, also easy, is to use EXECIO which will do the I/O. To do that, you need to use TSO's ALLOC command for the files, including the member names(!!) and do the I/O yourself. Search for Execio here or Google or Google groups for examples.
Finally, in MVS, people will be more used to ISPF full screen interfaces than line mode queries. Line mode queries can be done wit Say and Pull keywords. Full screen interfaces require understanding of how to create ISPF panels and also require access to data sets where you can put the panels so that other people can read them. For a first REXX/MVS program, that may be beyond the scope of what you are doing. As a usually advanced topic, it is possible to imbed panels directly within a Rexx exec. Type TSO ISRDDN M ISRSETLN on a command line and you may find an example of doing this on your system or again, you can search the web.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum