monkey
monkey

Reputation: 41

How can I copy load module using rexx?

I want to copy a load module from one pds to another using REXX.

Upvotes: 0

Views: 699

Answers (3)

MikeT
MikeT

Reputation: 57073

You could invoke IEBCOPY from within a Rexx, allocating the appropriate datasets to the appropriate ddnames before invoking IEBCOPY.

I'm unable to provide an example as I don't have the facilities/access.

Note that doing so may tie up your terminal/session.

You could also go into a more elaborate solution to build and submit a batch job, perhaps even having a panel front end, driving file tailoring/skeletons.

Upvotes: 1

user2860169
user2860169

Reputation:

Using just REXX what you want to do is not possible, however, you can invoke IEBCOPY (or your site equivalent) to perform the task for you. You may want to investigate calling programs like IEBCOPY and passing it the appropriate control cards to perform your task.

Upvotes: 0

Bruce Martin
Bruce Martin

Reputation: 10553

As @cshneid said you can use IEBCOPY Using IEBCOPY in rexx is basically the same as in JCL but:

  • use TSO Alloc to allocate the files
  • Call/invoke the program

if running under ISPF you can use LMCOPY. Roughly the following should work, you may need to issue a LMOPEN / LMClose on the data-ids as well ???

Address ISPEXEC
'LMINIT DATAID(DIDFrom) Dataset(in.data.set)'
'LMINIT DATAID(DIDTo) Dataset(to.data.set)'
'LMCOPY FromId('DIDFrom') FROMMEM(mymem) toId('DIDTo') toMem(newMemberName)'
'LMFREE DATAID(DIDFrom)'
'LMFREE DATAID(DIDto)'

If running foreground, the ISPF services used to have the advantage as they "co-ordinated" there actions with all other ISPF users- Less likely to corrupt the PDS directory. Not sure if this is an advantage any more.

Upvotes: 0

Related Questions