HP3000-L Archives

May 1998, 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:
Michael Anderson <[log in to unmask]>
Reply To:
Date:
Thu, 21 May 1998 12:15:51 +0000
Content-Type:
multipart/mixed
Parts/Attachments:
text/plain (768 bytes) , GETFD.txt (559 bytes) , Calling Program Example.txt (657 bytes)
What's the most common method being used, to get the MPE file number, of
a file opened using the COBOL OPEN verb.

Years ago, (On the the Classic HP3000) I wrote a routine called GETFD.
When upgrading to the 32 bit MPE/iX, I was concerned that this routine
would not work. However, running everything in compatibility mode it
does work.

I am currently recompiling many applications to Native mode. I have no
reason to believe that GETFD will not work in Native Mode, I just think
that MPE/iX 5.5 pp4 may offer a better (More reliable) solution.   I
have attached a copy of GETFD, and an example from a calling program. If
anyone knows a better way to get the FD's file number, please let me
know.

Thanks in advance,
Michael Anderson
TIW Corporation
Houston, Texas (713) 729-2110 Ext.287


$CONTROL LIST,BOUNDS,DYNAMIC  IDENTIFICATION DIVISION.  PROGRAM-ID. GETFDF.  AUTHOR. MICHAEL ANDERSON. * - TIW SYSTEMS ROUTINE - RETURNS 'FD' FILE NUMBER *  DATA DIVISION.  WORKING-STORAGE SECTION.  01 X PIC S9(4) COMP VALUE 0.  LINKAGE SECTION.  01 FILENUM PIC S9(4) COMP.  01 FDNAME PIC S9(4) COMP.  PROCEDURE DIVISION USING FILENUM FDNAME.  0000-BEGIN.      MOVE ZERO TO FILENUM.      CALL INTRINSIC ".LOC." USING @FDNAME GIVING X.      COMPUTE FILENUM = ( X / 2 ).      GOBACK.
The calling program code looks like this: PRINTER definition:  FILE-CONTROL.      SELECT PRINTER ASSIGN TO "PRINTER,,,LP(CCTL)"             FILE STATUS IS PRINTER-STATUS.  DATA DIVISION.  FILE SECTION.  FD PRINTER RECORD CONTAINS 80 CHARACTERS               DATA RECORD IS LP-REC.  01 LP-REC PIC X(80). PROCEDURE CODE: *------>> Open the printer file and get the FD file number from * the operating system, using the "GETFDF" sub-routine.      OPEN OUTPUT PRINTER.      IF PRINTER-STATUS NOT = "00" PERFORM 9001-FILE-ERROR.      MOVE "01" TO PRINTER-FLAG.      CALL "GETFDF" USING FNUM \PRINTER\.      MOVE FNUM TO PRINTER-FNUM. -----------

ATOM RSS1 RSS2