Page 1 of 1

Job calling cobol running for long time

Posted: Wed May 04, 2016 10:51 am
by nitika
Basically my program logic revolves around 4 KSAM files(Index files) out of which 1 file will act as input and getting write/rewrite based on keys matched/unmatched

from other 3 files, will try to explain more below -

Its reading one file and getting the key which will get match with keys of other three, as i said if it matches with that one particular record will be rewritten in

that file and if not while matching with other file it will a new record write in that file.

Like wise it will happen for other 2 files as well and match with that one file to deicde if its write/rewrite of a record.

Initially, I have coded all the three READ scenario and matching logic in one cobol which never ended when i ran job because everytime while going to next read

scenario I have close the file and open it again as EOF file is set at above read, so I tried splitting cobol in to three separate read.

Anyone have suggestion on it, please share.

Posted: Thu May 05, 2016 3:27 pm
by William Collins
Is the program eventually to run on a Mainframe? KSAM is not a Mainframe dataset-type.

Doing lots of keyed reads will take lots of time. You should test your program with very small files, so that you know the program logic works, before using bigger files.

You should be doing keyed reads, not serially searching files (so EOF not found, no need to CLOSE and re-OPEN).

Posted: Mon May 09, 2016 6:01 pm
by dbzTHEdinosauer
if on mainframe aned the keyed files are vsam, why not unload each to a qsam file,
in order of the primary key of the primary file,
and process this stuff as qsam, output qsam and use SORT to reload the qasm to vsam.