IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Find missing sequence for every key


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
anthony.pangestu

New User


Joined: 26 Oct 2017
Posts: 3
Location: Indonesia

PostPosted: Mon Apr 18, 2022 12:57 pm
Reply with quote

Hello,

I need help with finding missing numbers from a set of data, with the input as such:
AAA 001
AAA 002
AAA 004
AAA 005
BBB 003
BBB 005
CCC 001
CCC 002
CCC 003
CCC 004
CCC 005
DDD 001
DDD 002
DDD 003

The requirement is for every (1,3) key with (5,3) not found between the range of 001 - 005

The expected result:
AAA 003
BBB 001
BBB 002
BBB 004
DDD 004
DDD 005


Is this possible to achieve with DFSORT or ICETOOL? Thank you.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1246
Location: Bamberg, Germany

PostPosted: Mon Apr 18, 2022 2:27 pm
Reply with quote

Please use Code Tags when presenting Code/Data. icon_exclaim.gif

Code:
//MASTER   EXEC PGM=ICEMAN                                     
//SORTIN   DD *                                               
AAA 001                                                       
AAA 002                                                       
AAA 004                                                       
AAA 005                                                       
BBB 003                                                       
BBB 005                                                       
CCC 001                                                       
CCC 002                                                       
CCC 003                                                       
CCC 004                                                       
CCC 005                                                       
DDD 001                                                       
DDD 002                                                       
DDD 003                                                       
/*                                                             
//SYSOUT   DD SYSOUT=*                                         
//SORTOUT  DD DISP=(NEW,PASS),UNIT=SYSALLDA,SPACE=(CYL,(2,1,))
//SYSIN    DD *                                               
  SORT FIELDS=(1,3,CH,A)                                       
  SUM FIELDS=(NONE)                                           
  OUTFIL FNAMES=(SORTOUT),                                     
    REMOVECC,REPEAT=5,                                         
    BUILD=(1,3,X,SEQNUM,3,ZD,RESTART=(1,3))                   
  END                                                         
/*                                                             
//WHATEVER EXEC PGM=ICEMAN                         
//F1       DD DISP=(OLD,PASS),DSN=*.MASTER.SORTOUT 
//F2       DD *                                     
AAA 001                                             
AAA 002                                             
AAA 004                                             
AAA 005                                             
BBB 003                                             
BBB 005                                             
CCC 001                                             
CCC 002                                             
CCC 003                                             
CCC 004                                             
CCC 005                                             
DDD 001                                             
DDD 002                                             
DDD 003                                             
/*                                                 
//SYSOUT   DD SYSOUT=*                             
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                     
  OPTION COPY
  JOINKEYS F1=F1,FIELDS(1,7,A)                     
  JOINKEYS F2=F2,FIELDS(1,7,A)                     
  JOIN UNPAIRED,F1,ONLY                             
  REFORMAT FIELDS=(F1:1,7)                   
  END                                               
/*

Output:
Code:
Command ===>         
****** ***************
000001 AAA 003       
000002 BBB 001       
000003 BBB 002       
000004 BBB 004       
000005 DDD 004       
000006 DDD 005       
****** ***************
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Mon Apr 18, 2022 6:28 pm
Reply with quote

Dynamic REPEAT may be good for future expansions.
www.ibmmainframeforum.com/dfsort-icetool-icegener/topic6827.html
Back to top
View user's profile Send private message
anthony.pangestu

New User


Joined: 26 Oct 2017
Posts: 3
Location: Indonesia

PostPosted: Tue Apr 19, 2022 8:37 am
Reply with quote

It works. Thanks a lot everyone!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Cobol program with sequence number ra... COBOL Programming 5
No new posts Find the occurrence of Key Field (Par... DFSORT/ICETOOL 6
No new posts Find a record count/numeric is multip... COBOL Programming 1
Search our Forums:

Back to Top