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

Remove set of duplicate records from VB file


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

New User


Joined: 07 Feb 2022
Posts: 14
Location: INDIA

PostPosted: Thu Mar 24, 2022 4:23 pm
Reply with quote

Hi All, I have below need VB file with set of records. The duplicate set need to removed and written in separate file

Attached format Input File and Expected output file
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Thu Mar 24, 2022 4:52 pm
Reply with quote

Attachments will not be read, use the Code Button instead that works as a toggle. Provide Input and desired Output this way.
Back to top
View user's profile Send private message
anandbtech01

New User


Joined: 07 Feb 2022
Posts: 14
Location: INDIA

PostPosted: Thu Mar 24, 2022 5:21 pm
Reply with quote

Code:

INUPT FILE:

 Ø    DEALER                       1235 XXXXXXXXXXXXXXXX
 Ø    MODEL                       XXXXXXXXXXXXXXXXXXXXX
 Ø    ORDER                       XXXXXXXXXXXXXXXXXXXXX
 Ø    DEALER                       1235     XXXXXXXXXXXXXX
 Ø    MODEL                       XXXXXXXXXXXXXXXXXXXXX
 Ø    ORDER                       XXXXXXXXXXXXXXXXXXXXX
 Ø    DEALER                       1236     XXXXXXXXXXXXXX
 Ø    DEALER                       1234     XXXXXXXXXXXXXX
 Ø    MODEL                        XXXXXXXXXXXXXXXXXXXX
 Ø    ORDER                       XXXXXXXXXXXXXXXXXXXXX
 Ø    SALES                       XXXXXXXXXXXXXXXXXXXXX
 Ø    STOCK                       XXXXXXXXXXXXXXXXXXXXX
 Ø    SALESPER                    XXXXXXX XXXXXXXXXX                   
 Ø    DEALER                       9999     XXXXXXXXXXXXXX
 Ø    MODEL                       XXXXXXXXXXXXXXXXXXXXX


Code:

Expected OP :

 Ø    DEALER                       1234     XXXXXXXXXXXXXXX
 Ø    MODEL                        XXXXXXXXXXXXXXXXXXXXXXXX
 Ø    ORDER                       XXXXXXXXXXXXXXXXXXXXXXXXX
 Ø    SALES                       XXXXXXXXXXXXXXXXXXXXXXXXX
 Ø    STOCK                       XXXXXXXXXXXXXXXXXXXXXXXXX
 Ø    SALESPER                    XXXXXXX XXXXXXXXXX       
 Ø    DEALER                       1235     XXXXXXXXXXXXXXX
 Ø    MODEL                       XXXXXXXXXXXXXXXXXXXXXXXXX
 Ø    ORDER                       XXXXXXXXXXXXXXXXXXXXXXXXX
 Ø    DEALER                       1236     XXXXXXXXXXXXXXX
 Ø    DEALER                       9999     XXXXXXXXXXXXXXX
 Ø    MODEL                       XXXXXXXXXXXXXXXXXXXXXXXXX
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Thu Mar 24, 2022 5:29 pm
Reply with quote

Well, show what you have tried so far. Also let us know the sort criteria you have applied.
Back to top
View user's profile Send private message
anandbtech01

New User


Joined: 07 Feb 2022
Posts: 14
Location: INDIA

PostPosted: Thu Mar 24, 2022 6:48 pm
Reply with quote

I Tried

Code:

  OPTION COPY                                             
  OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(11,6,CH,EQ,C'DEALER'),
    END=(11,5,CH,EQ,C'ORDER'),                           
     PUSH=(80:ID=2))                                     
  OUTFIL INCLUDE=(80,2,CH,NE,C' '),BUILD=(1,80)           


Code:

 INREC  IFTHEN=(WHEN=INIT,                               
                OVERLAY=(31:SEQNUM,2,ZD,RESTART=(1,3))) 
 SORT   FIELDS=(1,3,CH,A,31,2,CH,D)                     
 OUTREC IFOUTLEN=32,                                     
        IFTHEN=(WHEN=INIT,                               
                OVERLAY=(21:SEQNUM,2,ZD,RESTART=(1,3),   
                         33:SEQNUM,2,ZD,RESTART=(1,3))),
   IFTHEN=(WHEN=GROUP,                                   
                BEGIN=(33,2,ZD,EQ,1),PUSH=(31:31,2))     


I am bit confused , Since the END of each set is different. Whether its possible, I tried some more stupid options as well.

Please help at least with some hint.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Fri Mar 25, 2022 12:45 am
Reply with quote

Code:
//WHATEVER EXEC PGM=ICEMAN                                         
//SORTIN   DD *                                                     
 Ø    DEALER                       1235 XXXXXXXXXXXXXXXX           
 Ø    MODEL                       XXXXXXXXXXXXXXXXXXXXX             
 Ø    ORDER                       XXXXXXXXXXXXXXXXXXXXX             
 Ø    DEALER                       1235     XXXXXXXXXXXXXX         
 Ø    MODEL                       XXXXXXXXXXXXXXXXXXXXX             
 Ø    ORDER                       XXXXXXXXXXXXXXXXXXXXX             
 Ø    DEALER                       1235     XXXXXXXXXXXXXX         
 Ø    MODEL                       XXXXXXXXXXXXXXXXXXXXX             
 Ø    ORDER                       XXXXXXXXXXXXXXXXXXXXX             
 Ø    DEALER                       1236     XXXXXXXXXXXXXX         
 Ø    DEALER                       1234     XXXXXXXXXXXXXX         
 Ø    MODEL                        XXXXXXXXXXXXXXXXXXXX             
 Ø    ORDER                       XXXXXXXXXXXXXXXXXXXXX             
 Ø    SALES                       XXXXXXXXXXXXXXXXXXXXX             
 Ø    STOCK                       XXXXXXXXXXXXXXXXXXXXX             
 Ø    SALESPER                    XXXXXXX XXXXXXXXXX               
 Ø    DEALER                       9999     XXXXXXXXXXXXXX         
 Ø    MODEL                       XXXXXXXXXXXXXXXXXXXXX             
/*                                                                 
//SYSOUT   DD SYSOUT=*                                             
//SORTOUT  DD SYSOUT=*                                             
//DUPL     DD SYSOUT=*                                             
//SYSIN    DD *                                                     
  OPTION EQUALS                                                     
  INREC IFTHEN=(WHEN=GROUP,                                         
    BEGIN=(7,6,CH,EQ,C'DEALER'),PUSH=(60:36,9,ID=4,SEQ=4))         
  SORT FIELDS=(60,9,BI,A,69,8,ZD,A)                                 
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(77:SEQNUM,4,ZD,RESTART=(60,4)))
  OUTFIL FNAMES=(SORTOUT),                                         
    OMIT=(73,4,ZD,LT,77,4,ZD),                                     
    REMOVECC,                                                       
    BUILD=(1,59)                                                   
  OUTFIL FNAMES=(DUPL),                                             
    REMOVECC,SAVE,                                                 
    BUILD=(1,59)                                                   
  END                                                               
/*


Output:
Code:
****** **************************** Datenanfang *********************
000001  Ø    DEALER                       1234     XXXXXXXXXXXXXX   
000002  Ø    MODEL                        XXXXXXXXXXXXXXXXXXXX       
000003  Ø    ORDER                       XXXXXXXXXXXXXXXXXXXXX       
000004  Ø    SALES                       XXXXXXXXXXXXXXXXXXXXX       
000005  Ø    STOCK                       XXXXXXXXXXXXXXXXXXXXX       
000006  Ø    SALESPER                    XXXXXXX XXXXXXXXXX         
000007  Ø    DEALER                       1235     XXXXXXXXXXXXXX   
000008  Ø    MODEL                       XXXXXXXXXXXXXXXXXXXXX       
000009  Ø    ORDER                       XXXXXXXXXXXXXXXXXXXXX       
000010  Ø    DEALER                       1236     XXXXXXXXXXXXXX   
000011  Ø    DEALER                       9999     XXXXXXXXXXXXXX   
000012  Ø    MODEL                       XXXXXXXXXXXXXXXXXXXXX       
****** **************************** Datenende ***********************
Back to top
View user's profile Send private message
anandbtech01

New User


Joined: 07 Feb 2022
Posts: 14
Location: INDIA

PostPosted: Fri Mar 25, 2022 10:04 am
Reply with quote

Legendry action !!!

Great help !!! I am interested to learn more with SORT in detail, If possible please help to share links, docs that can explain in detail
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


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

PostPosted: Fri Mar 25, 2022 11:28 am
Reply with quote

The best you can do is to follow the DFSORT and SYNCSORT topics in this forum. All you need besides this is the DFSORT Application Guide and some time to try things yourself.

PS: The OPTION EQUALS statement is not needed. It's a leftover from my testing.
Back to top
View user's profile Send private message
anandbtech01

New User


Joined: 07 Feb 2022
Posts: 14
Location: INDIA

PostPosted: Fri Mar 25, 2022 2:02 pm
Reply with quote

Sure, will do that.. Thanks again
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Sat Mar 26, 2022 4:30 pm
Reply with quote

You can bookmark this link other than Manuals.
www.ibm.com/support/pages/smart-dfsort-tricks
Back to top
View user's profile Send private message
anandbtech01

New User


Joined: 07 Feb 2022
Posts: 14
Location: INDIA

PostPosted: Wed Mar 30, 2022 11:21 am
Reply with quote

Thanks Rohit
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 PS file parameter JCL & VSAM 4
No new posts FD Section to Create FB or Vb File Dy... COBOL Programming 1
No new posts How to remove spaces in between. SYNCSORT 12
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts Creating a VB file PL/I & Assembler 10
Search our Forums:

Back to Top