Subject: | |
From: | |
Reply To: | |
Date: | Thu, 21 May 1998 14:46:00 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
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 >>
|
|
|