Following Problem with compile XFD-compileable COBOL program. I have got following code sequence in a FD.
216 $XFD COMMENT Adressenstamm
217 $XFD FILE=SADF
218
219 FD SADF
220 LABEL RECORD OMITTED
221 DATA RECORD IS SADR.
222
223
224 78 SAD-KN-RECLEN VALUE 10000.
225
226 01 SADR.
227
228 02 SAD-TA.
229 * -- Firmennummer
230 03 SAD-KY PIC 9(4).
231
232 * -- Key 0 (Primary Key)
233 03 SAD-TAKY0.
234 * -- Adressennummer
235 04 SAD-KYKD PIC X(9).
236 * -- Adressennummer komplett wg/acu-xdbc
237 04 SAD-RDKYKD REDEFINES SAD-KYKD.
238 * -- Adressenart (1=Debitor, 2=Kreditor
239 05 SAD-KZKYKD PIC 9.
240 * -- Laufende Nummer der Adresse
241 05 SAD-KDKYKD PIC X(8).
Program is prepared for compile with AcuXDBC Options. After compile program I get this warning message from Acucobol Compiler:
line 198: Warning: Field SAD-KZKYKD causes duplicate database data
Have anyone an idea about this message?
#fd#AcuXDBC#XFDAn Addition of my question. XDBC table is generated with both fields, SAD-KYKD and SAD-KZKYKD, but the second is a redefination of first field. Normally it generates table fields from non-redefination fields (like SAD-KYKD). Redefined fields (like SAD-KYKD) are not respect by XDBC.
But these are key fields. I've got a notation there are differences in generating of XFD fields from COBOL between key fields an normal data fields.
Have anyone an idea about? Thanks.
Following Problem with compile XFD-compileable COBOL program. I have got following code sequence in a FD.
216 $XFD COMMENT Adressenstamm
217 $XFD FILE=SADF
218
219 FD SADF
220 LABEL RECORD OMITTED
221 DATA RECORD IS SADR.
222
223
224 78 SAD-KN-RECLEN VALUE 10000.
225
226 01 SADR.
227
228 02 SAD-TA.
229 * -- Firmennummer
230 03 SAD-KY PIC 9(4).
231
232 * -- Key 0 (Primary Key)
233 03 SAD-TAKY0.
234 * -- Adressennummer
235 04 SAD-KYKD PIC X(9).
236 * -- Adressennummer komplett wg/acu-xdbc
237 04 SAD-RDKYKD REDEFINES SAD-KYKD.
238 * -- Adressenart (1=Debitor, 2=Kreditor
239 05 SAD-KZKYKD PIC 9.
240 * -- Laufende Nummer der Adresse
241 05 SAD-KDKYKD PIC X(8).
Program is prepared for compile with AcuXDBC Options. After compile program I get this warning message from Acucobol Compiler:
line 198: Warning: Field SAD-KZKYKD causes duplicate database data
Have anyone an idea about this message?
#fd#AcuXDBC#XFDAn Addition of my question. XDBC table is generated with both fields, SAD-KYKD and SAD-KZKYKD, but the second is a redefination of first field. Normally it generates table fields from non-redefination fields (like SAD-KYKD). Redefined fields (like SAD-KYKD) are not respect by XDBC.
But these are key fields. I've got a notation there are differences in generating of XFD fields from COBOL between key fields an normal data fields.
Have anyone an idea about? Thanks.
Following Problem with compile XFD-compileable COBOL program. I have got following code sequence in a FD.
216 $XFD COMMENT Adressenstamm
217 $XFD FILE=SADF
218
219 FD SADF
220 LABEL RECORD OMITTED
221 DATA RECORD IS SADR.
222
223
224 78 SAD-KN-RECLEN VALUE 10000.
225
226 01 SADR.
227
228 02 SAD-TA.
229 * -- Firmennummer
230 03 SAD-KY PIC 9(4).
231
232 * -- Key 0 (Primary Key)
233 03 SAD-TAKY0.
234 * -- Adressennummer
235 04 SAD-KYKD PIC X(9).
236 * -- Adressennummer komplett wg/acu-xdbc
237 04 SAD-RDKYKD REDEFINES SAD-KYKD.
238 * -- Adressenart (1=Debitor, 2=Kreditor
239 05 SAD-KZKYKD PIC 9.
240 * -- Laufende Nummer der Adresse
241 05 SAD-KDKYKD PIC X(8).
Program is prepared for compile with AcuXDBC Options. After compile program I get this warning message from Acucobol Compiler:
line 198: Warning: Field SAD-KZKYKD causes duplicate database data
Have anyone an idea about this message?
#fd#AcuXDBC#XFDAn Addition of my question. XDBC table is generated with both fields, SAD-KYKD and SAD-KZKYKD, but the second is a redefination of first field. Normally it generates table fields from non-redefination fields (like SAD-KYKD). Redefined fields (like SAD-KYKD) are not respect by XDBC.
But these are key fields. I've got a notation there are differences in generating of XFD fields from COBOL between key fields an normal data fields.
Have anyone an idea about? Thanks.
Following Problem with compile XFD-compileable COBOL program. I have got following code sequence in a FD.
216 $XFD COMMENT Adressenstamm
217 $XFD FILE=SADF
218
219 FD SADF
220 LABEL RECORD OMITTED
221 DATA RECORD IS SADR.
222
223
224 78 SAD-KN-RECLEN VALUE 10000.
225
226 01 SADR.
227
228 02 SAD-TA.
229 * -- Firmennummer
230 03 SAD-KY PIC 9(4).
231
232 * -- Key 0 (Primary Key)
233 03 SAD-TAKY0.
234 * -- Adressennummer
235 04 SAD-KYKD PIC X(9).
236 * -- Adressennummer komplett wg/acu-xdbc
237 04 SAD-RDKYKD REDEFINES SAD-KYKD.
238 * -- Adressenart (1=Debitor, 2=Kreditor
239 05 SAD-KZKYKD PIC 9.
240 * -- Laufende Nummer der Adresse
241 05 SAD-KDKYKD PIC X(8).
Program is prepared for compile with AcuXDBC Options. After compile program I get this warning message from Acucobol Compiler:
line 198: Warning: Field SAD-KZKYKD causes duplicate database data
Have anyone an idea about this message?
#fd#AcuXDBC#XFDFields contained in a redefining item occupy the same positions as the fields being redefined. The compiler needs to select only one of the field definitions to use. The default rule that it follows is to use the fields in the item being redefined as column names. Take a look at the WHEN directive for XFDs.
Following Problem with compile XFD-compileable COBOL program. I have got following code sequence in a FD.
216 $XFD COMMENT Adressenstamm
217 $XFD FILE=SADF
218
219 FD SADF
220 LABEL RECORD OMITTED
221 DATA RECORD IS SADR.
222
223
224 78 SAD-KN-RECLEN VALUE 10000.
225
226 01 SADR.
227
228 02 SAD-TA.
229 * -- Firmennummer
230 03 SAD-KY PIC 9(4).
231
232 * -- Key 0 (Primary Key)
233 03 SAD-TAKY0.
234 * -- Adressennummer
235 04 SAD-KYKD PIC X(9).
236 * -- Adressennummer komplett wg/acu-xdbc
237 04 SAD-RDKYKD REDEFINES SAD-KYKD.
238 * -- Adressenart (1=Debitor, 2=Kreditor
239 05 SAD-KZKYKD PIC 9.
240 * -- Laufende Nummer der Adresse
241 05 SAD-KDKYKD PIC X(8).
Program is prepared for compile with AcuXDBC Options. After compile program I get this warning message from Acucobol Compiler:
line 198: Warning: Field SAD-KZKYKD causes duplicate database data
Have anyone an idea about this message?
#fd#AcuXDBC#XFDThe WHEN directive should allow you to use both names even though they occupy the same place within the COBOL data file.
Following Problem with compile XFD-compileable COBOL program. I have got following code sequence in a FD.
216 $XFD COMMENT Adressenstamm
217 $XFD FILE=SADF
218
219 FD SADF
220 LABEL RECORD OMITTED
221 DATA RECORD IS SADR.
222
223
224 78 SAD-KN-RECLEN VALUE 10000.
225
226 01 SADR.
227
228 02 SAD-TA.
229 * -- Firmennummer
230 03 SAD-KY PIC 9(4).
231
232 * -- Key 0 (Primary Key)
233 03 SAD-TAKY0.
234 * -- Adressennummer
235 04 SAD-KYKD PIC X(9).
236 * -- Adressennummer komplett wg/acu-xdbc
237 04 SAD-RDKYKD REDEFINES SAD-KYKD.
238 * -- Adressenart (1=Debitor, 2=Kreditor
239 05 SAD-KZKYKD PIC 9.
240 * -- Laufende Nummer der Adresse
241 05 SAD-KDKYKD PIC X(8).
Program is prepared for compile with AcuXDBC Options. After compile program I get this warning message from Acucobol Compiler:
line 198: Warning: Field SAD-KZKYKD causes duplicate database data
Have anyone an idea about this message?
#fd#AcuXDBC#XFDYou are correct that when you have a redefined field, only the first field (the one being redefined by the second) will be included as a column in the XFD - except for when the second one (or part of it) is declared as a KEY field. All KEY fields must be included as columns, so now we have the same data being added twice and thus the duplicate data warning.
Assuming the following SELECT:
select sadf assign to disk
organization is indexed
record key is sad-ky
alternate key is sad-kykd
alternate key is sad-kzkykd.
and this part of the FD:
03 SAD-KY PIC 9(4).
03 SAD-TAKY0.
* -- This field will be included because it's the one
* -- being redefined (AND because it's a key field)
04 SAD-KYKD PIC X(9).
04 SAD-RDKYKD REDEFINES SAD-KYKD.
* -- This field must be included because it's a key
* -- field (but the data has already been included
* -- above, thus causing the duplicate data warning)
05 SAD-KZKYKD PIC 9.
05 SAD-KDKYKD PIC X(8).
The duplicate data warning is just that - a warning. If you are going to update data through AcuXDBC, you will need to make sure that the duplicated areas contain the same values. If not... I'm not sure what the result will be, but my guess is that one or the other will take precedence and the other will be ignored. Or, it may cause an error of some sort.