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
 

 

can I read a PS sequentially through JCL step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: can I read a PS sequentially through JCL step
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

Moderator Team Head


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

PostPosted: Mon Apr 17, 2006 8:43 pm    Post subject: Re: can I read a PS sequentially through JCL step
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    Post subject: Re:can I read a PS sequentially through JCL step
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: 247
Location: Cincinnati OH USA

PostPosted: Mon Apr 17, 2006 9:47 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Mon Apr 17, 2006 9:58 pm    Post subject: Re: can I read a PS sequentially through JCL step
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    Post subject: Re: can I read a PS sequentially through JCL step
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

Moderator Team Head


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

PostPosted: Tue Apr 18, 2006 5:42 pm    Post subject: Re: can I read a PS sequentially through JCL step
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    Post subject: Re: can I read a PS sequentially through JCL step
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: 247
Location: Cincinnati OH USA

PostPosted: Tue Apr 18, 2006 7:16 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Read of TDQ fails in LENGERR Tracy Hansen CICS 10 Wed Apr 05, 2017 12:10 am


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