View previous topic :: View next topic
|
Author |
Message |
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
Hi,
Can anybody suggest me how to use the ISPF service LMCOPY to copy a member of a PDS into another thru REXX.And if we use LMCOPY will the member in the source(i.e from which it is copied) will get deleted and copied to the destination?? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
Back to top |
|
|
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
Thanx expat.
Can u give me an example of how to use this command in rexx |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Use the search facility on this forum, the SEARCH button is at thetop of the page, and use LMCOPY as a search keyword. |
|
Back to top |
|
|
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
Thanx expat.
I found an example for LMCOPY in the forum and I tried the following code,but the member of the pds is not getting copied.Can anyone help me in this regard??
the code is as follows:
Code: |
Address ISPEXEC
'LMINIT DATAID(INDD) DATASET('''dsin''') ENQ(SHRW)'
'LMINIT DATAID(OUTDD) DATASET('''dsout''') ENQ(SHRW)'
'LMCOPY FROMID('INDD') TODATAID('OUTDD') FROMMEM('mbrin')
TOMEM('mbrout') REPLACE PACK'
say rc
if rc?=0 then do
say 'failed to copy'
ELSE
SAY 'COPIED'
'LMFREE DATAID('INDD')'
'LMFREE DATAID('OUTDD')'
|
O/P:
10
FAILED TO COPY |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
The code itself looks OK. Did you lookup the meaning of RC=10 for the LMCOPY service? |
|
Back to top |
|
|
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
Hi superk,
I could not find the meaning of RC=10 for the LMCOPY.. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
fina manual
is that the next version up from fine manual |
|
Back to top |
|
|
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
Thanx ofer71 and sorry for a late reply.
I tried printing the return code for both LMINIT statements and iam getting the rc as 8 for both of the statements
I have tried the manual
RC-10 means 'No data set is associated with the given data ID. '
RC-8 means The "From" member not found.
Specified "To member name" same as specified "From member name."
but all the datasets and members needed are already existing.. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Post the TRACE output of your exec. |
|
Back to top |
|
|
shchan
New User
Joined: 06 Jun 2007 Posts: 58 Location: Hyderabad
|
|
|
|
Thanx superk,I am very sorry for a late reply.
But the code worked with some changes.There were some syntactical errors..Iam posting the code so that it might help someone else.
ADDRESS ISPEXEC
"LMINIT DATAID(INDD1) DATASET('MSC.PDS.CREREXX')"
SAY RC
"LMINIT DATAID(OUTDD1) DATASET('MSC.JCLS.EXAMPLES')"
SAY RC
SAY INDD1
"LMCOPY FROMID("INDD1") TODATAID("OUTDD1") FROMMEM(REXMEM)
TOMEM(REXMEM) REPLACE PACK"
SAY RC
IF RC?=0 THEN
SAY 'FAILED TO COPY'
/* LEAVE */
ELSE
SAY 'COPIED'
"LMFREE DATAID("INDD1")"
"LMFREE DATAID("OUTDD1")"
SAY RC |
|
Back to top |
|
|
|