I hope someone can shed some light on this problem as I have been banging
my head off the wall with it for days on end now.
Cobol/Vplus program. Linked with PM but at the moment I call FOPEN on
an input file it is in USERMODE.
The file it FOPENs is a KSAMXL file and its file code = zeroes. See below:
FILE: STATES.PUB.DEV
FILE CODE : 0 FOPTIONS: ASCII,FIXED,NOCCTL,KSAMXL
BLK FACTOR: 17 CREATOR : MGR.DEV
REC SIZE: 223(BYTES) LOCKWORD:
BLK SIZE: 4096(BYTES) SECURITY--READ : ANY
EXT SIZE: 0(SECT) WRITE : ANY
NUM REC: 211 APPEND : ANY
NUM SEC: 1440 LOCK : ANY
NUM EXT: 4 EXECUTE : ANY
MAX REC: 5000 **SECURITY IS ON
FLAGS : NO ACCESSORS
NUM LABELS: 0 CREATED : MON, JAN 11, 2010, 9:35 PM
MAX LABELS: 254 MODIFIED: MON, JAN 11, 2010, 9:35 PM
DISC DEV #: 2 ACCESSED: MON, JAN 11, 2010, 9:44 PM
SEC OFFSET: 65024 LABEL ADDR: $0000005F.$003D4720
VOLCLASS : MPEXL_SYSTEM_VOLUME_SET:DISC
KEY KEY TYPE KEY LOCATION KEY SIZE DUP/RDUP
--- -------- ------------ -------- --------
1 BYTE 3 3 RDUP
2 BYTE 6 1 RDUP
3 BYTE 7 1 RDUP
4 BYTE 8 1 RDUP
5 BYTE 9 1 RDUP
6 BYTE 10 1 DUP
7 BYTE 11 1 DUP
8 BYTE 12 1 RDUP
9 BYTE 13 1 DUP
10 BYTE 14 1 RDUP
11 BYTE 15 2 DUP
12 BYTE 17 1 RDUP
13 BYTE 18 1 RDUP
14 BYTE 19 2 DUP
15 BYTE 21 2 RDUP
16 BYTE 23 2 DUP
NUM KSAM KEYS: 16 FIRST KSAM RECORD: 1
LANGUAGE : NATIVE-3000 REUSE RECORD : NO
PRIMARY KEY : RANDOM COMPUTE BLK SIZE : DEFBLK
VERSION : 2 DATA BLOCK SIZE : 4096
The file equation is:
FILE INFILE2=STATES.PUB.DEV,OLD;SHR;LOCK
IN USER MODE
A100: ORIGINAL FILE OPENED WITH FILE CODE=>STATES.PUB.DEV >+0000>+000000000<
IN USER MODE
%340 on the aoptions = shr;lock;read
The FOPEN works fine and opens the file ok.
After processing, I fclose the file with disposition = 4 (delete).
The fclose fails in USERMODE but closes and deletes the file ok if I plug in
a call to GETPRIVMODE prior to the fclose.
Can someone enlighten me as to why the program must be in priv mode
for this fclose to work? The file is not a PM file (by PM, I mean a file with
a negative file code).
Any help would be appreciated.
TIA,
Brian.
MOVE "*INFILE2" TO WS-FILE-NAME-2
MOVE %340 TO WS-AOPTIONS
CALL INTRINSIC "FOPEN" USING WS-FILE-NAME-2
WS-FOPTIONS
WS-AOPTIONS
WS-REC-SIZE-2
\\ \\ \\ \\
\\ \\ \\ \\
WS-FILE-CODE
GIVING WS-FILE-NUM-2
FOPEN successful...
Further down in the logic --
CALL INTRINSIC "FCLOSE" USING WS-FILE-NUM-2
\4\ \0\
IF C-C <> ZEROES THEN
CALL INTRINSIC "FCHECK" USING WS-FILE-NUM-2
WS-ERROR-CODE-2
\\ \\ \\
DISPLAY 'FCLOSE (2) FAILED=>' WS-ERROR-CODE-2 "<"
PERFORM Y300-PURGE-HOLD-FILE
THRU Y300-PURGE-HOLD-FILE-EXIT
IF ERR-FLAG <> ZEROES THEN
GO TO A100-EXIT
END-IF
MOVE WS-ERROR-CODE-2 TO WS-ERROR-CODE
MOVE 40 TO WS-MSGNUM
MOVE 1 TO ERR-FLAG
GO TO A100-EXIT
END-IF
C-C on the Fclose is <> zeroes so the fcheck is called and it gives me
an error code = zeroes.
The message "FCLOSE (2) FAILED=>+0000<" is displayed.
IN USER MODE
The message in the window at the bottom of the Vplus screen is:
Cannot "FCLOSE" Perm File For Renaming (Delete Disposition) 40
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|