HP3000-L Archives

March 2002, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tom Emerson <[log in to unmask]>
Reply To:
Tom Emerson <[log in to unmask]>
Date:
Wed, 13 Mar 2002 08:56:50 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (85 lines)
> -----Original Message-----
> From: Richard Barker
> I'm far from a Cobol expert and will replace this 7000 lines of
> Cobol with a 300 line Powerhouse one, as soon as possible, but
> until that happens this has to work.
>
> ... I am still getting this '9G' error, which as Roy correctly
> points out is 'too many files open'.... the files are always
> closed, before being opened again, so this doesn't make any sense to me.
>
> The latest example is where a file is built and then file equated to,
> opened, records are written and then it is closed.

Something tickling the back of my mind is screaming "really bad design!"
Are you doing an FOPEN, writing ONE SINGLE RECORD, then an FCLOSE?
[presumably, inside a loop? for up to 25000 times?]

> build
> /TRANSFER/HP/billing/cptjo/CPTJOERU2002021620020228;rec=-98,2,
> F,ASCII;DISC=25000
> .
> open extend cptjo-file.
> write cptjo-record.
> close cptjo-file.
[then later...]
> open extend cptjo-file.
> write cptjo-record.
> close cptjo-file.
> open extend cptjo-file.

> Unable to open CPTJO - Status : 9G
> Filename: AGBILL
[...]
> !  FILE NAME IS AG1178.TEMP.VIRGIN               !

Umm, these names don't match: AGBILL <> AG1178.TEMP [so I presume "AGBILL"
is an internal name as known to the program] and further, this isn't the
CPTJO file [so I'm also presuming this is a "cascade error" -- it only
occurs because the first problem happened...]

How many DIFFERENT files does this program deal with?  If it is less than
1,000 files, Can the program logic be reorganized more like this:

 PROCEDURE DIVISION.

     PERFORM INITIALIZATION.
     PERFORM PROCESSING UNTIL DONE.
     PERFORM CLEANUP.
     STOP RUN.

 INITIALIZATION.

     EXTEND CPTJO.
     IF CPTJO-STATUS = "00"
        MOVE "Y" TO CPTJO-IS-OPEN-FLAG.

     OPEN AGBILL.
     IF AGBILL-STATUS = "00"
        MOVE "Y" TO AGBILL-IS-OPEN-FLAG.

     open other files...
     MOVE "N" TO DONE-FLAG.

 CLEANUP.

     IF (CPTJO-IS-OPEN)
        CLOSE CPTJO.
     IF (AGBILL-IS-OPEN)
        CLOSE AGBILL.
     etc.

(and of course, "processing" does whatever is needed, writing when
neccessary, and sets the "DONE-FLAG" when complete...)

This way, the number of FOPENS per file is reduced to one.  You don't lose
anything by having a file "open" yet dormant or unused throughout the
majority of the program run, in fact, you gain time as each FOPEN is a
COSTLY operation in terms of computer time [I think it used to be 500ms on
older classic machines, dunno how long it takes nowadays -- 25,000 FOPENS
could take 12,500 SECONDS to process, guaranteeing your program would take
AT LEAST 3 and a half HOURS to process]

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2