SEQNUM allocation Dynamically

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Captain Nero
Member
Posts: 10
Joined: Fri Jun 20, 2008 4:21 pm
Location: Kolkata, India

SEQNUM allocation Dynamically

Post by Captain Nero » Mon Jul 06, 2009 6:33 pm

I have a file of the following type -

Code: Select all

EPI          ENTY       DATE
----------------------------
1000009525   359467     2009-04-06
1000009525   359467     2009-01-05
1000009525   359467     2008-09-29
1000009525   359467     2008-06-30
1000009525   359467     2008-03-31
1000009525   359467     2007-12-31
1000009525   359467     2007-10-01
1000011605   391982     2009-04-06
1000011605   391982     2009-01-05
1000011605   391982     2008-09-29
1000011605   391982     2008-06-30
1000011605   391982     2008-03-31
1000011605   391982     2007-12-31
1000011605   391982     2007-10-01
1000011605   391982     2007-07-02
1000015574   377247     2006-07-03
1000015574   377247     2006-04-03
1000015574   377247     2006-01-02
1000015866   377392     2009-04-06
1000015866   377392     2009-01-05
1000015866   377392     2008-09-29
1000015866   377392     2008-06-30
1000015866   377392     2008-03-31
1000015866   377392     2007-12-31
1000015866   377392     2007-10-01
1000016885   371626     2007-04-02
1000016885   371626     2007-01-01
1000016885   371626     2006-10-02
1000016885   371626     2006-07-03
1000016885   371626     2006-04-03
1000016885   371626     2006-01-02
1000018561  1809740     2009-01-05
1000018561  1809740     2008-09-29
1000018561  1809740     2008-06-30
1000018561  1809740     2008-03-31
1000018561  1809740     2007-12-31
1000018561  1809740     2007-10-01
1000018561  1809740     2007-07-02
Here, for each EPI-ENTY combination I want to create SEQNUM from 1, as soon as any one of them changes the SEQNUM should also start from 1. My ultimate goal is to get the fourth (or latest) record for each combination.

Please let me know if we can do it through SORT, ICETOOL. I can not hardcode the EPI or ENTY as the input file is dynamically generated through SQL in batch.

Please help me on this.
Regards,
Captain N.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Mon Jul 06, 2009 8:10 pm

It's not clear from your description what you want to do.
My ultimate goal is to get the fourth (or latest) record for each combination.
If you want the last record for each set of duplicates, that's easy to do with the SELECT operator of ICETOOL. I don't know what you mean by "fourth (or latest)".
You need to explain.

Show the expected output records for your input records example. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file.
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

Post Reply

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



Other References
Mainframe Tools and others