I have a file with record size 350.The file contains detail records and a Header record.There are some duplicates and I need to eliminate them.Also since the header record is having the record count,I need to update that count too after the duplicate elimination.
The file is used in a daily job and the sequence number in the file will get incremented by by +1 everyday.
Record sample given below.
D003677100420DO014299801142014299801001CPCO 1DEC
D003677100420DO014299801153014299801001CPCO 1CEC
D003677100420DO014299801153014299801001CPCO 1CEC
D003677100420DO015591871053015591871053NMSOM 1AEC
H0036771004200000004
In this header ,003677100420 is the sequence number which will get incremented every day and it is a part of every detail record too.The second and third records are duplicates.So once after I eliminate the duplicates,I need the header to be rewritten as
H0036771004200000003 as the count is 3 after duplicate removal.
(The last 7 bytes is for count).
We are having DFSORT V1R5.
Any help would be highly appreciated.
Need help with sort/icetool - Update the header Record
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 2
- Joined: Mon Dec 26, 2011 2:15 pm
Need help with sort/icetool - Update the header Record
Thank You,
Ansha
Ansha
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: Select all
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB/350)
//OUT DD DSN=... output file (FB/350)
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,350,CH) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
OMIT COND=(1,1,CH,EQ,C'H')
OUTFIL FNAMES=OUT,REMOVECC,
TRAILER1=(C'H',2,12,COUNT=(M11,LENGTH=7))
/*
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: Mon Dec 26, 2011 2:15 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