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
 

 

How to read records sequentially in JCL?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
husj

New User


Joined: 05 Sep 2005
Posts: 12
Location: P.R.C

PostPosted: Wed Jan 04, 2006 1:54 pm    Post subject: How to read records sequentially in JCL?
Reply with quote

Hi,

Can JCL complete following function?

1. read one record in FILEA,
2. run PROGRAMA(COBOL) with the record as input,
3. run PROGRAMB(COBOL) with the record as input,
4. read next record in FILEA,
5. if at end, run PROGRAMC(COBOL).

Thanks

Jerry
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Jan 04, 2006 4:06 pm    Post subject:
Reply with quote

JCL by itself can't read anything. It's just CONTROL LANGUAGE. You need some utility or program to do that.

O.
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Wed Jan 04, 2006 7:07 pm    Post subject: Re: How to read records sequentially in JCL?
Reply with quote

I agree with ofer71's comment. JCL does not read and process records. You would need a program to handle that. I would also add that this process would make more sense to do with a program rather than a batch job.

That being said, yes, theoretically you could do this as a batch process:

1. read one record in FILEA.

You would need to, as mentioned before, use a program to accomplish this. You would obviously need to provide a value to the program, each time it is called, of which record number to start the read on. This program will also need to set a Return-Code value when the End-Of-File condition is found, to meet your requirement for Step 5. The one record should be copied to a temporary dataset for use by the subsequent steps.

2. run PROGRAMA(COBOL) with the record as input.

Yes, using the temporary dataset from Step1 as the input.

3. run PROGRAMB(COBOL) with the record as input.

Yes, same as above.

4. read next record in FILEA.

At this point, you would need to make a decision of how to continue. You could code more job steps to repeat the process of steps1-3 as needed, changing the value for the starting record each time, if there are not a substantial amount of records to process. Otherwise, you might want to submit a new job for each record to be processed, again, providing an input value to each for the record number to process.

5. if at end, run PROGRAMC(COBOL).

This would use the Return-Code value from Step1 to run only on the End-Of-File condition.
Back to top
View user's profile Send private message
husj

New User


Joined: 05 Sep 2005
Posts: 12
Location: P.R.C

PostPosted: Thu Jan 05, 2006 7:59 am    Post subject: Re: How to read records sequentially in JCL?
Reply with quote

Hi,superk and ofer71,

Thanks for your help.But I am not sure how to write looping statement to repeat step1 to step3 in JCL .
And how to change the value of record number to start read. I just know the SYSIN DD that used a constant for the parameter, but the record number should be a variable.

regards

Jerry
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 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
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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