How to use Push for variable record.



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

How to use Push for variable record.

Postby Surabhi » Wed Nov 08, 2017 12:53 pm

Hi All,

I have a requirement, where I need to identify the variable string XYZ, if found then search for next line to find A,T1, and after that put that same string into the quotes there.
Is this possible to do using sort cards with PUSH.

Below is my input data set:-

F,T1,(123,456,869),ABC    
F,T2,(123,456,869)                          
F,T6,(123,456,869)        
A,T1,'',(123,586,546)    
F,T1,(123,456,869),(254,456)XYZ
F,T2,(123,456,869)                            
F,T6,(123,456,869)        
A,T1,'',(123,586,546)      
F,T1,(123,456,869),XYZ #002
F,T2,(123,456,869)                          
F,T6,(123,456,869)        
A,T1,'',(123,586,546)    
 

Expected output:-

F,T1,(123,456,869),ABC      
F,T2,(123,456,869)          
F,T6,(123,456,869)          
A,T1,'',(123,586,546)      
F,T1,(123,456,869),(254,456)XYZ
F,T2,(123,456,869)                  
F,T6,(123,456,869)          
A,T1,'XYZ',(123,586,546) [/b]  
F,T1,(123,456,869),XYZ #002
F,T2,(123,456,869)                  
F,T6,(123,456,869)          
A,T1,'XYZ',(123,586,546)
 

I have tried using the below sort card, but this wont work when the position of XYZ is not fixed.

INREC IFTHEN=(WHEN=GROUP,                                      
              BEGIN=(1,80,SS,EQ,C'XYZ'),                      
                           PUSH=(81:20,3))                                                                                
OUTFIL REMOVECC,                                              
      IFTHEN=(WHEN=(81,3,CH,EQ,C'XYZ',AND,1,4,CH,EQ,C'A,T1'),  
            BUILD=(1,6,C'XYZ',7,60)),                          
      IFTHEN=(WHEN=NONE,                                      
            BUILD=(1,70))                                      

OPTION COPY                


Please let me know if we can use PUSH here or if this is possible to do with some other sort cards.
Thanks in advance.
Re-coded
Surabhi
 
Posts: 48
Joined: Thu Sep 10, 2015 7:51 pm
Has thanked: 4 times
Been thanked: 0 time

Re: How to use Push for variable record.

 

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post