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.
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.
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.
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.
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;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:
make successive calls to FILE_GETOPENINFO_ to learn about
all the opens.
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.
On Wednesday, June 16, 2021 at 7:24:35 PM UTC-7, abol...@gmail.com wrote: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
in a Cobol program, how would you determine/check if enscribe file is open?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 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.
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
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 ofitem 75 for your COBOL code to check.
On Thursday, June 17, 2021 at 3:15:21 PM UTC-4, JShepherd wrote: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
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;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:
make successive calls to FILE_GETOPENINFO_ to learn about
all the opens.
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.
On Thursday, June 17, 2021 at 12:42:34 PM UTC-7, Rich S. wrote:process is trying yo open a file that is secured "UUUU" . Thanks in advance.
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;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:
make successive calls to FILE_GETOPENINFO_ to learn about
all the opens.
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
On Thursday, June 17, 2021 at 12:42:34 PM UTC-7, Rich S. wrote:process is trying yo open a file that is secured "UUUU" . Thanks in advance.
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;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:
make successive calls to FILE_GETOPENINFO_ to learn about
all the opens.
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
On Saturday, August 14, 2021 at 6:51:49 PM UTC-7, abol...@gmail.com wrote:process is trying yo open a file that is secured "UUUU" . Thanks in advance.
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;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:
make successive calls to FILE_GETOPENINFO_ to learn about
all the opens.
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
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 ofthe 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 toopen 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
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 74:54:12 |
Calls: | 6,489 |
Calls today: | 2 |
Files: | 12,096 |
Messages: | 5,276,047 |