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:
Jack Connor <[log in to unmask]>
Reply To:
Jack Connor <[log in to unmask]>
Date:
Tue, 15 May 2007 06:55:29 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (134 lines)
Just my two cents worth, but over the years I've had no problems having
both the COBBOL OPEN/READ/WRITE etc as well as FOPEN/FREAD/FCONTROL in
the same program.

In the OMNISPOOLER/INFONET/OMNIMONITOR products, I used FOPEN'd message
files to enable s/w interrupts, and other than determining the PLABEL in
COBOL, it worked without a hitch.

I wouldn't recommend using Fintrinsics against COBOL controlled files,
but, per the doc, it can be done...

Jack 

-----Original Message-----
From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On
Behalf Of Brian Donaldson
Sent: Tuesday, May 15, 2007 9:48 AM
To: [log in to unmask]
Subject: Re: [HP3000-L] Cobol OPEN vs FOPEN Intrinsic Conflict Problem

Unfortunately, the app is doing AIF stuff which needs to be done in a
non-Cobol language (like Pascal or "C") -- they cannot be done in Cobol.

So the easiest solution was to FOPEN a temp file and pass the file
number to the Pascal sub for AIF processing. 

I've always preferred the FOPEN/FREAD/FWRITE intrinsics opposed to
Cobol's OPEN/READ/WRITE simply because the intrinsics return more
intelligent error codes than the standard Cobol calls do.

Anyway, now the program works just fine, that is, until the next problem
rears its ugly little head.

Brian.


On Tue, 15 May 2007 09:17:27 +0100, Robert Mills
<[log in to unmask]> wrote:

>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 *

* 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