Hello,
My Requirement contain an input File of FB/80 which has Unique records as wells as records with Duplicates. The output file should contain the records in unsorted format similarly in the input file and the Unique records as wells as the latest update(LASTDUP) should be present.
My Input looks like below :
-------------------------------
A100000001ABCDSEFGDJ
A100000101ABCDTOIYHU
A100000052ABCDSEFGDJ
A100000030ABCDSDWKDL
A100000001ABCD999999
A100000101ABCD111111
A100000052ABCDNBBBBB
A1000000030BCDQQQQQQ
A100000001ABCDDDDDDD
A100000101ABCCCCCCCC
A100000052ABBBBBBBBB
A100000030AAAAAAAAAA
Desired Output would be :
A1000000030BCDQQQQQQ
A100000001ABCDDDDDDD
A100000101ABCCCCCCCC
A100000052ABBBBBBBBB
A100000030AAAAAAAAAA
I tried
//STEP001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SORTIN DD DSN=IN40626.SDW.TEST2,DISP=SHR
//NODUPES DD DSN=IN40626.SDW.TEST3,DISP=SHR
//TOOLIN DD *
SELECT FROM(SORTIN) TO(NODUPES) -
ON(2,10,CH) LASTDUP
/*
The output obtained was :
A100000001ABCDDDDDDD
A100000101ABCCCCCCCC
A100000052ABBBBBBBBB
A100000030AAAAAAAAAA
were I missed the Unique records in the input file. - A1000000030BCDQQQQQQ .
Note : It is not mandatory the the output should be unsorted.
Would appreciate help .. Kindly assist.
[/img][/code]
ICETOOL - Unique values and the Latest Update of a record
Moderators: Frank Yaeger, Moderator Group
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
Hello,
Many thanks for your input, it worked . Initially I had tried with LAST but dint not work(probably at that time my file format was VB). Now I got the output as below :
A100000001ABCDDDDDDD
A1000000030BCDQQQQQQ
A100000030AAAAAAAAAA
A100000052ABBBBBBBBB
A100000101ABCCCCCCCC
And the output is coming in sorted order.
Thanks once again!!
Many thanks for your input, it worked . Initially I had tried with LAST but dint not work(probably at that time my file format was VB). Now I got the output as below :
A100000001ABCDDDDDDD
A1000000030BCDQQQQQQ
A100000030AAAAAAAAAA
A100000052ABBBBBBBBB
A100000101ABCCCCCCCC
And the output is coming in sorted order.
Thanks once again!!
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
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