On Mon, Sep 12, 2016 at 11:03 AM, Paul Gilmartin <
[email protected]> wrote:

> On 2016-09-12, at 09:17, Farley, Peter x23353 wrote:
> >
> > Another alternative might be if the vendor can send XML files instead of
> CSV.  COBOL V3.4 can process XML files (XML PARSE statement), and that
> might or might not be more efficient than UNSTRING.
> >
> Infrequently, I receive a (small) .doc(x) file.  I open it with
> LibreOffice, save it as HTML, and parse the HTML with awk.
> (XML might have been a better choice.)
>
> There must be a CSV-to-XML translator available at an attractive price.
>
> -- gil
>
>
​Well, I thank everyone for their thoughts.

I did a quick review of the COBOL code with the programmer. I noticed that,
for his ease, he has the file defined as RECORD LENGTH VARIES FROM 1 TO
32760 CHARACTERS. But he did not have APPLY WRITE-ONLY. This caused every
COBOL WRITE to write only once record as a physical block. I recommended
that he see what APPLY WRITE-ONLY would do for him, since this helps with
efficiently writing variable blocked files. He did that and his run time
dropped to less that 1/3 of of the test without that phrase. I.e. his test
went from 45 minutes to less tha​n 15 minutes and the CPU time had even a
greater reduction. He also noticed that subsequent SORT (into key order)
ran much faster. So he is basically a happy camper with his result using
the COBOL UNSTRING now. Just shows that you need to attack the correct
problem (disk I/O, access method overhead).


-- 
Unix: Some say the learning curve is steep, but you only have to climb it
once. -- Karl Lehenbauer
Unicode: http://xkcd.com/1726/

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to