i need to compare two files using SORT.
Here is my requirement:
I have two input files
input 1: length 850
input 2: length 200
I need to compare the (9,9,ch) of both the files. this 9,9 indicates the account number starting from 9th position with length 9. For those accounts that has a match in the input file,the (114,3,ch) data has to be fetched from the input 2.
That is there is a label for each account in input 2. i need to fetch those labels for every match in account in both the files.
Regarding duplicates, there will be duplicates in both the files.
i want to ignore the duplicates.
How can this be done using a sort?? I cant use ICETOOL. Can my
requirements be done using SORT CARD??
compare two files using SORT
Moderators: Frank Yaeger, Moderator Group
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Why can't you use ICETOOL? If you can use DFSORT, you can use ICETOOL. ICETOOL has been available with DFSORT since 1991.How can this be done using a sort?? I cant use ICETOOL. Can my
requirements be done using SORT CARD??
Please show an example of the records in each input file (relevant fields only) and what you expect for output.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Member
- Posts: 11
- Joined: Tue Nov 13, 2007 1:57 pm
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You can use a DFSORT/ICETOOL job like the following to do what you asked for.
Note: You said 114,3,CH in your first post, but showed COL144 in your last post. I assumed it's 144 - if it's 114, just change the job appropriately.
Note: You said 114,3,CH in your first post, but showed COL144 in your last post. I assumed it's 144 - if it's 114, just change the job appropriately.
Code: Select all
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/850)
//IN2 DD DSN=... input file2 (FB/200)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/13)
//TOOLIN DD *
SELECT FROM(IN2) TO(T1) ON(5,9,CH) FIRST USING(CTL2)
SELECT FROM(IN1) TO(T1) ON(5,9,CH) FIRST USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(5,9,CH) FIRSTDUP
/*
//CTL1CNTL DD *
INREC BUILD=(5:9,9)
/*
//CTL2CNTL DD *
INREC BUILD=(1:144,3,5:9,9)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Member
- Posts: 11
- Joined: Tue Nov 13, 2007 1:57 pm
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