View previous topic :: View next topic
|
Author |
Message |
raki_new
New User
Joined: 10 Feb 2009 Posts: 26 Location: chennai
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2596 Location: Silicon Valley
|
|
|
|
Can you post your code? |
|
Back to top |
|
|
raki_new
New User
Joined: 10 Feb 2009 Posts: 26 Location: chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
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 |
|
|
raki_new
New User
Joined: 10 Feb 2009 Posts: 26 Location: chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
Back to top |
|
|
raki_new
New User
Joined: 10 Feb 2009 Posts: 26 Location: chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
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 |
|
|
raki_new
New User
Joined: 10 Feb 2009 Posts: 26 Location: chennai
|
|
|
|
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 |
|
|
raki_new
New User
Joined: 10 Feb 2009 Posts: 26 Location: chennai
|
|
|
|
Any replies for my question ?? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
raki_new
New User
Joined: 10 Feb 2009 Posts: 26 Location: chennai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
So You went back to the original requirement...
use the jcl I gave You as a sample ! |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You can also use IEBCOPY.
O. |
|
Back to top |
|
|
raki_new
New User
Joined: 10 Feb 2009 Posts: 26 Location: chennai
|
|
|
|
thanks .. Its working .. |
|
Back to top |
|
|
|