Hi can anyone help me on below query as:
I need to searh a bill id (which is to be picked from one file) and search in the whole input file. If that bill id is found in input file then all the records with thta bil id should be removed from input files.
File 1: recfm =VB ,lrec=621
SCH000370561000704
NMM000370561M24.10.1982
MEM000370561N
NMM000370561F23.12.1985
MEM000370561N
MEM000370561NTK10057794
MEM000370561NTK10141897
SCH000369465000404
NMM000369465M13.10.1984
MEM000369465N
NMM000369465M30.05.1972
MEM000369465N
MEM000369465NTK91955419
MEM000369465NTK10127458
SCH000373796000404
NMM000373796M04.12.1954Area Sales Manager
MEM000373796N
File 2: recfm =VB ,lrec=621
000370561
000369465
Output file :recfm =VB ,lrec=621
SCH000373796000404
NMM000373796M04.12.1954Area Sales Manager
MEM000373796N
That means i need to remove all the records from the input file1 which is in file2.
eg:watever records conatin 000370561 from 4th position (9 digit) i need to eliminate from input and rest of the records must be in output file.
All the files have RECFM= VB and LRECL= 621.
File 2: can have many reocrds like this ,not only one or two.
I am using SORT
Can anybody help me on this.
DFSort
Moderators: Frank Yaeger, Moderator Group
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
I don't know what you tried with JOINKEYS that "didn't work", but here's a DFSORT JOINKEYS job that does what you asked for:
Code: Select all
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input file1 (VB/621)
//IN2 DD DSN=... input file2 (VB/621)
//SORTOUT DD DSN=... output file (VB/621)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(8,9,A)
JOINKEYS F2=IN2,FIELDS=(5,9,A)
JOIN UNPAIRED,F1,ONLY
OPTION COPY
/*
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
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