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:
John Zoltak <[log in to unmask]>
Reply To:
John Zoltak <[log in to unmask]>
Date:
Thu, 21 May 1998 14:46:00 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (54 lines)
You can pass a file number to a COBOL sub-program using a BY CONTENT
parameter.
----- main ------
main-program
   open my-file for output.

   call "cobol-sub" using by content my-file.
----- cobol sub ------
linkage section
01 f pic s9(4) comp.
cobol-sub using f.
   display "file number = ", f.
   goback

As others have pointed out, you can easily pass a file number to an
intrinsic that expected a by value parameter, like "ASCII". This is the
way to do it if you want all COBOL. And no, you can't MOVE MY-FILE to
my-file-number. I tried, it doesn't work. Note also that the receiving
parameter has to be a 16 bit integer.

John Zoltak
North American Mfg Co


> -----Original Message-----
> From: Michael Anderson [SMTP:[log in to unmask]]
> Sent: Thursday, May 21, 1998 8:16 AM
> To:   [log in to unmask]
> Subject:      [HP3000-L] MPE Filenumber of a COBOL FD.
>
> 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 << File: GETFD.txt >>  << File:
> Calling Program Example.txt >>

ATOM RSS1 RSS2