Joined: 02 Dec 2002 Posts: 706 Topics: 65 Location: MD, USA
Posted: Wed Sep 09, 2026 8:48 am Post subject: Comparing two files with different layouts
Hi,
I have file-aid DB2 RDX extracts of two versions of a database in flat files. I have corresponding XREF and COBOL layout. Is there a way to compare the common fields in the two files. I am thinking of generating file-aid compare cards for these two layouts but checking if a simpler solution exists.
Diba.
Edit:
Comparison report should report all differences at field level with field names and old and new values, like -
Joined: 02 Dec 2002 Posts: 706 Topics: 65 Location: MD, USA
Posted: Thu Sep 10, 2026 2:38 pm Post subject:
Thanks Kolusu. I need differences at field level with field names, edited my post with a sample report. I think it would be challenging to do that with DFSORT. _________________ Regards,
Diba
Joined: 26 Nov 2002 Posts: 12406 Topics: 75 Location: San Jose
Posted: Thu Sep 10, 2026 8:39 pm Post subject:
Dibakar wrote:
Thanks Kolusu. I need differences at field level with field names, edited my post with a sample report. I think it would be challenging to do that with DFSORT.
Dibakar,
Challenging but very much do-able. So please post a sample of BOTH input files along with desired output along with DCB properties of the input and output files and we will see if it can be done using DFSORT. _________________ Kolusu
www.linkedin.com/in/kolusu
Joined: 02 Dec 2002 Posts: 706 Topics: 65 Location: MD, USA
Posted: Fri Sep 11, 2026 8:32 am Post subject:
Kolusu,
For input there will be two sets (old and new) each of - File-Aid Xref, Cobol layout and data files. Automation will have to process all these to generate the compare code. It will take some time for me to create them that I can post here. _________________ Regards,
Diba
Joined: 02 Dec 2002 Posts: 706 Topics: 65 Location: MD, USA
Posted: Mon Sep 14, 2026 10:47 am Post subject:
Here are the details.
Cobol layouts, old and new versions. Each '01' level represents a DB2 table, naming format is <db2 schema name>-<DB2 table name>. Schema name can change in different versions, but table name will remain same. Table order can change in the layout. Old table can get deleted from old layout and new tables can get added in new layout. Level '10' fields, represents table fields. The names remain same in different versions, but ordering can be different. Old fields can get deleted from old layout and new fields can get added to new layout.
Xref tells which record to map with which '01' layout. For example the old XREF below tells that if input record has value 'D002', called D#, at position 7 then map record with the old layout 'SCHMAOL-ADDRESB'. If the D# is anything other than 'D001' thru 'D003', then match it with the OBJECT-DFLT layout.
Old Xref:
Code:
/* CAUTION: If you edit this member manually, with the File-AID
/* editor or any other editor, immediately issue the command:
/* PRESERVE ON (or its equivalent)
/* to preserve trailing blanks which are required by File-AID.
/*
/* When you edit criteria outside of File-AID, member type
/* identification (XREF/CHGC/SELC) may be lost. File-AID will
/* include unidentified members in all Member List displays;
/* selecting the correct member is a customer responsibility.
/*
/* COMPUWARE ASSUMES NO LIABILITY FOR RESULTS OF USING MEMBERS
/* THAT HAVE BEEN EDITED MANUALLY.
/*
/* Copyright (c) 1993-2008 by COMPUWARE Corporation,
/* All Rights Reserved.
/*
/*
DEFINE BLOCKS=XREF,
DESCRIPTION ="FILE-AID/RDX GENERATED XREF",
LAYOUT_DSNAME=SYS.LAYOUT,
LAYOUT_FILLER=10
SELECT SET=1,LAYOUT=SCHMAOL-ADDRESA,
LAYOUT_MBRNAME=BOL,
LAYOUT_TYPE=BASE
IF
POSITION=7,LENGTH=4,OPERATOR=EQ,
TYPE=T,VALUE=D001
SELECT SET=1,LAYOUT=SCHMAOL-ADDRESB,
LAYOUT_MBRNAME=BOL,
LAYOUT_TYPE=BASE
IF
POSITION=7,LENGTH=4,OPERATOR=EQ,
TYPE=T,VALUE=D002
SELECT SET=1,LAYOUT=SCHMAOL-ADDRESC,
LAYOUT_MBRNAME=BOL,
LAYOUT_TYPE=BASE
IF
POSITION=7,LENGTH=4,OPERATOR=EQ,
TYPE=T,VALUE=D003
/* CAUTION: If you edit this member manually, with the File-AID
/* editor or any other editor, immediately issue the command:
/* PRESERVE ON (or its equivalent)
/* to preserve trailing blanks which are required by File-AID.
/*
/* When you edit criteria outside of File-AID, member type
/* identification (XREF/CHGC/SELC) may be lost. File-AID will
/* include unidentified members in all Member List displays;
/* selecting the correct member is a customer responsibility.
/*
/* COMPUWARE ASSUMES NO LIABILITY FOR RESULTS OF USING MEMBERS
/* THAT HAVE BEEN EDITED MANUALLY.
/*
/* Copyright (c) 1993-2008 by COMPUWARE Corporation,
/* All Rights Reserved.
/*
/*
DEFINE BLOCKS=XREF,
DESCRIPTION ="FILE-AID/RDX GENERATED XREF",
LAYOUT_DSNAME=SYS.LAYOUT,
LAYOUT_FILLER=10
SELECT SET=1,LAYOUT=SCHMANU-ADDRESC,
LAYOUT_MBRNAME=BNU,
LAYOUT_TYPE=BASE
IF
POSITION=7,LENGTH=4,OPERATOR=EQ,
TYPE=T,VALUE=D001
SELECT SET=1,LAYOUT=SCHMANU-ADDRESB,
LAYOUT_MBRNAME=BNU,
LAYOUT_TYPE=BASE
IF
POSITION=7,LENGTH=4,OPERATOR=EQ,
TYPE=T,VALUE=D002
SELECT SET=1,LAYOUT=SCHMANU-ADDRESD,
LAYOUT_MBRNAME=BNU,
LAYOUT_TYPE=BASE
IF
POSITION=7,LENGTH=4,OPERATOR=EQ,
TYPE=T,VALUE=D003
Input data files, it will only have table records common to both versions, only one record for each table. It will have 1-1 match between two files, 1st record in old file and new file will represent same table (even though they will have different D# values at position 7). Second record in both files will again represent same table, and so on. Below first record in both files represent ADDRESB table, 2nd record in both files represent ADDRESC table. '.'s represent binary field(s) data.
Old data file:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
000001D002......MD100 FREEDOM ST FREEDOM VALLEY
000001D003......MD100 FREEDOM ST FREEDOM VALLEY
000001D999......MD100 FREEDOM ST FREEDOM VALLEY
******************************** Bottom of Data ********************************
New data file:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
000001D002......200 FREEDOM ST FREEDOM VALLEY
000001D001......MD100 FREEDOM ST FREEDOM VALLEY
000001D999......MD100 FREEDOM ST FREEDOM VALLEY
******************************** Bottom of Data ********************************
Sample file-aid comparison report. It can be in any format, as long as it gives me the required information - Record number, group and elementary field names, old and new values.
Code:
FILE-AID 23.1 COMPARE DETAIL REPORT USERID-#USERFAC DATE 09/14/2026 TIME 11:33:17 PAGE 1
"OLD" DSN: SYS.FNCTST.IN(BOL) "NEW" DSN: SYS.IN(BNU)
===================================================================================================================================
CHANGED RECORD "OLD" FILE RECORD: 1 | "NEW" FILE RECORD: 1
NUM DATA-FIELD-NAME FORMAT FIELD VALUES | NUM DATA-FIELD-NAME FORMAT FIELD VALUES
---- ---------------------------- -------- -------------------- |---- ---------------------------- -------- --------------------
1 SCHMAOL-ADDRESB | 1 SCHMANU-ADDRESB
|
>>> COMPARED FIELDS - - - - - - - - - | - - - - - - - - - COMPARED FIELDS <<<
|
6 ADDR-UID BS 9 11 | 6 ADDR-UID BS 9 22
8 ADDRLN-1 C 40 100 FREEDOM ST | 7 ADDRLN-1 C 40 200 FREEDOM ST
(POS 21-40) | (POS 21-40)
|
===================================================================================================================================
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum