View previous topic :: View next topic
|
Author |
Message |
sjothimani
New User
Joined: 04 Apr 2006 Posts: 10
|
|
|
|
hi..........
can I read a PS sequentially through a JCL step and use the records in the other step of the same JCL for processing.
say,
The PS has the list of members present in a PDS and by reading it sequentially in a step, pass the records in to the second step where I ill use the IEBCOPY utility and copy the members from one PDS to other.
MAIN.SOURCE.PS - has the list of all the members in the source PDS
MAIN.SOURCE.PDS(<RECORD READ FROM THE PS>)
(TO)
MAIN.DEST.PDS(<RECORD READ FROM THE PS>)
thanks
ram |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Sure. There should be no real issues doing what you want. |
|
Back to top |
|
|
sjothimani
New User
Joined: 04 Apr 2006 Posts: 10
|
|
|
|
thanks to you,
I hope we can do it with a COBOL program but iam not sure whether I can do it without a COBOL pgm, if so can U pls tell me the steps.Even with the cobol program i am not sure whether we can pass the records which we had read from the seq.file to the second JCL step as an input. I need it purely done by a JCL without using any pgm language.
thanks
ram |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
your rec output from your cobol pgm is in the format of the utility control statements
this output file then becomes your sysin for the utility step |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
STEP1: Read the member list and build the appropriate IEBCOPY SELECT commands:
input dataset contents:
Code: |
MEM1
MEM2
MEM4
MEM9
|
output dataset (STEP1.OUTPUT) contents:
Code: |
SELECT MEMBER=(MEM1)
SELECT MEMBER=(MEM2)
SELECT MEMBER=(MEM4)
SELECT MEMBER=(MEM9)
|
STEP2: Use the SELECT contents from STEP1 as the input to the IEBCOPY program:
Code: |
//STEP1 EXEC PGM=IEBCOPY
//PDS1 DD DISP=SHR,DSN=MY.PDS.INPUT
//PDS2 DD DISP=SHR,DSN=MY.PDS.OUTPUT
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
COPY INDD=((PDS1,R)),OUTDD=PDS2
/*
// DD DSN=STEP1.OUTPUT,DISP=SHR
//*
|
|
|
Back to top |
|
|
sjothimani
New User
Joined: 04 Apr 2006 Posts: 10
|
|
|
|
hi superk,
thanks to Ur reply. Thing is like, the first issue that is "how to read a PS which has the actual list of members and use it one by one seperately for each and every IEBCOPY operation" also i do have a massive list of 32000 records inside the PS and I dont know how to do the IEBCOPY operation in an itterative manner with all the records(members) read from the PS.
thanks
ram |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Let me see if I understand this correctly. You have a sequential dataset with a list of 32000 member names. You want to read one member name at a time, and then run IEBCOPY (for a total of 32000 executions) to copy that member from one PDS to another. And, for some reason, you don't want to just copy all of the 32000 members in one single IEBCOPY step.
Am I understanding your requirement correctly? |
|
Back to top |
|
|
sjothimani
New User
Joined: 04 Apr 2006 Posts: 10
|
|
|
|
thanks to U,
ya i have a PS consisting of 32000 members list, and what i need to do is, i have to read the PS and i need to do a selective copy of members from the source PDS to the destination PDS respective to the list in the PS. It can eigther be a seqential or a batch manner, that is not at all a factor. Actually i dont know whether it can be done in a batch(at a streach all the members) manner, thats why i asked for a sequential way. Also it ill realy be helpfull if U give me any hint of how to do this purely in JCL alone and not with any of the programming languages.
thanks
ram |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
if this is a one time effort, simply create a new jcl member in ISPF, copy the memberlist dataset into it and prefix the relative SELECT syntax and append the trailing SELECT syntax.
add the appropriate JCL to the beginning along with the copy stmt as shown in a previous post and submit the job |
|
Back to top |
|
|
|