View previous topic :: View next topic
|
Author |
Message |
naveenmsc
New User
Joined: 28 Dec 2003 Posts: 4 Location: visakhapatnam
|
|
|
|
1) How can I copy only one member in PDS file to another member
2) how can I redirect the data of a PDS Memeber to Spool. |
|
Back to top |
|
|
sandip_datta
Active User
Joined: 02 Dec 2003 Posts: 150 Location: Tokyo, Japan
|
|
|
|
Hi naveenmsc,
1) Use following code. I think it will help.
Code: |
//COPY EXEC PGM=IDCAMS
//IN DD DSN=INPUT....PDS(INMEMBER),DISP=SHR
//OUT DD DSN=OUTPUT...PDS(OUTMEMBER),DISP=SHR
//SYSIN DD *
REPRO INFILE(IN) OUTFILE(OUT)
//SYSOUT DD SYSOUT=*
//*
|
INPUT....PDS and OUTPUT....PDS can be same.
2) Can you please try following code -
Code: |
//COPY EXEC PGM=IDCAMS
//IN DD DSN=INPUT....PDS(INMEMBER),DISP=SHR
//OUT DD SYSOUT=*
//SYSIN DD *
REPRO INFILE(IN) OUTFILE(OUT)
//*
|
Please reply if these works good.
Regards,
Sandip. |
|
Back to top |
|
|
anuradha
Active User
Joined: 06 Jan 2004 Posts: 247 Location: Hyderabad
|
|
|
|
Hi Naveen,
If Iam not wrong, you can use IEBGENER utility to copy only one member of a pds to other.You can go for IDCAMS if it is related to VSAM.
Mentioning the member name along with its pds in SYSUT1 step and destination in SYSUT2 step you can copy the required member
If something is wrong in what I said please someone correct me.
THANKS AND REGARDS
ANURADHA |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
You can also use IEBCOPY, batch FileAid, and God knows what else.
Regards, Jack. |
|
Back to top |
|
|
harikrishnanrajeev
EXPERT
Joined: 28 Jan 2004 Posts: 37 Location: Trivandrum
|
|
|
|
Hello all,
I have a small doubt, i don't know whether i am right. Pls correct me if i am wrong.
In the case of IEBGENER , the first SYSUT1 cannot be a PDS Member. It has to be sequential.
I saw Anuradha's posting that IEBGENER can be used to copy a member of a PDS to a member of another PDS.
I am bit confused. Hope somebody can clear it.
regards
Hari. |
|
Back to top |
|
|
Sharan
New User
Joined: 22 Dec 2003 Posts: 6 Location: Banaglore
|
|
|
|
Hello Hari,
In IEBGENER we can have SYSUT1 as a PDS member or as a PS. SYSUT2 again can either be a PDS member or a PS. The following piece of code copies a PDS member to another PDS member.
Code: |
//***************** JOB CARD ********************
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=PDS1(MEM1),
// DISP=SHR
//SYSUT2 DD DSN=PDS2(MEM2),
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(2,2,1),RLSE),
// DCB=(PDS1)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
|
However copying members from one PDS to another PDS is much simpler with the utility IEBCOPY. It gives you various options which cannot be handled by IEBGENER.
Thanks,
Sharan |
|
Back to top |
|
|
prasad_yadav20
New User
Joined: 12 Mar 2005 Posts: 13 Location: hyderabad
|
|
|
|
hi friend u said using IEBGENER we can copy one pds member to another pds member i think this is only for copying one ps to another ps only.pls clarify my doubt
Sharan wrote: |
Hello Hari,
In IEBGENER we can have SYSUT1 as a PDS member or as a PS. SYSUT2 again can either be a PDS member or a PS. The following piece of code copies a PDS member to another PDS member.
Code: |
//***************** JOB CARD ********************
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=PDS1(MEM1),
// DISP=SHR
//SYSUT2 DD DSN=PDS2(MEM2),
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(2,2,1),RLSE),
// DCB=(PDS1)
//SYSIN DD DUMMY
//SYSUDUMP DD SYSOUT=*
|
However copying members from one PDS to another PDS is much simpler with the utility IEBCOPY. It gives you various options which cannot be handled by IEBGENER.
Thanks,
Sharan |
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Sharan's answer is correct. |
|
Back to top |
|
|
sandhyaragav
New User
Joined: 05 Apr 2006 Posts: 14
|
|
|
|
Hi,
Can you please let me know.
How to copy the member of a pds to a NEW member of an existing pds
without using the sysin parameter.
I have tried out the solution provided by Sandip. But this does not
work for creating a new member in an existing pds.
It gives an error saying that the new member does not exist( which is obviously coz the new member does not exist and we have given DISP=SHR for the destination pds).
Please suggest.
Regards
Sandhya |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I don't know what you've tried, but for a simple COPY function, the IEBGENER program is usually used. I don't know why you would get an error, since the only two possible DISPOSITION options for a PDS are SHR or OLD. You can't specify NEW because the target PDS already exists, and DISP=MOD processing is mutually exclusive for a PDS.
Code: |
//STEP0001 EXEC PGM=IEBGENER
//SYSUT1 DD DISP=SHR,DSN=INPUT.PDS(MEMBER1)
//*
//SYSUT2 DD DISP=SHR,DSN=OUTPUT.PDS(MEMBER2) or
//SYSUT2 DD DISP=OLD,DSN=OUTPUT.PDS(MEMBER2)
//*
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*
|
- Or -
Code: |
//STEP0001 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=INPUT.PDS(MEMBER1)
//*
//SORTOUT DD DISP=SHR,DSN=OUTPUT.PDS(MEMBER2) or
//SORTOUT DD DISP=OLD,DSN=OUTPUT.PDS(MEMBER2)
//*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
/*
|
works whether MEMBER2 already exists or not.
Also, if you're working exclusively with PDS's, you may want to use the IEBCOPY program as an alternative. |
|
Back to top |
|
|
unni_nss
New User
Joined: 20 Sep 2005 Posts: 19
|
|
|
|
hi sandhya,
the IEBGENER is usually copies from PS to PS and also from a PDS(Containing one memeber) to another PS.But now i came to know that using IEBGENER also u can copy a memeber of PDS to PDS by specifying the particular memebe name in the JCL step.But in all these cases the memeber shul exist.But we can create a new member by using IEBUPDTE and same time we can give some inputs this also.
correct me if i am wrong in this context! |
|
Back to top |
|
|
GeneNorman
New User
Joined: 26 May 2006 Posts: 8 Location: Madison, Wisconsin USA
|
|
|
|
The point that you all seem to be missing is this: When you specify a PDS member in JCL using the DATA.SET(MEMBER) format the operating system treats it as if it were a sequential (ps) dataset. You can substitute a member for any input or output sequential dataset with the same lrecl. |
|
Back to top |
|
|
jinal_mca
New User
Joined: 05 Jan 2007 Posts: 22 Location: Pune, India
|
|
|
|
Ur first question is
1) How can I copy only one member in PDS file to another member
Utility named IEBCOPY is used to copy member of pds to pds.
Utility named IEBGENER is used to copy Ps to Ps.
If u need syntax also then let m know.
cya |
|
Back to top |
|
|
|