Reading sequential files in COBOL vs SQL - IBM AS400

This is a discussion on Reading sequential files in COBOL vs SQL - IBM AS400 ; Hi everyone, I'm writing an OPM COBOL program that needs to process a large number of sequential files (around 4,000 records). It's a parsing algorithm that needs to find a few records at an unpredictable location in the file. Obviously ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Reading sequential files in COBOL vs SQL

  1. Reading sequential files in COBOL vs SQL

    Hi everyone,

    I'm writing an OPM COBOL program that needs to process a large number
    of sequential files (around 4,000 records). It's a parsing algorithm
    that needs to find a few records at an unpredictable location in the
    file. Obviously in COBOL I'd having to allow for reading a high
    percentage of the records in each of the files.

    Alternativey I could embed the SQL.code inside of the COBOL.

    Which would be faster? Is the answer obvious or should I test it both
    ways. Would the relative speed depend on other factors, ie size of
    computer, memory, hard disk and OS400 version? The program will be run
    on many different machines.

    Thanks

    Elliot


  2. Re: Reading sequential files in COBOL vs SQL

    Elliot writes:

    > I'm writing an OPM COBOL program that needs to process a large number
    > of sequential files (around 4,000 records). It's a parsing algorithm
    > that needs to find a few records at an unpredictable location in the
    > file. Obviously in COBOL I'd having to allow for reading a high
    > percentage of the records in each of the files.


    To me it sounds like an SQL query will need to do a full table scan
    anyway to figure out which records you want, and then the workload is
    most likely the same.

    You might benefit if you can create an index that allow you to pick
    the interesting ones right away.
    --
    Thorbjørn Ravn Andersen

  3. Re: Reading sequential files in COBOL vs SQL

    Do you mean that your desired records always align on record
    boundaries, but you just don't know what record number / row number
    they will be at? Or could the data you want be split across multiple
    records / rows? The processing required is quite different depending
    on your answer.


+ Reply to Thread