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
 

 

LMMcopy to copy all members in a pds to another in rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Fri Mar 20, 2009 11:11 pm    Post subject: LMMcopy to copy all members in a pds to another in rexx
Reply with quote

Hi am using LMMcopy to copy all members in a pds to another in rexx
ex:
I want to copy these prod pds
CHGMAN.XXX.AAA.SRA
CHGMAN.XXX.AAA.PR1
CHGMAN.XXX.AAA.JC1
(I identify these pds using LISTDS command )
to
USERID.XXX.AAA.SRA
USERID.XXX.AAA.PR1
USERID.XXX.AAA.JC1

But i face issue here
it copies *.PR1 and *.JC1 but not *.SRA s
it gives a return code of 8 for SRA alone.. though there are members in it
If i write a code to copy SRA alone then it does a neat copy

Any idea why this occurs

Or shud i use IEBCOPY if so HOW??

any example how to code IEBCOPY for my case
The PDS name is manipulated and should be given as input

regards
raki
Back to top
View user's profile Send private message

Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Sat Mar 21, 2009 1:15 am    Post subject: Reply to: LMMcopy to copy all members in a pds to another in
Reply with quote

Can you post your code?
Back to top
View user's profile Send private message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Sat Mar 21, 2009 4:30 pm    Post subject:
Reply with quote

Code:
X = OUTTRAP('DSNLIST.')                     
 ADDRESS TSO "LISTDS '"DSN_NAME"' LEVEL"     
 DO I = 1 TO DSNLIST.0 BY 5                   
  SAY DSNLIST.I                               
  S=USERID()                                 
PDS1 =DSNLIST.I                               
SAY PDS1                                     
PARSE VAR PDS1 M1 '.' M2 '.' M3 '.' M4 '.' M5
SAY M5                                       
TRAIL =LEFT(M5,'3')                                         
SAY TRAIL                                                   
IF SYSDSN(""PDS1"") = OK THEN DO                             
PDS2=S||."USER."||T2||".#"||T3||"."||TRAIL                   
SAY PDS2                                                     
ADDRESS TSO "ALLOC DD(OUTDD1) DS('"PDS2"') NEW ,             
RECFM(F)  DIR(100) LRECL(132) SPACE(100,100) CYLINDERS "     
"LMINIT DATAID(INDD1) DATASET('&PDS1')"                     
SAY RC                                                       
"LMINIT DATAID(OUTDD1) DATASET('&PDS2')"                     
SAY RC                                                       
"LMOPEN DATAID("INDD1")"                                     
                                     
DO FOREVER = 1                                               
TRACE I                                                     
   "LMMLIST DATAID("INDD1") MEMBER(LMMEM)"                   
   SAY LMMEM                                                 
    SAY RC                                                         
  IF RC > 0 THEN LEAVE                                             
      "LMCOPY FROMID("INDD1") TODATAID("OUTDD1") FROMMEM(&LMMEM)   
       TOMEM(&LMMEM)REPLACE PACK"                                 
       SAY RC                                                     
       IF RC?=0 THEN                                               
       SAY 'FAILED TO COPY'                                       
 END                                                               
 "LMCLOSE DATAID("INDD1")"                                         
 "LMFREE DATAID("INDD1")"                                         
 "LMFREE DATAID("OUTDD1")"                                         
 ADDRESS TSO 'FREE DD(OUTDD1)'                                     
 LMMEM =NULL                                                       
 END                                                               
 END                                                           
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Mar 21, 2009 4:46 pm    Post subject: Reply to: LMMcopy to copy all members in a pds to another in
Reply with quote

look like You posted a mangled version of Your script

You parse with m1 m2 m3 m4 m5, and then You use t2 t3

but..
Quote:
I want to copy these prod pds
CHGMAN.XXX.AAA.SRA
CHGMAN.XXX.AAA.PR1
CHGMAN.XXX.AAA.JC1
(I identify these pds using LISTDS command )
to
USERID.XXX.AAA.SRA
USERID.XXX.AAA.PR1
USERID.XXX.AAA.JC1

for a simple copy like this one I would investigate a DFDSS copy with a rename
Back to top
View user's profile Send private message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Sat Mar 21, 2009 5:13 pm    Post subject:
Reply with quote

I parsed just to get M5 value alone..

T2 and T3 are other variable initalized before which was not pasted alone with the code.

Can u give me more idea about DFDSS copywith a rename
...

Note : we are creating output pds inside the loop ...
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Mar 21, 2009 5:35 pm    Post subject: Reply to: LMMcopy to copy all members in a pds to another in
Reply with quote

something on the style

Code:
//COPY     EXEC PGM=ADRDSSU
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 COPY DATASET(INCLUDE(CHGMAN.XXX.AAA.*)) -
      REPLACEUNCONDITIONAL -
      RENAMEU(USERID)
/*


here is the link to the manual pages for the dfdss copy command
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2S261/2.3.6?SHELF=DGT2BK71&DT=20080128160125
Back to top
View user's profile Send private message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Sat Mar 21, 2009 5:44 pm    Post subject:
Reply with quote

The input and output PDS name are manipulated here..
Can we do this in the code which u have given.
and how to include this code in rexx ??
Please help..
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Mar 21, 2009 5:55 pm    Post subject: Reply to: LMMcopy to copy all members in a pds to another in
Reply with quote

why do You change Your mind as the topic proceeds ?

My solution fits perfectly the initial post

learn to post the exact details from the beginning
You make people lose time on devising and testing ( Yes, I said test ) useless solutions
for sloppy requiremens
Back to top
View user's profile Send private message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Sat Mar 21, 2009 6:06 pm    Post subject:
Reply with quote

As u see in code

using LISTDS i identify the PDS names (which is in a loop)
here we dont know what will be exact PDS
(what i gave was a example)

then i manipulated to create a output pds based on the input's name
and i copy the pds members

so in the second instance of the loop i ll get another pds name
which has to be given as input.. .
can this be done...

sorry for the inconvience

regards
Back to top
View user's profile Send private message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Mon Mar 23, 2009 12:07 pm    Post subject:
Reply with quote

Any replies for my question ??
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Mar 23, 2009 12:36 pm    Post subject:
Reply with quote

I think I'm not the only one that didn't understand your question, that's why you didn't get any answers.

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

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Mon Mar 23, 2009 12:48 pm    Post subject:
Reply with quote

Let me make it more clear.

I first identify the no of PDS available which starts with
CHGMAN.XXX.AAA.* (search)using LISTDS.
Then each PDS listed needs to copied.

if members are available inside the PDS
then each members needs to be copied to the corresponding PDS which is
newly created.

CHGMAN.XXX.AAA.SRA
CHGMAN.XXX.AAA.PR1
CHGMAN.XXX.AAA.JC1
to
USERID.XXX.AAA.SRA
USERID.XXX.AAA.PR1
USERID.XXX.AAA.JC1

Any idea how to do this..
I tried with LMMCOPY .. The code is in the thread..
but am not able to copy all datasets ..
please help me to acheive this .
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Mar 23, 2009 12:55 pm    Post subject: Reply to: LMMcopy to copy all members in a pds to another in
Reply with quote

So You went back to the original requirement...

use the jcl I gave You as a sample !
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Mar 23, 2009 12:57 pm    Post subject:
Reply with quote

You can also use IEBCOPY.

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

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Mon Mar 23, 2009 2:07 pm    Post subject:
Reply with quote

thanks .. Its working ..icon_smile.gif
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 syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm


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