Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: How to use the ISPF service LMCOPY to copy a member of PDS
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 07, 2007 12:24 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 07, 2007 1:30 pm    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Jun 07, 2007 6:00 pm    Post subject: Re: How to use LMMCOPY thru REXX??
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    Post subject:
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: 2360
Location: Israel

PostPosted: Thu Jun 07, 2007 7:10 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 07, 2007 7:58 pm    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Jun 08, 2007 3:50 pm    Post subject: Re: How to use the ISPF service LMCOPY to copy a member of P
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts RDz Json restful service Kevin Vaz IBM Tools 4 Thu Jun 29, 2017 10:44 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 7 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us