IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to use the ISPF service LMCOPY to copy a member of PDS


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Thu Jun 07, 2007 11:32 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Jun 07, 2007 12:24 pm
Reply with quote

Here is a link to the manual you want

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISPZSG40/CCONTENTS?DT=20050713030339

LMCOPY - by its name - by default performs a COPY operation rather than a MOVE
Back to top
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Thu Jun 07, 2007 1:17 pm
Reply with quote

Thanx expat.
Can u give me an example of how to use this command in rexx
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Jun 07, 2007 1:30 pm
Reply with quote

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
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Thu Jun 07, 2007 3:54 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jun 07, 2007 6:00 pm
Reply with quote

The code itself looks OK. Did you lookup the meaning of RC=10 for the LMCOPY service?
Back to top
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Thu Jun 07, 2007 6:14 pm
Reply with quote

Hi superk,
I could not find the meaning of RC=10 for the LMCOPY..
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Jun 07, 2007 7:10 pm
Reply with quote

Have you tried the fina manual?

O.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Jun 07, 2007 7:58 pm
Reply with quote

fina manual

is that the next version up from fine manual icon_rolleyes.gif
Back to top
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Fri Jun 08, 2007 11:22 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Jun 08, 2007 3:50 pm
Reply with quote

Post the TRACE output of your exec.
Back to top
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Mon Jun 11, 2007 6:45 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Convert Service Unit to CPU Seconds All Other Mainframe Topics 1
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts Preserve changes to ISPF Panel Variables TSO/ISPF 5
No new posts Use Copy Utility DB2 7
No new posts can an ISPF appl save user changes in... TSO/ISPF 14
Search our Forums:

Back to Top