HP3000-L Archives

May 2007, Week 3

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:
Robert Mills <[log in to unmask]>
Reply To:
Robert Mills <[log in to unmask]>
Date:
Tue, 15 May 2007 09:17:27 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (87 lines)
When I first started programming in Cobol on the 3000 I was given
several rules. One of which was:

"DO NOT use a mixture of FOPEN (intrinsic) and OPEN (Cobol) statements.
'One or the other' otherwise you can/will break your
program/application".

I have followed this rule for 27 years and have never been let down by
it. It is also one that I've passed on to programmers who were new to
the 3000. 

This is something that I thought was common knowledge!!! OR wasn't it??


regards, 
  
Robert W.Mills 
Systems Development Manager 
Pinnacle Arvato 
(020) 8309 3604 


-----Original Message-----
From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On
Behalf Of Brian Donaldson
Sent: 14 May 2007 21:24
To: [log in to unmask]
Subject: [HP3000-L] Cobol OPEN vs FOPEN Intrinsic Conflict Problem

This is really just an FYI as I doubt the deadbeat assassins at HP will
ever fix this problem......

Recently, I discovered a big boo boo that apparently only happens
intermittently.

I have a Cobol/Vplus app that uses the standard Cobol
SELECT/FD/l/OPEN/READ/WRITE/REWRITE etc statements. It also uses the
MPEiX FOPEN/FWRITE intrinsics. Although it is inside a Vplus app I don't
think the problem is Vplus but is with the MPEiX file system
itself......

With the Cobol OPEN statement I access a file named "PAGE026" (temp
KSAMXL file) and a flat MPE file named "GGALFILE" opened as a NEW file
with FOPEN (foptions=4, aoptions=%305).

The program file number from the FOPEN is passed to a Pascal sub which
uses AIF's to get a bunch of data and then FWRITEs that data to the
"GGALFILE" file. Works fine. When Pascal returns to the calling Cobol
program the "GGALFILE" is read sequentially and data is written to the
"PAGE026" file via Cobol's WRITE statement. This also appears to work ok
with no problems.

So then the program FCLOSE's the "GGALFILE" with a disposition of 4
(close file and purge file off system). Does *not* fine!! Guess what?
It just closed and whacked the "PAGE026" file instead of the "GGALFILE"
file....

The "PAGE026" was closed and purged off the system!!!

I fixed the problem by replacing the Cobol OPEN/WRITE of the "PAGE026"
file with "FOPEN" of this file. The problem then went away.

After the "GGALFILE" was FCLOSE'd with a disposition of 4 the "PAGE026"
was still there ok, and processing on it could continue.......

Nasty little problem that I have never encountered before in all of my
99 years of programming on the world's greatest computer system (that's
the HP3000 if you haven't already figured that one out)

Interesting point here is that way back in the 90's I also encountered a
similar problem that I reported to HP at the time. No idea if it was
ever fixed or not. 

I had a Cobol program that used FOPEN and HPFOPEN in the same program. 
What was happening was that FOPEN and HPFOPEN were returning the same
file number on different files!

So it goes.........

Brian Donaldson.

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

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

ATOM RSS1 RSS2