Joined: 26 Apr 2004 Posts: 4650 Location: Raleigh, NC, USA
Either way. A lot depends on whether the COBOL program is in the same job or in a different job. Certainly, reading the COUNT information in from either the SYSIN DD (via ACCEPT) or as a dataset (via READ) is easier to implement and is probably logically easier for someone else to follow.
I am a fresher in mainframe. I am learning about Sort in JCL and I learnt that there are two ways to find the number of records,
(a) COUNT FROM(OFILE1)
This is not working.
(b) COUNT FROM(OFILE1) USING(SEP2)
Here I am once again getting a blank data set as in above case.
Here is the code I have done,is it correct?
//TOOLIN DD *
COUNT FROM(OFILE1) USING(SEP1)
//SEP1CNTL DD *
//* ofile1 is a data set
By finding COUNT using this technique will be tedious and expensive to use it in COBOL.
Here OUTFILE is declared as
//OUTFILE DD SYSOUT=*
So the count value is displayed in the console which is of no use.
If I put some dataset name it gives the error as OUTFILE is not suitable for report, sorry to put another question here, is there any possibility to generate a report in to a dataset.
These are the 2 methods I have used so far, is there any other method to achieve the Count of records ? let me know.
As you answered, we can send count values using SYSIN DD *, how do you map the value you found to the value to be sent,i.e.,
If you put
//SYSIN DD *
It will accept this as string COUNT rather than the COUNT value. I have the same doubt for PARM also, how to do that, is there any possibility of moving values in JCL just like another programming language or any pass by reference method to access the value stored by JCL using address in COBOL.