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.
JCL -sort
Moderators: Frank Yaeger, Moderator Group
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You need to give a clearer description of exactly what it is you want to do before anyone can help you.
Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Depending on exactly what you want to do, you might want to use DFSORT's JOINKEYS function or some other DFSORT function. You can find plenty of examples online. The DFSORT doc can be accessed from:
http://www.ibm.com/support/docview.wss? ... g3T7000080
Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Depending on exactly what you want to do, you might want to use DFSORT's JOINKEYS function or some other DFSORT function. You can find plenty of examples online. The DFSORT doc can be accessed from:
http://www.ibm.com/support/docview.wss? ... g3T7000080
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: 2
- Joined: Wed Apr 25, 2012 10:28 pm
Hi
In file 1 : we have record as:
SCH1234567890000702
NMM12345678924.04.2012
MEM123456789XXYYYZZZ ZZZZZ
SCH2222222220000890
MEM222222222TK92683090
and in file2:
222222222
output file should be like:
SCH1234567890000702
NMM12345678924.04.2012
MEM123456789XXYYYZZZ ZZZZZ
That means i need to remove all the records from the input file1 which is in file2.
Like above eg:watever records conatin 222222222 from 4th position (9 digit) i need to eliminate from input and rest of the records must eb in output file.
All the files have RECFM= VB and LRECL= 621.
I am using SORT
Can anybody help me on this.
Thanks
Juhi
In file 1 : we have record as:
SCH1234567890000702
NMM12345678924.04.2012
MEM123456789XXYYYZZZ ZZZZZ
SCH2222222220000890
MEM222222222TK92683090
and in file2:
222222222
output file should be like:
SCH1234567890000702
NMM12345678924.04.2012
MEM123456789XXYYYZZZ ZZZZZ
That means i need to remove all the records from the input file1 which is in file2.
Like above eg:watever records conatin 222222222 from 4th position (9 digit) i need to eliminate from input and rest of the records must eb in output file.
All the files have RECFM= VB and LRECL= 621.
I am using SORT
Can anybody help me on this.
Thanks
Juhi
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You can use a DFSORT job like the following to do what you asked for. Be sure to use input file2 (one record) for STEP S1 and input file1 (multiple records) for STEP2.
Code: Select all
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file2 (VB)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
OUTFIL VTOF,
BUILD=(C'TARG,''',5,9,C'''',80:X)
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file1 (VB)
//SORTOUT DD DSN=... output file (VB)
//SYSIN DD *
OPTION COPY,VLSCMP
OMIT COND=(8,9,CH,EQ,TARG)
/*
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