How to pass input sequential file through JCL to Cobol Subpr



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

How to pass input sequential file through JCL to Cobol Subpr

Postby gouravar » Wed Jul 30, 2014 12:15 am

I have a requirement as below
Cobol Program P1 is calling Cobol subprogram S1 And Subprogram require sequential file as an input. Please advice how i can pass sequential file from JCL of Main program P1 to the Subprogram S1.

Also is there any other way to meet this requirement ?

Thanks in Advance..
gouravar
 
Posts: 7
Joined: Tue Jun 12, 2012 10:36 pm
Has thanked: 3 times
Been thanked: 0 time

Re: How to pass input sequential file through JCL to Cobol Subpr

 

Re: How to pass input sequential file through JCL to Cobol S

Postby BillyBoyo » Wed Jul 30, 2014 12:37 am

You don't have to do anything. In your sub-program, you need to know when to open the file, process the file and close the file. The main program does not need to know a thing (unless you want it to) and the JCL is for everthing in the run-unit, not just the main program.

These users thanked the author BillyBoyo for the post:
gouravar (Wed Jul 30, 2014 12:48 am)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to pass input sequential file through JCL to Cobol S

Postby Terry Heinze » Wed Jul 30, 2014 12:42 am

If your subprogram needs only parts of some of the records of the file, you can get those parts using the main program and pass that data to the subprogram via the Linkage Section. If you want the entire file, do as BillyBoyo said.
.... Terry

These users thanked the author Terry Heinze for the post:
gouravar (Wed Jul 30, 2014 12:48 am)
Terry Heinze
 
Posts: 193
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 10 times
Been thanked: 11 times

Re: How to pass input sequential file through JCL to Cobol S

Postby gouravar » Wed Jul 30, 2014 12:47 am

Terry, my requirement is to read the entire file. I will try as BillyBoyo suggested. Thanks for your quick responses. You guys are really appreciable..
gouravar
 
Posts: 7
Joined: Tue Jun 12, 2012 10:36 pm
Has thanked: 3 times
Been thanked: 0 time

Re: How to pass input sequential file through JCL to Cobol S

Postby Terry Heinze » Wed Jul 30, 2014 1:09 am

Sometimes I depreciate. :lol:
.... Terry
Terry Heinze
 
Posts: 193
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 10 times
Been thanked: 11 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post