Hi I need to compare two files using SORT utility like...
File 1
id name no time date address bala
1 sdbskafjo 456 12 12302009 nejfirejt 1000
2 narjweop 678 24 12312010 dfngijreo 2000
4 mnjdjhdj 956 08 12082012 asefgrg 950
File2
id name no time date address bala
1 sdbskafjo 456 12 12302009 nejfirejt 200
2 narjweop 678 24 12312010 dfngijreo 300
3 abcdefgh 362 15 12302010 asdafggf 80
Now I want the o/p as..
id name Time no date address bala
1 sdbskafjo 12 456 12302009 nejfirejt 800
2 narjweop 24 678 12312010 dfngijreo 1700
4 mnjdjhdj 956 08 12082012 asefgrg 950
3 abcdefgh 362 15 12302010 asdafggf 80
Here we have to rearrange one of the column field in the output (like time & no have been interchanged) and also the difference between the last column for a match has to be obtained.
Comparison is done between all the columns (id, name, no , time,date and address) except the bala column.
SORT for 2 files
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 4
- Joined: Tue Oct 25, 2016 9:28 pm
Start using code tag like below
what should be the output if there is a mismatch in any of the column.
Thanks
Magesh
Code: Select all
1 SDBSKAFJO 456 12 12302009 NEJFIREJT 1000
2 NARJWEOP 678 24 12312010 DFNGIJREO 2000
4 MNJDJHDJ 956 08 12082012 ASEFGRG 950
Code: Select all
1 SDBSKAFJO 456 12 12302009 NEJFIREJT 200
2 NARJWEOP 678 24 12312010 DFNGIJREO 300
3 ABCDEFGH 362 15 12302010 ASDAFGGF 80
Thanks
Magesh
-
- Member
- Posts: 4
- Joined: Tue Oct 25, 2016 9:28 pm
Hi Magesh
Mismatch in any of the column will be a new entry in the output file.
Thanks.
you must also UNCHECK the Disable BBCODE
Code: Select all
1 SDBSKAFJO 456 12 12302009 NEJFIREJT 800
2 NARJWEOP 678 24 12312010 DFNGIJREO 1700
4 MNJDJHDJ 956 08 12082012 ASEFGRG 950
3 ABCDEFGH 362 15 12302010 ASDAFGGF 80
Thanks.
you must also UNCHECK the Disable BBCODE
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page