IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

can I read a PS sequentially through JCL step


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sjothimani

New User


Joined: 04 Apr 2006
Posts: 10

PostPosted: Mon Apr 17, 2006 7:51 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon Apr 17, 2006 8:43 pm
Reply with quote

Sure. There should be no real issues doing what you want.
Back to top
View user's profile Send private message
sjothimani

New User


Joined: 04 Apr 2006
Posts: 10

PostPosted: Mon Apr 17, 2006 8:59 pm
Reply with quote

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
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Mon Apr 17, 2006 9:47 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon Apr 17, 2006 9:58 pm
Reply with quote

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
View user's profile Send private message
sjothimani

New User


Joined: 04 Apr 2006
Posts: 10

PostPosted: Tue Apr 18, 2006 11:06 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Tue Apr 18, 2006 5:42 pm
Reply with quote

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
View user's profile Send private message
sjothimani

New User


Joined: 04 Apr 2006
Posts: 10

PostPosted: Tue Apr 18, 2006 5:58 pm
Reply with quote

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
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Apr 18, 2006 7:16 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
Search our Forums:

Back to Top