Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Real Users never use the Help key.


computers / comp.sys.tandem / Re: How to check if a file is OPEN

SubjectAuthor
* How to check if a file is OPENAdam Kamal
+* Re: How to check if a file is OPENKeith Dick
|+* Re: How to check if a file is OPENJShepherd
||`* Re: How to check if a file is OPENRich S.
|| +- Re: How to check if a file is OPENAdam Kamal
|| `* Re: How to check if a file is OPENAdam Kamal
||  +- Re: How to check if a file is OPENKeith Dick
||  `* Re: How to check if a file is OPENKeith Dick
||   `- Re: How to check if a file is OPENAdam Kamal
|`- Re: How to check if a file is OPENAdam Kamal
`- Re: How to check if a file is OPENRich S.

1
How to check if a file is OPEN

<0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=185&group=comp.sys.tandem#185

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a37:6f05:: with SMTP id k5mr1136578qkc.497.1623896675075;
Wed, 16 Jun 2021 19:24:35 -0700 (PDT)
X-Received: by 2002:a25:dfd0:: with SMTP id w199mr2937570ybg.337.1623896674763;
Wed, 16 Jun 2021 19:24:34 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Wed, 16 Jun 2021 19:24:34 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=50.204.224.200; posting-account=0NHiHgoAAAC-mY8P0yk1bd3zDKN8t6jB
NNTP-Posting-Host: 50.204.224.200
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com>
Subject: How to check if a file is OPEN
From: abolk...@gmail.com (Adam Kamal)
Injection-Date: Thu, 17 Jun 2021 02:24:35 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Adam Kamal - Thu, 17 Jun 2021 02:24 UTC

in a Cobol program, how would you determine/check if enscribe file is open?
I used COBOLFILEINFO and OPENINFO but it does not seem to return the proper code if a file is opened by another process. Any hint will be highly appreciated.

Re: How to check if a file is OPEN

<03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=186&group=comp.sys.tandem#186

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a37:c447:: with SMTP id h7mr1877468qkm.63.1623905524508;
Wed, 16 Jun 2021 21:52:04 -0700 (PDT)
X-Received: by 2002:a25:6f55:: with SMTP id k82mr3586213ybc.490.1623905524250;
Wed, 16 Jun 2021 21:52:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Wed, 16 Jun 2021 21:52:03 -0700 (PDT)
In-Reply-To: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.42.228.104; posting-account=Lua_ZwoAAADivbVXQF8uKE7dZSUNm9vj
NNTP-Posting-Host: 98.42.228.104
References: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com>
Subject: Re: How to check if a file is OPEN
From: rkd...@gmail.com (Keith Dick)
Injection-Date: Thu, 17 Jun 2021 04:52:04 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Keith Dick - Thu, 17 Jun 2021 04:52 UTC

On Wednesday, June 16, 2021 at 7:24:35 PM UTC-7, abol...@gmail.com wrote:
> in a Cobol program, how would you determine/check if enscribe file is open?
> I used COBOLFILEINFO and OPENINFO but it does not seem to return the proper code if a file is opened by another process. Any hint will be highly appreciated.

COBOLFILEINFO definitely won't do what you want. OPENINFO might let you determine whether the file is open, but the description in the manual is not clear about which of the values it will return when a file is not open, so I would not depend on it.

I believe you must make a call to the Guardian procedure FILE_GETINFOLISTBYNAME_ and request the value of item 75.

As far as I can see from looking at the documentation of that procedure, you should be able to call it from COBOL, but you must be careful to set up the item list argument and the result argument to be binary values of the correct size. Also, I believe that when calling from COBOL, you pass just the name of the PIC X(n) data item that contains the file name and don't pass anything for the length (at least at one time, COBOL would determine the length itself and pass it automatically, without the programmer explicitly putting it into the call).

If you cannot figure out how to make COBOL call that procedure, it might be easier for you to write a C function that does the FILE_GETINFOLISTBYNAME_ call (assuming you know C and are not familiar with TAL) and have the C function return the value of item 75 for your COBOL code to check.

Re: How to check if a file is OPEN

<51d4a00d-15b5-4e48-8b03-5b6bf4fe4b0fn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=188&group=comp.sys.tandem#188

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:ad4:5f0e:: with SMTP id fo14mr1439236qvb.42.1623957148707; Thu, 17 Jun 2021 12:12:28 -0700 (PDT)
X-Received: by 2002:a25:6f55:: with SMTP id k82mr8387568ybc.490.1623957148370; Thu, 17 Jun 2021 12:12:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Thu, 17 Jun 2021 12:12:28 -0700 (PDT)
In-Reply-To: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=4.14.163.200; posting-account=WszjiAoAAADJbfGVFKShkKnAS2RxUEmf
NNTP-Posting-Host: 4.14.163.200
References: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <51d4a00d-15b5-4e48-8b03-5b6bf4fe4b0fn@googlegroups.com>
Subject: Re: How to check if a file is OPEN
From: richards...@gmail.com (Rich S.)
Injection-Date: Thu, 17 Jun 2021 19:12:28 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 6
 by: Rich S. - Thu, 17 Jun 2021 19:12 UTC

On Wednesday, June 16, 2021 at 10:24:35 PM UTC-4, abol...@gmail.com wrote:
> in a Cobol program, how would you determine/check if enscribe file is open?
> I used COBOLFILEINFO and OPENINFO but it does not seem to return the proper code if a file is opened by another process. Any hint will be highly appreciated.

If you need to open the file anyway and you don't care who might have it open, why not just handle the error you would get?

I haven't coded COBOL in ages but looking at an old program, we would check for file status of 30 and the GUARDIAN-ERR special register (if such a thing still exists) of 12.

Re: How to check if a file is OPEN

<sag707$4m5$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=189&group=comp.sys.tandem#189

  copy link   Newsgroups: comp.sys.tandem
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: inva...@nowhere.com (JShepherd)
Newsgroups: comp.sys.tandem
Subject: Re: How to check if a file is OPEN
Date: Thu, 17 Jun 2021 19:15:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <sag707$4m5$1@dont-email.me>
References: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com> <03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com>
Mime-Version: 1.0
Content-Type: Text/Plain; charset=US-ASCII
Injection-Date: Thu, 17 Jun 2021 19:15:19 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b267962930b6fc93077ebf7c0131ca8e";
logging-data="4805"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Kv/qOSrL4soI5mwmGWiS0xOveMb3q2Ck="
Cancel-Lock: sha1:zucmrrSzVG1AX2xFojQcPqhtKAM=
 by: JShepherd - Thu, 17 Jun 2021 19:15 UTC

In article <03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com>,
rkdick@gmail.com says...
>
>On Wednesday, June 16, 2021 at 7:24:35 PM UTC-7, abol...@gmail.com wrote:
>> in a Cobol program, how would you determine/check if enscribe file is ope=
>n?=20
>> I used COBOLFILEINFO and OPENINFO but it does not seem to return the prop=
>er code if a file is opened by another process. Any hint will be highly app=
>reciated.
>
>COBOLFILEINFO definitely won't do what you want. OPENINFO might let you de=
>termine whether the file is open, but the description in the manual is not =
>clear about which of the values it will return when a file is not open, so =
>I would not depend on it.
>
>I believe you must make a call to the Guardian procedure FILE_GETINFOLISTBY=
>NAME_ and request the value of item 75.
>
>As far as I can see from looking at the documentation of that procedure, yo=
>u should be able to call it from COBOL, but you must be careful to set up t=
>he item list argument and the result argument to be binary values of the co=
>rrect size. Also, I believe that when calling from COBOL, you pass just th=
>e name of the PIC X(n) data item that contains the file name and don't pass=
> anything for the length (at least at one time, COBOL would determine the l=
>ength itself and pass it automatically, without the programmer explicitly p=
>utting it into the call).
>
>If you cannot figure out how to make COBOL call that procedure, it might be=
> easier for you to write a C function that does the FILE_GETINFOLISTBYNAME_=
> call (assuming you know C and are not familiar with TAL) and have the C fu=
>nction return the value of item 75 for your COBOL code to check.

Additionally

The FILE_GETOPENINFO_ procedure obtains information about the
opens of one disk file or all the files on a disk device
or the opens of certain nondisk devices.

Each call returns information about one open;
make successive calls to FILE_GETOPENINFO_ to learn about
all the opens.

Re: How to check if a file is OPEN

<e4457072-f4d5-4871-9741-c887f403aa25n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=190&group=comp.sys.tandem#190

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:622a:18b:: with SMTP id s11mr6930376qtw.143.1623958953490; Thu, 17 Jun 2021 12:42:33 -0700 (PDT)
X-Received: by 2002:a25:6046:: with SMTP id u67mr5559453ybb.6.1623958953285; Thu, 17 Jun 2021 12:42:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Thu, 17 Jun 2021 12:42:33 -0700 (PDT)
In-Reply-To: <sag707$4m5$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=4.14.163.200; posting-account=WszjiAoAAADJbfGVFKShkKnAS2RxUEmf
NNTP-Posting-Host: 4.14.163.200
References: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com> <03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com> <sag707$4m5$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e4457072-f4d5-4871-9741-c887f403aa25n@googlegroups.com>
Subject: Re: How to check if a file is OPEN
From: richards...@gmail.com (Rich S.)
Injection-Date: Thu, 17 Jun 2021 19:42:33 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 85
 by: Rich S. - Thu, 17 Jun 2021 19:42 UTC

On Thursday, June 17, 2021 at 3:15:21 PM UTC-4, JShepherd wrote:
> In article <03138bc6-de93-49d1...@googlegroups.com>,
> rkd...@gmail.com says...
> >
> >On Wednesday, June 16, 2021 at 7:24:35 PM UTC-7, abol...@gmail.com wrote:
> >> in a Cobol program, how would you determine/check if enscribe file is ope=
> >n?=20
> >> I used COBOLFILEINFO and OPENINFO but it does not seem to return the prop=
> >er code if a file is opened by another process. Any hint will be highly app=
> >reciated.
> >
> >COBOLFILEINFO definitely won't do what you want. OPENINFO might let you de=
> >termine whether the file is open, but the description in the manual is not =
> >clear about which of the values it will return when a file is not open, so =
> >I would not depend on it.
> >
> >I believe you must make a call to the Guardian procedure FILE_GETINFOLISTBY=
> >NAME_ and request the value of item 75.
> >
> >As far as I can see from looking at the documentation of that procedure, yo=
> >u should be able to call it from COBOL, but you must be careful to set up t=
> >he item list argument and the result argument to be binary values of the co=
> >rrect size. Also, I believe that when calling from COBOL, you pass just th=
> >e name of the PIC X(n) data item that contains the file name and don't pass=
> > anything for the length (at least at one time, COBOL would determine the l=
> >ength itself and pass it automatically, without the programmer explicitly p=
> >utting it into the call).
> >
> >If you cannot figure out how to make COBOL call that procedure, it might be=
> > easier for you to write a C function that does the FILE_GETINFOLISTBYNAME_=
> > call (assuming you know C and are not familiar with TAL) and have the C fu=
> >nction return the value of item 75 for your COBOL code to check.
> Additionally
>
> The FILE_GETOPENINFO_ procedure obtains information about the
> opens of one disk file or all the files on a disk device
> or the opens of certain nondisk devices.
>
> Each call returns information about one open;
> make successive calls to FILE_GETOPENINFO_ to learn about
> all the opens.

Additionally, additionally...found and example from COBOL code using item 75 and FILE_GETINFOLISTBYNAME_ (as previously suggested). This would still assume you don't care who/what has it open:

In working storage:

01 WS-PROC-CALL-STATUS NATIVE-2 VALUE 0.
01 WS-FILE-GETINFOLIST.
05 WS-FGIL-FNAME PIC X(40) VALUE SPACES.
05 WS-FGIL-FNAME-LEN NATIVE-2 VALUE ZERO.
05 WS-FGIL-ITEM-COUNT NATIVE-2 VALUE 5.
05 WS-FGIL-ITEM-VALUES-LEN NATIVE-2 VALUE 16.
05 WS-FGIL-ITEM-LIST.
10 WS-FGIL-SQL-TYPE-CODE NATIVE-2 VALUE 40.
10 WS-FGIL-FILE-TYPE-CODE NATIVE-2 VALUE 41.
10 WS-FGIL-FILE-CODE-CODE NATIVE-2 VALUE 42.
10 WS-FGIL-IS-OPEN-CODE NATIVE-2 VALUE 75.
10 WS-FGIL-LMOD-CODE NATIVE-2 VALUE 144.
05 WS-FGIL-ITEM-VALUES.
10 WS-FGIL-SQL-TYPE NATIVE-2 VALUE 0.
88 NOT-AN-SQL-OBJECT VALUE 0.
10 WS-FGIL-FILE-TYPE NATIVE-2 VALUE 0.
88 FILE-IS-UNSTRUCTURED VALUE 0.
10 WS-FGIL-FILE-CODE NATIVE-2 VALUE 0.
88 FILE-CODE-IS-0-OR-101 VALUE 0, 101.
88 FILE-IS-TYPE-101 VALUE 101.
10 WS-FGIL-IS-OPEN NATIVE-2 VALUE 0.
88 FILE-IS-NOT-OPEN VALUE 0.
88 FILE-IS-OPEN VALUE 1.
88 FILE-NOT-FOUND VALUE 11.
88 FILE-IS-A-KEEPER VALUE ZERO.
88 FILE-IS-NOT-A-KEEPER VALUE 99.
10 WS-FGIL-LMOD-TSTAMP NATIVE-8 VALUE 0.

in code:

**** populate the file name and file name length fields first ***

ENTER "FILE_GETINFOLISTBYNAME_" USING WS-FGIL-FNAME (1:WS-FGIL-FNAME-LEN)
, WS-FGIL-ITEM-LIST
, WS-FGIL-ITEM-COUNT
, WS-FGIL-ITEM-VALUES
, WS-FGIL-ITEM-VALUES-LEN
GIVING WS-PROC-CALL-STATUS.

**** check the WS-FGIL-IS-OPEN variable or the associated 88-level switches.

Re: How to check if a file is OPEN

<182ea316-80b4-4081-866e-595bcf7c6abcn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=191&group=comp.sys.tandem#191

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:620a:4547:: with SMTP id u7mr6046553qkp.439.1623970792900;
Thu, 17 Jun 2021 15:59:52 -0700 (PDT)
X-Received: by 2002:a25:4d04:: with SMTP id a4mr8995764ybb.311.1623970792682;
Thu, 17 Jun 2021 15:59:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!border2.nntp.ams1.giganews.com!nntp.giganews.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Thu, 17 Jun 2021 15:59:52 -0700 (PDT)
In-Reply-To: <e4457072-f4d5-4871-9741-c887f403aa25n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=50.204.224.200; posting-account=0NHiHgoAAAC-mY8P0yk1bd3zDKN8t6jB
NNTP-Posting-Host: 50.204.224.200
References: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com>
<03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com> <sag707$4m5$1@dont-email.me>
<e4457072-f4d5-4871-9741-c887f403aa25n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <182ea316-80b4-4081-866e-595bcf7c6abcn@googlegroups.com>
Subject: Re: How to check if a file is OPEN
From: abolk...@gmail.com (Adam Kamal)
Injection-Date: Thu, 17 Jun 2021 22:59:52 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 87
 by: Adam Kamal - Thu, 17 Jun 2021 22:59 UTC

On Thursday, June 17, 2021 at 12:42:34 PM UTC-7, Rich S. wrote:
> On Thursday, June 17, 2021 at 3:15:21 PM UTC-4, JShepherd wrote:
> > In article <03138bc6-de93-49d1...@googlegroups.com>,
> > rkd...@gmail.com says...
> > >
> > >On Wednesday, June 16, 2021 at 7:24:35 PM UTC-7, abol...@gmail.com wrote:
> > >> in a Cobol program, how would you determine/check if enscribe file is ope=
> > >n?=20
> > >> I used COBOLFILEINFO and OPENINFO but it does not seem to return the prop=
> > >er code if a file is opened by another process. Any hint will be highly app=
> > >reciated.
> > >
> > >COBOLFILEINFO definitely won't do what you want. OPENINFO might let you de=
> > >termine whether the file is open, but the description in the manual is not =
> > >clear about which of the values it will return when a file is not open, so =
> > >I would not depend on it.
> > >
> > >I believe you must make a call to the Guardian procedure FILE_GETINFOLISTBY=
> > >NAME_ and request the value of item 75.
> > >
> > >As far as I can see from looking at the documentation of that procedure, yo=
> > >u should be able to call it from COBOL, but you must be careful to set up t=
> > >he item list argument and the result argument to be binary values of the co=
> > >rrect size. Also, I believe that when calling from COBOL, you pass just th=
> > >e name of the PIC X(n) data item that contains the file name and don't pass=
> > > anything for the length (at least at one time, COBOL would determine the l=
> > >ength itself and pass it automatically, without the programmer explicitly p=
> > >utting it into the call).
> > >
> > >If you cannot figure out how to make COBOL call that procedure, it might be=
> > > easier for you to write a C function that does the FILE_GETINFOLISTBYNAME_=
> > > call (assuming you know C and are not familiar with TAL) and have the C fu=
> > >nction return the value of item 75 for your COBOL code to check.
> > Additionally
> >
> > The FILE_GETOPENINFO_ procedure obtains information about the
> > opens of one disk file or all the files on a disk device
> > or the opens of certain nondisk devices.
> >
> > Each call returns information about one open;
> > make successive calls to FILE_GETOPENINFO_ to learn about
> > all the opens.
> Additionally, additionally...found and example from COBOL code using item 75 and FILE_GETINFOLISTBYNAME_ (as previously suggested). This would still assume you don't care who/what has it open:
>
> In working storage:
>
> 01 WS-PROC-CALL-STATUS NATIVE-2 VALUE 0.
> 01 WS-FILE-GETINFOLIST.
> 05 WS-FGIL-FNAME PIC X(40) VALUE SPACES.
> 05 WS-FGIL-FNAME-LEN NATIVE-2 VALUE ZERO.
> 05 WS-FGIL-ITEM-COUNT NATIVE-2 VALUE 5.
> 05 WS-FGIL-ITEM-VALUES-LEN NATIVE-2 VALUE 16.
> 05 WS-FGIL-ITEM-LIST.
> 10 WS-FGIL-SQL-TYPE-CODE NATIVE-2 VALUE 40.
> 10 WS-FGIL-FILE-TYPE-CODE NATIVE-2 VALUE 41.
> 10 WS-FGIL-FILE-CODE-CODE NATIVE-2 VALUE 42.
> 10 WS-FGIL-IS-OPEN-CODE NATIVE-2 VALUE 75.
> 10 WS-FGIL-LMOD-CODE NATIVE-2 VALUE 144.
> 05 WS-FGIL-ITEM-VALUES.
> 10 WS-FGIL-SQL-TYPE NATIVE-2 VALUE 0.
> 88 NOT-AN-SQL-OBJECT VALUE 0.
> 10 WS-FGIL-FILE-TYPE NATIVE-2 VALUE 0.
> 88 FILE-IS-UNSTRUCTURED VALUE 0.
> 10 WS-FGIL-FILE-CODE NATIVE-2 VALUE 0.
> 88 FILE-CODE-IS-0-OR-101 VALUE 0, 101.
> 88 FILE-IS-TYPE-101 VALUE 101.
> 10 WS-FGIL-IS-OPEN NATIVE-2 VALUE 0.
> 88 FILE-IS-NOT-OPEN VALUE 0.
> 88 FILE-IS-OPEN VALUE 1.
> 88 FILE-NOT-FOUND VALUE 11.
> 88 FILE-IS-A-KEEPER VALUE ZERO.
> 88 FILE-IS-NOT-A-KEEPER VALUE 99.
> 10 WS-FGIL-LMOD-TSTAMP NATIVE-8 VALUE 0.
>
> in code:
>
> **** populate the file name and file name length fields first ***
>
> ENTER "FILE_GETINFOLISTBYNAME_" USING WS-FGIL-FNAME (1:WS-FGIL-FNAME-LEN)
> , WS-FGIL-ITEM-LIST
> , WS-FGIL-ITEM-COUNT
> , WS-FGIL-ITEM-VALUES
> , WS-FGIL-ITEM-VALUES-LEN
> GIVING WS-PROC-CALL-STATUS.
>
> **** check the WS-FGIL-IS-OPEN variable or the associated 88-level switches.

OMG, It worked! Thank you so much, been trying for couple of days. You're DA Best!

Re: How to check if a file is OPEN

<4f26a193-4efe-420a-86b5-eb0a644e2fffn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=192&group=comp.sys.tandem#192

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a37:a645:: with SMTP id p66mr6332813qke.499.1623971282494;
Thu, 17 Jun 2021 16:08:02 -0700 (PDT)
X-Received: by 2002:a25:dfd0:: with SMTP id w199mr9547344ybg.337.1623971282255;
Thu, 17 Jun 2021 16:08:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Thu, 17 Jun 2021 16:08:01 -0700 (PDT)
In-Reply-To: <03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=50.204.224.200; posting-account=0NHiHgoAAAC-mY8P0yk1bd3zDKN8t6jB
NNTP-Posting-Host: 50.204.224.200
References: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com> <03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4f26a193-4efe-420a-86b5-eb0a644e2fffn@googlegroups.com>
Subject: Re: How to check if a file is OPEN
From: abolk...@gmail.com (Adam Kamal)
Injection-Date: Thu, 17 Jun 2021 23:08:02 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2982
 by: Adam Kamal - Thu, 17 Jun 2021 23:08 UTC

On Wednesday, June 16, 2021 at 9:52:05 PM UTC-7, rkd...@gmail.com wrote:
> On Wednesday, June 16, 2021 at 7:24:35 PM UTC-7, abol...@gmail.com wrote:
> > in a Cobol program, how would you determine/check if enscribe file is open?
> > I used COBOLFILEINFO and OPENINFO but it does not seem to return the proper code if a file is opened by another process. Any hint will be highly appreciated.
> COBOLFILEINFO definitely won't do what you want. OPENINFO might let you determine whether the file is open, but the description in the manual is not clear about which of the values it will return when a file is not open, so I would not depend on it.
>
> I believe you must make a call to the Guardian procedure FILE_GETINFOLISTBYNAME_ and request the value of item 75.
>
> As far as I can see from looking at the documentation of that procedure, you should be able to call it from COBOL, but you must be careful to set up the item list argument and the result argument to be binary values of the correct size. Also, I believe that when calling from COBOL, you pass just the name of the PIC X(n) data item that contains the file name and don't pass anything for the length (at least at one time, COBOL would determine the length itself and pass it automatically, without the programmer explicitly putting it into the call).
>
> If you cannot figure out how to make COBOL call that procedure, it might be easier for you to write a C function that does the FILE_GETINFOLISTBYNAME_ call (assuming you know C and are not familiar with TAL) and have the C function return the value of item 75 for your COBOL code to check.

Many thanks! You put me on the right track. I appreciate your help!

Re: How to check if a file is OPEN

<7bc4c1e9-141a-4c63-bdba-a4a5008ad6fbn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=216&group=comp.sys.tandem#216

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a37:f519:: with SMTP id l25mr9380433qkk.269.1628992308610;
Sat, 14 Aug 2021 18:51:48 -0700 (PDT)
X-Received: by 2002:a25:4907:: with SMTP id w7mr12244697yba.393.1628992308267;
Sat, 14 Aug 2021 18:51:48 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Sat, 14 Aug 2021 18:51:47 -0700 (PDT)
In-Reply-To: <e4457072-f4d5-4871-9741-c887f403aa25n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=65.125.102.200; posting-account=0NHiHgoAAAC-mY8P0yk1bd3zDKN8t6jB
NNTP-Posting-Host: 65.125.102.200
References: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com>
<03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com> <sag707$4m5$1@dont-email.me>
<e4457072-f4d5-4871-9741-c887f403aa25n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7bc4c1e9-141a-4c63-bdba-a4a5008ad6fbn@googlegroups.com>
Subject: Re: How to check if a file is OPEN
From: abolk...@gmail.com (Adam Kamal)
Injection-Date: Sun, 15 Aug 2021 01:51:48 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Adam Kamal - Sun, 15 Aug 2021 01:51 UTC

On Thursday, June 17, 2021 at 12:42:34 PM UTC-7, Rich S. wrote:
> On Thursday, June 17, 2021 at 3:15:21 PM UTC-4, JShepherd wrote:
> > In article <03138bc6-de93-49d1...@googlegroups.com>,
> > rkd...@gmail.com says...
> > >
> > >On Wednesday, June 16, 2021 at 7:24:35 PM UTC-7, abol...@gmail.com wrote:
> > >> in a Cobol program, how would you determine/check if enscribe file is ope=
> > >n?=20
> > >> I used COBOLFILEINFO and OPENINFO but it does not seem to return the prop=
> > >er code if a file is opened by another process. Any hint will be highly app=
> > >reciated.
> > >
> > >COBOLFILEINFO definitely won't do what you want. OPENINFO might let you de=
> > >termine whether the file is open, but the description in the manual is not =
> > >clear about which of the values it will return when a file is not open, so =
> > >I would not depend on it.
> > >
> > >I believe you must make a call to the Guardian procedure FILE_GETINFOLISTBY=
> > >NAME_ and request the value of item 75.
> > >
> > >As far as I can see from looking at the documentation of that procedure, yo=
> > >u should be able to call it from COBOL, but you must be careful to set up t=
> > >he item list argument and the result argument to be binary values of the co=
> > >rrect size. Also, I believe that when calling from COBOL, you pass just th=
> > >e name of the PIC X(n) data item that contains the file name and don't pass=
> > > anything for the length (at least at one time, COBOL would determine the l=
> > >ength itself and pass it automatically, without the programmer explicitly p=
> > >utting it into the call).
> > >
> > >If you cannot figure out how to make COBOL call that procedure, it might be=
> > > easier for you to write a C function that does the FILE_GETINFOLISTBYNAME_=
> > > call (assuming you know C and are not familiar with TAL) and have the C fu=
> > >nction return the value of item 75 for your COBOL code to check.
> > Additionally
> >
> > The FILE_GETOPENINFO_ procedure obtains information about the
> > opens of one disk file or all the files on a disk device
> > or the opens of certain nondisk devices.
> >
> > Each call returns information about one open;
> > make successive calls to FILE_GETOPENINFO_ to learn about
> > all the opens.
> Additionally, additionally...found and example from COBOL code using item 75 and FILE_GETINFOLISTBYNAME_ (as previously suggested). This would still assume you don't care who/what has it open:
>
> In working storage:
>
> 01 WS-PROC-CALL-STATUS NATIVE-2 VALUE 0.
> 01 WS-FILE-GETINFOLIST.
> 05 WS-FGIL-FNAME PIC X(40) VALUE SPACES.
> 05 WS-FGIL-FNAME-LEN NATIVE-2 VALUE ZERO.
> 05 WS-FGIL-ITEM-COUNT NATIVE-2 VALUE 5.
> 05 WS-FGIL-ITEM-VALUES-LEN NATIVE-2 VALUE 16.
> 05 WS-FGIL-ITEM-LIST.
> 10 WS-FGIL-SQL-TYPE-CODE NATIVE-2 VALUE 40.
> 10 WS-FGIL-FILE-TYPE-CODE NATIVE-2 VALUE 41.
> 10 WS-FGIL-FILE-CODE-CODE NATIVE-2 VALUE 42.
> 10 WS-FGIL-IS-OPEN-CODE NATIVE-2 VALUE 75.
> 10 WS-FGIL-LMOD-CODE NATIVE-2 VALUE 144.
> 05 WS-FGIL-ITEM-VALUES.
> 10 WS-FGIL-SQL-TYPE NATIVE-2 VALUE 0.
> 88 NOT-AN-SQL-OBJECT VALUE 0.
> 10 WS-FGIL-FILE-TYPE NATIVE-2 VALUE 0.
> 88 FILE-IS-UNSTRUCTURED VALUE 0.
> 10 WS-FGIL-FILE-CODE NATIVE-2 VALUE 0.
> 88 FILE-CODE-IS-0-OR-101 VALUE 0, 101.
> 88 FILE-IS-TYPE-101 VALUE 101.
> 10 WS-FGIL-IS-OPEN NATIVE-2 VALUE 0.
> 88 FILE-IS-NOT-OPEN VALUE 0.
> 88 FILE-IS-OPEN VALUE 1.
> 88 FILE-NOT-FOUND VALUE 11.
> 88 FILE-IS-A-KEEPER VALUE ZERO.
> 88 FILE-IS-NOT-A-KEEPER VALUE 99.
> 10 WS-FGIL-LMOD-TSTAMP NATIVE-8 VALUE 0.
>
> in code:
>
> **** populate the file name and file name length fields first ***
>
> ENTER "FILE_GETINFOLISTBYNAME_" USING WS-FGIL-FNAME (1:WS-FGIL-FNAME-LEN)
> , WS-FGIL-ITEM-LIST
> , WS-FGIL-ITEM-COUNT
> , WS-FGIL-ITEM-VALUES
> , WS-FGIL-ITEM-VALUES-LEN
> GIVING WS-PROC-CALL-STATUS.
>
> **** check the WS-FGIL-IS-OPEN variable or the associated 88-level switches.
Would you please post a link to the document where item number codes and its usage can be located. I guess how did you know item number 75 will return file open status? what would be the item number to determine security violation (AKA Error 48) if a process is trying yo open a file that is secured "UUUU" . Thanks in advance.

Re: How to check if a file is OPEN

<eac3b0bf-74ee-4b89-8f40-065eb3f472d3n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=217&group=comp.sys.tandem#217

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:ac8:7b47:: with SMTP id m7mr8524643qtu.178.1629005068440; Sat, 14 Aug 2021 22:24:28 -0700 (PDT)
X-Received: by 2002:a25:4907:: with SMTP id w7mr13020740yba.393.1629005068289; Sat, 14 Aug 2021 22:24:28 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Sat, 14 Aug 2021 22:24:27 -0700 (PDT)
In-Reply-To: <7bc4c1e9-141a-4c63-bdba-a4a5008ad6fbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.42.228.104; posting-account=Lua_ZwoAAADivbVXQF8uKE7dZSUNm9vj
NNTP-Posting-Host: 98.42.228.104
References: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com> <03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com> <sag707$4m5$1@dont-email.me> <e4457072-f4d5-4871-9741-c887f403aa25n@googlegroups.com> <7bc4c1e9-141a-4c63-bdba-a4a5008ad6fbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <eac3b0bf-74ee-4b89-8f40-065eb3f472d3n@googlegroups.com>
Subject: Re: How to check if a file is OPEN
From: rkd...@gmail.com (Keith Dick)
Injection-Date: Sun, 15 Aug 2021 05:24:28 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 165
 by: Keith Dick - Sun, 15 Aug 2021 05:24 UTC

On Saturday, August 14, 2021 at 6:51:49 PM UTC-7, abol...@gmail.com wrote:
> On Thursday, June 17, 2021 at 12:42:34 PM UTC-7, Rich S. wrote:
> > On Thursday, June 17, 2021 at 3:15:21 PM UTC-4, JShepherd wrote:
> > > In article <03138bc6-de93-49d1...@googlegroups.com>,
> > > rkd...@gmail.com says...
> > > >
> > > >On Wednesday, June 16, 2021 at 7:24:35 PM UTC-7, abol...@gmail.com wrote:
> > > >> in a Cobol program, how would you determine/check if enscribe file is ope=
> > > >n?=20
> > > >> I used COBOLFILEINFO and OPENINFO but it does not seem to return the prop=
> > > >er code if a file is opened by another process. Any hint will be highly app=
> > > >reciated.
> > > >
> > > >COBOLFILEINFO definitely won't do what you want. OPENINFO might let you de=
> > > >termine whether the file is open, but the description in the manual is not =
> > > >clear about which of the values it will return when a file is not open, so =
> > > >I would not depend on it.
> > > >
> > > >I believe you must make a call to the Guardian procedure FILE_GETINFOLISTBY=
> > > >NAME_ and request the value of item 75.
> > > >
> > > >As far as I can see from looking at the documentation of that procedure, yo=
> > > >u should be able to call it from COBOL, but you must be careful to set up t=
> > > >he item list argument and the result argument to be binary values of the co=
> > > >rrect size. Also, I believe that when calling from COBOL, you pass just th=
> > > >e name of the PIC X(n) data item that contains the file name and don't pass=
> > > > anything for the length (at least at one time, COBOL would determine the l=
> > > >ength itself and pass it automatically, without the programmer explicitly p=
> > > >utting it into the call).
> > > >
> > > >If you cannot figure out how to make COBOL call that procedure, it might be=
> > > > easier for you to write a C function that does the FILE_GETINFOLISTBYNAME_=
> > > > call (assuming you know C and are not familiar with TAL) and have the C fu=
> > > >nction return the value of item 75 for your COBOL code to check.
> > > Additionally
> > >
> > > The FILE_GETOPENINFO_ procedure obtains information about the
> > > opens of one disk file or all the files on a disk device
> > > or the opens of certain nondisk devices.
> > >
> > > Each call returns information about one open;
> > > make successive calls to FILE_GETOPENINFO_ to learn about
> > > all the opens.
> > Additionally, additionally...found and example from COBOL code using item 75 and FILE_GETINFOLISTBYNAME_ (as previously suggested). This would still assume you don't care who/what has it open:
> >
> > In working storage:
> >
> > 01 WS-PROC-CALL-STATUS NATIVE-2 VALUE 0.
> > 01 WS-FILE-GETINFOLIST.
> > 05 WS-FGIL-FNAME PIC X(40) VALUE SPACES.
> > 05 WS-FGIL-FNAME-LEN NATIVE-2 VALUE ZERO.
> > 05 WS-FGIL-ITEM-COUNT NATIVE-2 VALUE 5.
> > 05 WS-FGIL-ITEM-VALUES-LEN NATIVE-2 VALUE 16.
> > 05 WS-FGIL-ITEM-LIST.
> > 10 WS-FGIL-SQL-TYPE-CODE NATIVE-2 VALUE 40.
> > 10 WS-FGIL-FILE-TYPE-CODE NATIVE-2 VALUE 41.
> > 10 WS-FGIL-FILE-CODE-CODE NATIVE-2 VALUE 42.
> > 10 WS-FGIL-IS-OPEN-CODE NATIVE-2 VALUE 75.
> > 10 WS-FGIL-LMOD-CODE NATIVE-2 VALUE 144.
> > 05 WS-FGIL-ITEM-VALUES.
> > 10 WS-FGIL-SQL-TYPE NATIVE-2 VALUE 0.
> > 88 NOT-AN-SQL-OBJECT VALUE 0.
> > 10 WS-FGIL-FILE-TYPE NATIVE-2 VALUE 0.
> > 88 FILE-IS-UNSTRUCTURED VALUE 0.
> > 10 WS-FGIL-FILE-CODE NATIVE-2 VALUE 0.
> > 88 FILE-CODE-IS-0-OR-101 VALUE 0, 101.
> > 88 FILE-IS-TYPE-101 VALUE 101.
> > 10 WS-FGIL-IS-OPEN NATIVE-2 VALUE 0.
> > 88 FILE-IS-NOT-OPEN VALUE 0.
> > 88 FILE-IS-OPEN VALUE 1.
> > 88 FILE-NOT-FOUND VALUE 11.
> > 88 FILE-IS-A-KEEPER VALUE ZERO.
> > 88 FILE-IS-NOT-A-KEEPER VALUE 99.
> > 10 WS-FGIL-LMOD-TSTAMP NATIVE-8 VALUE 0.
> >
> > in code:
> >
> > **** populate the file name and file name length fields first ***
> >
> > ENTER "FILE_GETINFOLISTBYNAME_" USING WS-FGIL-FNAME (1:WS-FGIL-FNAME-LEN)
> > , WS-FGIL-ITEM-LIST
> > , WS-FGIL-ITEM-COUNT
> > , WS-FGIL-ITEM-VALUES
> > , WS-FGIL-ITEM-VALUES-LEN
> > GIVING WS-PROC-CALL-STATUS.
> >
> > **** check the WS-FGIL-IS-OPEN variable or the associated 88-level switches.
> Would you please post a link to the document where item number codes and its usage can be located. I guess how did you know item number 75 will return file open status? what would be the item number to determine security violation (AKA Error 48) if a process is trying yo open a file that is secured "UUUU" . Thanks in advance.

Although your post is dated June 17, it only appeared in the Google Groups version of comp.sys.tandem today, August 14. I don't know why there was such a delay.

You can access the HPE documentation for the NonStop systems by:

1. Go to www.hpe.com/info/nonstop-docs
2. Click the link for your type of NonStop system ( L-series, J-series, or H-series)
3. On the next page, click on the heading "Manuals and Guides"
4. That will open a search terms entry box into which you can enter terms to search the documentation library.
5. If you know the title of the document you want, you can enter the full or partial title then end with
the Enter key, and that usually will get the search to find the document.
You can instead enter terms to search for, and the search will list documents that contain
the terms.
6. When you see a document you want in the search results, click on the title, and that will
open the document (a PDF file) in a new tab or new window. You can read the manual in
that new window or you can download the PDF file to your computer by clicking on the icon that
is a down pointing arrow that appears at the top right corner of the area in which the document
is displayed. I usually find it a lot easier to navigate the document after downloading it.

The title of the manual that contains the description of FILE_GETINFOLISTBYNAME_ is:

Guardian Procedure Calls Reference Manual

Entering "guardian proc calls" in the search terms usually is good enough to find it. You could also type
the procedure name as the search terms and find the same manual.

If you don't know the name of the manual and don't now which procedure you need to use, then you have
a harder problem. Sometimes you'll be able to think of search terms that will allow you to find a manual
that will answer your question, but often, you'll have to ask someone for a pointer in the right direction.

Someone at HPE keeps fiddling with the documentation library, so the next time you try to use it, you might find the navigation to the search page is somewhat different, but usually, you'll be able to figure out how to get there.

Re: How to check if a file is OPEN

<04b76747-86aa-4335-9f2f-7645fbbb85cfn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=218&group=comp.sys.tandem#218

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:a05:622a:1007:: with SMTP id d7mr8600482qte.158.1629006621812;
Sat, 14 Aug 2021 22:50:21 -0700 (PDT)
X-Received: by 2002:a25:27c1:: with SMTP id n184mr13239446ybn.496.1629006621643;
Sat, 14 Aug 2021 22:50:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Sat, 14 Aug 2021 22:50:21 -0700 (PDT)
In-Reply-To: <7bc4c1e9-141a-4c63-bdba-a4a5008ad6fbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.42.228.104; posting-account=Lua_ZwoAAADivbVXQF8uKE7dZSUNm9vj
NNTP-Posting-Host: 98.42.228.104
References: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com>
<03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com> <sag707$4m5$1@dont-email.me>
<e4457072-f4d5-4871-9741-c887f403aa25n@googlegroups.com> <7bc4c1e9-141a-4c63-bdba-a4a5008ad6fbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <04b76747-86aa-4335-9f2f-7645fbbb85cfn@googlegroups.com>
Subject: Re: How to check if a file is OPEN
From: rkd...@gmail.com (Keith Dick)
Injection-Date: Sun, 15 Aug 2021 05:50:21 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Keith Dick - Sun, 15 Aug 2021 05:50 UTC

On Saturday, August 14, 2021 at 6:51:49 PM UTC-7, abol...@gmail.com wrote:
> On Thursday, June 17, 2021 at 12:42:34 PM UTC-7, Rich S. wrote:
> > On Thursday, June 17, 2021 at 3:15:21 PM UTC-4, JShepherd wrote:
> > > In article <03138bc6-de93-49d1...@googlegroups.com>,
> > > rkd...@gmail.com says...
> > > >
> > > >On Wednesday, June 16, 2021 at 7:24:35 PM UTC-7, abol...@gmail.com wrote:
> > > >> in a Cobol program, how would you determine/check if enscribe file is ope=
> > > >n?=20
> > > >> I used COBOLFILEINFO and OPENINFO but it does not seem to return the prop=
> > > >er code if a file is opened by another process. Any hint will be highly app=
> > > >reciated.
> > > >
> > > >COBOLFILEINFO definitely won't do what you want. OPENINFO might let you de=
> > > >termine whether the file is open, but the description in the manual is not =
> > > >clear about which of the values it will return when a file is not open, so =
> > > >I would not depend on it.
> > > >
> > > >I believe you must make a call to the Guardian procedure FILE_GETINFOLISTBY=
> > > >NAME_ and request the value of item 75.
> > > >
> > > >As far as I can see from looking at the documentation of that procedure, yo=
> > > >u should be able to call it from COBOL, but you must be careful to set up t=
> > > >he item list argument and the result argument to be binary values of the co=
> > > >rrect size. Also, I believe that when calling from COBOL, you pass just th=
> > > >e name of the PIC X(n) data item that contains the file name and don't pass=
> > > > anything for the length (at least at one time, COBOL would determine the l=
> > > >ength itself and pass it automatically, without the programmer explicitly p=
> > > >utting it into the call).
> > > >
> > > >If you cannot figure out how to make COBOL call that procedure, it might be=
> > > > easier for you to write a C function that does the FILE_GETINFOLISTBYNAME_=
> > > > call (assuming you know C and are not familiar with TAL) and have the C fu=
> > > >nction return the value of item 75 for your COBOL code to check.
> > > Additionally
> > >
> > > The FILE_GETOPENINFO_ procedure obtains information about the
> > > opens of one disk file or all the files on a disk device
> > > or the opens of certain nondisk devices.
> > >
> > > Each call returns information about one open;
> > > make successive calls to FILE_GETOPENINFO_ to learn about
> > > all the opens.
> > Additionally, additionally...found and example from COBOL code using item 75 and FILE_GETINFOLISTBYNAME_ (as previously suggested). This would still assume you don't care who/what has it open:
> >
> > In working storage:
> >
> > 01 WS-PROC-CALL-STATUS NATIVE-2 VALUE 0.
> > 01 WS-FILE-GETINFOLIST.
> > 05 WS-FGIL-FNAME PIC X(40) VALUE SPACES.
> > 05 WS-FGIL-FNAME-LEN NATIVE-2 VALUE ZERO.
> > 05 WS-FGIL-ITEM-COUNT NATIVE-2 VALUE 5.
> > 05 WS-FGIL-ITEM-VALUES-LEN NATIVE-2 VALUE 16.
> > 05 WS-FGIL-ITEM-LIST.
> > 10 WS-FGIL-SQL-TYPE-CODE NATIVE-2 VALUE 40.
> > 10 WS-FGIL-FILE-TYPE-CODE NATIVE-2 VALUE 41.
> > 10 WS-FGIL-FILE-CODE-CODE NATIVE-2 VALUE 42.
> > 10 WS-FGIL-IS-OPEN-CODE NATIVE-2 VALUE 75.
> > 10 WS-FGIL-LMOD-CODE NATIVE-2 VALUE 144.
> > 05 WS-FGIL-ITEM-VALUES.
> > 10 WS-FGIL-SQL-TYPE NATIVE-2 VALUE 0.
> > 88 NOT-AN-SQL-OBJECT VALUE 0.
> > 10 WS-FGIL-FILE-TYPE NATIVE-2 VALUE 0.
> > 88 FILE-IS-UNSTRUCTURED VALUE 0.
> > 10 WS-FGIL-FILE-CODE NATIVE-2 VALUE 0.
> > 88 FILE-CODE-IS-0-OR-101 VALUE 0, 101.
> > 88 FILE-IS-TYPE-101 VALUE 101.
> > 10 WS-FGIL-IS-OPEN NATIVE-2 VALUE 0.
> > 88 FILE-IS-NOT-OPEN VALUE 0.
> > 88 FILE-IS-OPEN VALUE 1.
> > 88 FILE-NOT-FOUND VALUE 11.
> > 88 FILE-IS-A-KEEPER VALUE ZERO.
> > 88 FILE-IS-NOT-A-KEEPER VALUE 99.
> > 10 WS-FGIL-LMOD-TSTAMP NATIVE-8 VALUE 0.
> >
> > in code:
> >
> > **** populate the file name and file name length fields first ***
> >
> > ENTER "FILE_GETINFOLISTBYNAME_" USING WS-FGIL-FNAME (1:WS-FGIL-FNAME-LEN)
> > , WS-FGIL-ITEM-LIST
> > , WS-FGIL-ITEM-COUNT
> > , WS-FGIL-ITEM-VALUES
> > , WS-FGIL-ITEM-VALUES-LEN
> > GIVING WS-PROC-CALL-STATUS.
> >
> > **** check the WS-FGIL-IS-OPEN variable or the associated 88-level switches.
> Would you please post a link to the document where item number codes and its usage can be located. I guess how did you know item number 75 will return file open status? what would be the item number to determine security violation (AKA Error 48) if a process is trying yo open a file that is secured "UUUU" . Thanks in advance.

I'm not quite sure what the second part of your question is asking for. If you want to know the item code that shows the file security setting, that is given by item 62, but you probably also would have to look at item 58, which tells you the userid of the file owner, and item 59, which tells you whether the file is under Safeguard security or not.

Only the process that tried to open a file will get the error 48, so I'm not sure what that part of the question is about. The FILE_OPEN_ call that got the error 48 will have 48 returned from the call. If the older OPEN procedure was used to try to open the file, you'd get the error number using the FILEINFO procedure. As far as I recall, there is no way for one process to tell what file error another process got, except maybe using the procedures intended to implement debuggers, which I'm not familiar with. I have a feeling that is not what you are asking about, anyway.

Re: How to check if a file is OPEN

<1f327e7d-16d9-47a2-a0b1-e72b01b145f0n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=220&group=comp.sys.tandem#220

  copy link   Newsgroups: comp.sys.tandem
X-Received: by 2002:aed:20a2:: with SMTP id 31mr763349qtb.69.1629146407829; Mon, 16 Aug 2021 13:40:07 -0700 (PDT)
X-Received: by 2002:a25:bb08:: with SMTP id z8mr326439ybg.167.1629146407485; Mon, 16 Aug 2021 13:40:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.tandem
Date: Mon, 16 Aug 2021 13:40:07 -0700 (PDT)
In-Reply-To: <04b76747-86aa-4335-9f2f-7645fbbb85cfn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=65.125.102.200; posting-account=0NHiHgoAAAC-mY8P0yk1bd3zDKN8t6jB
NNTP-Posting-Host: 65.125.102.200
References: <0ad3781f-7b57-4757-8fd5-aa3518bccd72n@googlegroups.com> <03138bc6-de93-49d1-97ef-236cd475a9b5n@googlegroups.com> <sag707$4m5$1@dont-email.me> <e4457072-f4d5-4871-9741-c887f403aa25n@googlegroups.com> <7bc4c1e9-141a-4c63-bdba-a4a5008ad6fbn@googlegroups.com> <04b76747-86aa-4335-9f2f-7645fbbb85cfn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1f327e7d-16d9-47a2-a0b1-e72b01b145f0n@googlegroups.com>
Subject: Re: How to check if a file is OPEN
From: abolk...@gmail.com (Adam Kamal)
Injection-Date: Mon, 16 Aug 2021 20:40:07 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 134
 by: Adam Kamal - Mon, 16 Aug 2021 20:40 UTC

On Saturday, August 14, 2021 at 10:50:22 PM UTC-7, rkd...@gmail.com wrote:
> On Saturday, August 14, 2021 at 6:51:49 PM UTC-7, abol...@gmail.com wrote:
> > On Thursday, June 17, 2021 at 12:42:34 PM UTC-7, Rich S. wrote:
> > > On Thursday, June 17, 2021 at 3:15:21 PM UTC-4, JShepherd wrote:
> > > > In article <03138bc6-de93-49d1...@googlegroups.com>,
> > > > rkd...@gmail.com says...
> > > > >
> > > > >On Wednesday, June 16, 2021 at 7:24:35 PM UTC-7, abol...@gmail.com wrote:
> > > > >> in a Cobol program, how would you determine/check if enscribe file is ope=
> > > > >n?=20
> > > > >> I used COBOLFILEINFO and OPENINFO but it does not seem to return the prop=
> > > > >er code if a file is opened by another process. Any hint will be highly app=
> > > > >reciated.
> > > > >
> > > > >COBOLFILEINFO definitely won't do what you want. OPENINFO might let you de=
> > > > >termine whether the file is open, but the description in the manual is not =
> > > > >clear about which of the values it will return when a file is not open, so =
> > > > >I would not depend on it.
> > > > >
> > > > >I believe you must make a call to the Guardian procedure FILE_GETINFOLISTBY=
> > > > >NAME_ and request the value of item 75.
> > > > >
> > > > >As far as I can see from looking at the documentation of that procedure, yo=
> > > > >u should be able to call it from COBOL, but you must be careful to set up t=
> > > > >he item list argument and the result argument to be binary values of the co=
> > > > >rrect size. Also, I believe that when calling from COBOL, you pass just th=
> > > > >e name of the PIC X(n) data item that contains the file name and don't pass=
> > > > > anything for the length (at least at one time, COBOL would determine the l=
> > > > >ength itself and pass it automatically, without the programmer explicitly p=
> > > > >utting it into the call).
> > > > >
> > > > >If you cannot figure out how to make COBOL call that procedure, it might be=
> > > > > easier for you to write a C function that does the FILE_GETINFOLISTBYNAME_=
> > > > > call (assuming you know C and are not familiar with TAL) and have the C fu=
> > > > >nction return the value of item 75 for your COBOL code to check.
> > > > Additionally
> > > >
> > > > The FILE_GETOPENINFO_ procedure obtains information about the
> > > > opens of one disk file or all the files on a disk device
> > > > or the opens of certain nondisk devices.
> > > >
> > > > Each call returns information about one open;
> > > > make successive calls to FILE_GETOPENINFO_ to learn about
> > > > all the opens.
> > > Additionally, additionally...found and example from COBOL code using item 75 and FILE_GETINFOLISTBYNAME_ (as previously suggested). This would still assume you don't care who/what has it open:
> > >
> > > In working storage:
> > >
> > > 01 WS-PROC-CALL-STATUS NATIVE-2 VALUE 0.
> > > 01 WS-FILE-GETINFOLIST.
> > > 05 WS-FGIL-FNAME PIC X(40) VALUE SPACES.
> > > 05 WS-FGIL-FNAME-LEN NATIVE-2 VALUE ZERO.
> > > 05 WS-FGIL-ITEM-COUNT NATIVE-2 VALUE 5.
> > > 05 WS-FGIL-ITEM-VALUES-LEN NATIVE-2 VALUE 16.
> > > 05 WS-FGIL-ITEM-LIST.
> > > 10 WS-FGIL-SQL-TYPE-CODE NATIVE-2 VALUE 40.
> > > 10 WS-FGIL-FILE-TYPE-CODE NATIVE-2 VALUE 41.
> > > 10 WS-FGIL-FILE-CODE-CODE NATIVE-2 VALUE 42.
> > > 10 WS-FGIL-IS-OPEN-CODE NATIVE-2 VALUE 75.
> > > 10 WS-FGIL-LMOD-CODE NATIVE-2 VALUE 144.
> > > 05 WS-FGIL-ITEM-VALUES.
> > > 10 WS-FGIL-SQL-TYPE NATIVE-2 VALUE 0.
> > > 88 NOT-AN-SQL-OBJECT VALUE 0.
> > > 10 WS-FGIL-FILE-TYPE NATIVE-2 VALUE 0.
> > > 88 FILE-IS-UNSTRUCTURED VALUE 0.
> > > 10 WS-FGIL-FILE-CODE NATIVE-2 VALUE 0.
> > > 88 FILE-CODE-IS-0-OR-101 VALUE 0, 101.
> > > 88 FILE-IS-TYPE-101 VALUE 101.
> > > 10 WS-FGIL-IS-OPEN NATIVE-2 VALUE 0.
> > > 88 FILE-IS-NOT-OPEN VALUE 0.
> > > 88 FILE-IS-OPEN VALUE 1.
> > > 88 FILE-NOT-FOUND VALUE 11.
> > > 88 FILE-IS-A-KEEPER VALUE ZERO.
> > > 88 FILE-IS-NOT-A-KEEPER VALUE 99.
> > > 10 WS-FGIL-LMOD-TSTAMP NATIVE-8 VALUE 0.
> > >
> > > in code:
> > >
> > > **** populate the file name and file name length fields first ***
> > >
> > > ENTER "FILE_GETINFOLISTBYNAME_" USING WS-FGIL-FNAME (1:WS-FGIL-FNAME-LEN)
> > > , WS-FGIL-ITEM-LIST
> > > , WS-FGIL-ITEM-COUNT
> > > , WS-FGIL-ITEM-VALUES
> > > , WS-FGIL-ITEM-VALUES-LEN
> > > GIVING WS-PROC-CALL-STATUS.
> > >
> > > **** check the WS-FGIL-IS-OPEN variable or the associated 88-level switches.
> > Would you please post a link to the document where item number codes and its usage can be located. I guess how did you know item number 75 will return file open status? what would be the item number to determine security violation (AKA Error 48) if a process is trying yo open a file that is secured "UUUU" . Thanks in advance.
> I'm not quite sure what the second part of your question is asking for. If you want to know the item code that shows the file security setting, that is given by item 62, but you probably also would have to look at item 58, which tells you the userid of the file owner, and item 59, which tells you whether the file is under Safeguard security or not.
>
> Only the process that tried to open a file will get the error 48, so I'm not sure what that part of the question is about. The FILE_OPEN_ call that got the error 48 will have 48 returned from the call. If the older OPEN procedure was used to try to open the file, you'd get the error number using the FILEINFO procedure. As far as I recall, there is no way for one process to tell what file error another process got, except maybe using the procedures intended to implement debuggers, which I'm not familiar with. I have a feeling that is not what you are asking about, anyway.

As usual very helpful and informative. I genuinely appreciate your help and time. Thank you!

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor