Need help on removing duplicate headers



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Need help on removing duplicate headers

Postby JayaPeriasamy » Tue May 24, 2016 10:51 pm

Hi,

My input file is :

*********************************************************** Top of Data **********************************************************
178      A&B BANK                                XAA INTERFACE GENERAL ERROR REPORT           R-10500 SET-001  05-23-16  PAGE:    
                            REC                    SVC                                                                            
BANK  ACCOUNT NUMBER        TYPE  EFF DATE   SRC   CODE  ERROR MESSAGE                                                            
0A8 C 00000000000001000325  120  2016-03-01  999         REJECT - INVALID BANK NUMBER                                            
122 C 00000000000000900051  120  2016-03-01  999         REJECT - BANK NUMBER NOT ON BANK CONTROL                                
078      GREAT LAKES NATIONAL BANK               XAA INTERFACE GENERAL ERROR REPORT           R-10500 SET-001  05-23-16  PAGE:    
                            REC                    SVC                                                                            
BANK  ACCOUNT NUMBER        TYPE  EFF DATE   SRC   CODE  ERROR MESSAGE                                                            
078 C 00000000000000025526  120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
078 C 00000000000000900051  120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
174      BADGER STATE SAVINGS                    XAA INTERFACE GENERAL ERROR REPORT           R-10500 SET-001  05-23-16  PAGE:    
                            REC                    SVC                                                                            
BANK  ACCOUNT NUMBER        TYPE  EFF DATE   SRC   CODE  ERROR MESSAGE                                                            
174 C 00000000000000031997  120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
178      A&B BANK                                XAA INTERFACE GENERAL ERROR REPORT           R-10500 SET-001  05-23-16  PAGE:    
                            REC                    SVC                                                                            
BANK  ACCOUNT NUMBER        TYPE  EFF DATE   SRC   CODE  ERROR MESSAGE                                                            
178 C 00000000000000045526  120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
                            120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
178 C 00000000000001000326  120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
                            120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
********************************************************** Bottom of Data ********************************************************

I want to eliminate the duplicate header and have the detail records under one header like this:

*********************************************************** Top of Data **********************************************************
                   
078      GREAT LAKES NATIONAL BANK               XAA INTERFACE GENERAL ERROR REPORT           R-10500 SET-001  05-23-16  PAGE:    
                            REC                    SVC                                                                            
BANK  ACCOUNT NUMBER        TYPE  EFF DATE   SRC   CODE  ERROR MESSAGE                                                            
078 C 00000000000000025526  120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
078 C 00000000000000900051  120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
174      BADGER STATE SAVINGS                    XAA INTERFACE GENERAL ERROR REPORT           R-10500 SET-001  05-23-16  PAGE:    
                            REC                    SVC                                                                            
BANK  ACCOUNT NUMBER        TYPE  EFF DATE   SRC   CODE  ERROR MESSAGE                                                            
174 C 00000000000000031997  120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
178      A&B BANK                                XAA INTERFACE GENERAL ERROR REPORT           R-10500 SET-001  05-23-16  PAGE:    
                            REC                    SVC                                                                            
BANK  ACCOUNT NUMBER        TYPE  EFF DATE   SRC   CODE  ERROR MESSAGE        
0A8 C 00000000000001000325  120  2016-03-01  999         REJECT - INVALID BANK NUMBER                                            
122 C 00000000000000900051  120  2016-03-01  999         REJECT - BANK NUMBER NOT ON BANK CONTROL                                                                
178 C 00000000000000045526  120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
                            120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
178 C 00000000000001000326  120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
                            120  2016-03-01  999         REJECT - INVALID SERVICE CODE                                            
********************************************************** Bottom of Data ********************************************************



Can someone please help me?

Coded
JayaPeriasamy
 
Posts: 1
Joined: Tue May 24, 2016 10:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need help on removing duplicate headers

Postby Akatsukami » Tue May 24, 2016 11:41 pm

It is best that you do not solicit aid via PM, as neither I nor any other habitue of this board has a monopoly on knowledge (and in fact I am not particularly knowledgeable in DFSORT, although other senpai are).

It is also preferable that you enclose data, control cards, and anything else where alignment is significant in Code tags, as otherwise multiple spaces will be squeezed out.

Finally, please do not use the word "urgent" or similar expressions (which you did in your PM to me, although not in your post); remember that we are all volunteers here, in many different time zones and with differing accesses to the board, and that therefore the best person to answer your query may not see it for hours or even days after you make it.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Need help on removing duplicate headers

Postby BillyBoyo » Wed May 25, 2016 1:25 am

Ah, and I thought that I was special by being PM'd :-)

You are not just "getting ride of duplicate headers" you are sorting the data into the correct order, yes?

Why can't this be done prior to running the program which produces the report? Or is that planned for some future point?

Anyway, OMIT COND= for all the heading lines which contain no information.

Uee INREC with IFTHEN=(WHEN=GROUP to identify the header and PUSH it to an extension to all the lines - so if your data is 133 bytes, you PUSH it to 134:. Also in the same PUSH include a SEQ and an ID.

SORT on the bank reference (in the extension) then the ID then the SEQ.

The use OUTFIL, OMIT= for SEQ is one. Use HEADER3 in SECTIONS to output your main header from the record (in the extension) and the remaining, constant, header lines get reinserted here, using a "/" to separate each line.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post