klophockey
Programmer
I would appreciate your expert knowledge on an issue I am encountering but cannot find documentation that puts the issue to rest.
I am using the MFCobol compiler and runtime for this Cobol program.
The issue occurs on AIX, Solaris Sparc and Linux machines.
The file being written to is defined as using a Record Key with duplicates.
I am receiving a return status code of "02" when I write a duplicate record to the file.
When coding the program, I assumed that writing a duplicate record to the file would return a file status of "00"
My questions are
- Is the "02" files status an informational status code or is it actually indicating an error condition?
- Should I expect the file status return code to be "00" or a combination of "00" or "02"?
My file definition and layout is shown below.
Thank you very much for taking time to share your knowledge with me.
SELECT MYFIL3A ASSIGN TO "MYFIL3A"
ORGANIZATION IS INDEXED
ACCESS IS DYNAMIC
RECORD KEY IS MYF3A-KEY With Duplicates
FILE STATUS IS STAT3A.
FD MYFIL3A.
01 MYFIL3A-REC.
05 MYF3A-KEY Pic 9(9).
05 MYF3A-TEXT-DATA Pic X(58).
05 MYF3A-ALPHA Pic X(10).
05 MYF3A-ALPHANUMERIC Pic X(20).
05 MYF3A-NUMERIC Pic 9(5).
05 MYF3A-SPACES Pic X(2966).
05 MYF3A-ZEROS Pic 9(31).
05 MYF3A-ZEROS-IN-SPACES Pic X(2000).
*COMP-1
05 MYF3A-C1-1 Comp-1 PIC 9.
05 MYF3A-C1-1S Comp-1 Pic S9.
05 MYF3A-C1-2 Comp-1 Pic 9(4).
05 MYF3A-C1-2S Comp-1 Pic S9(4).
*COMP-2
05 MYF3A-C2-1 Comp-2 Pic 99v99.
05 MYF3A-C2-1S Comp-2 Pic S99v99.
*COMP-3
05 MYF3A-C3-1 Comp-3 Pic 9.
05 MYF3A-C3-1S Comp-3 Pic S9.
05 MYF3A-C3-2 Comp-3 Pic 9(9).
05 MYF3A-C3-2S Comp-3 Pic S9(9).
05 MYF3A-C3-3 Comp-3 Pic 9(3)v99.
05 MYF3A-C3-3S Comp-3 Pic S9(3)v99.
*COMP-4
05 MYF3A-C4-1 Comp-4 Pic 9.
05 MYF3A-C4-1S Comp-4 Pic S9.
05 MYF3A-C4-2 Comp-4 Pic 9(4).
05 MYF3A-C4-2S Comp-4 Pic S9(4).
05 MYF3A-C4-3 Comp-4 Pic 9(7).
05 MYF3A-C4-3S Comp-4 Pic S9(7).
05 MYF3A-C4-4 Comp-4 Pic 9(9)v99.
05 MYF3A-C4-4S Comp-4 Pic S9(9)v99.
*COMP-5
05 MYF3A-C5-1 Comp-5 Pic 9(9).
05 MYF3A-C5-1S Comp-5 Pic S9(9).
*COMP-6
05 MYF3A-C6-1 Comp-6 Pic 9(3).
05 MYF3A-C6-2 Comp-6 Pic 9(4).
05 MYF3A-C6-3 Comp-6 Pic 9(4)v99.
*COMP-X
05 MYF3A-CX-2 Comp-X Pic 9(9).
*COMP-N
05 MYF3A-CN-2 Comp-N Pic 9(9).
Write MYFILA-REC.
Write MYFIL3A-REC.
If STAT3A = '00'
Continue
Else
DISPLAY ' Write MYFILA Record 1 Fail ' STAT3A
End-If.
I am using the MFCobol compiler and runtime for this Cobol program.
The issue occurs on AIX, Solaris Sparc and Linux machines.
The file being written to is defined as using a Record Key with duplicates.
I am receiving a return status code of "02" when I write a duplicate record to the file.
When coding the program, I assumed that writing a duplicate record to the file would return a file status of "00"
My questions are
- Is the "02" files status an informational status code or is it actually indicating an error condition?
- Should I expect the file status return code to be "00" or a combination of "00" or "02"?
My file definition and layout is shown below.
Thank you very much for taking time to share your knowledge with me.
SELECT MYFIL3A ASSIGN TO "MYFIL3A"
ORGANIZATION IS INDEXED
ACCESS IS DYNAMIC
RECORD KEY IS MYF3A-KEY With Duplicates
FILE STATUS IS STAT3A.
FD MYFIL3A.
01 MYFIL3A-REC.
05 MYF3A-KEY Pic 9(9).
05 MYF3A-TEXT-DATA Pic X(58).
05 MYF3A-ALPHA Pic X(10).
05 MYF3A-ALPHANUMERIC Pic X(20).
05 MYF3A-NUMERIC Pic 9(5).
05 MYF3A-SPACES Pic X(2966).
05 MYF3A-ZEROS Pic 9(31).
05 MYF3A-ZEROS-IN-SPACES Pic X(2000).
*COMP-1
05 MYF3A-C1-1 Comp-1 PIC 9.
05 MYF3A-C1-1S Comp-1 Pic S9.
05 MYF3A-C1-2 Comp-1 Pic 9(4).
05 MYF3A-C1-2S Comp-1 Pic S9(4).
*COMP-2
05 MYF3A-C2-1 Comp-2 Pic 99v99.
05 MYF3A-C2-1S Comp-2 Pic S99v99.
*COMP-3
05 MYF3A-C3-1 Comp-3 Pic 9.
05 MYF3A-C3-1S Comp-3 Pic S9.
05 MYF3A-C3-2 Comp-3 Pic 9(9).
05 MYF3A-C3-2S Comp-3 Pic S9(9).
05 MYF3A-C3-3 Comp-3 Pic 9(3)v99.
05 MYF3A-C3-3S Comp-3 Pic S9(3)v99.
*COMP-4
05 MYF3A-C4-1 Comp-4 Pic 9.
05 MYF3A-C4-1S Comp-4 Pic S9.
05 MYF3A-C4-2 Comp-4 Pic 9(4).
05 MYF3A-C4-2S Comp-4 Pic S9(4).
05 MYF3A-C4-3 Comp-4 Pic 9(7).
05 MYF3A-C4-3S Comp-4 Pic S9(7).
05 MYF3A-C4-4 Comp-4 Pic 9(9)v99.
05 MYF3A-C4-4S Comp-4 Pic S9(9)v99.
*COMP-5
05 MYF3A-C5-1 Comp-5 Pic 9(9).
05 MYF3A-C5-1S Comp-5 Pic S9(9).
*COMP-6
05 MYF3A-C6-1 Comp-6 Pic 9(3).
05 MYF3A-C6-2 Comp-6 Pic 9(4).
05 MYF3A-C6-3 Comp-6 Pic 9(4)v99.
*COMP-X
05 MYF3A-CX-2 Comp-X Pic 9(9).
*COMP-N
05 MYF3A-CN-2 Comp-N Pic 9(9).
Write MYFILA-REC.
Write MYFIL3A-REC.
If STAT3A = '00'
Continue
Else
DISPLAY ' Write MYFILA Record 1 Fail ' STAT3A
End-If.