DFSORT: Reformat data

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
simo78
Member
Posts: 35
Joined: Tue Aug 11, 2009 12:20 am
Location: Munich

DFSORT: Reformat data

Post by simo78 » Wed Apr 14, 2010 8:43 pm

Hi,

I have a file which looks like one below:

Input file:

Code: Select all

//AC01   EXEC AB13C1231                            
//AB01   EXEC AB88P001                            
//AB02   EXEC AB88P002,P1=AB                      
//UNCAT  EXEC PGM=IDCAMS                          
//ABZ    EXEC A345B105,P1=AB,M=Z                  
//ABNH   EXEC A345B105,P1=AB,M=NH                 
//ABGBH  EXEC A345B105,P1=AB,M=GBH                
//ABM    EXEC A345B105,P1=AB,M=M                  
//AVTT   EXEC A345B105,P1=AB,M=TT                 
//ABGTR  EXEC A345B105,P1=AB,M=V                  
//ACKA   EXEC A345B105,P1=AB,M=KA                 
//CATLG EXEC  PGM=MYPROG1                         
//AB45  EXEC A345B106,P1=AB                       
//UZ45   EXEC A345B106,P1=AU,COND.STEP01=ONLY       
//AC02   EXEC AB45P002,P1=AC                      
//UNCAT  EXEC PGM=IDCAMS                          
//AC07   EXEC A345B105,P1=AC,M=QE                 
//AC45   EXEC A345B106,P1=AC                      
//OD01   EXEC OD99B001,P1=OD,M=E     
//OD02   EXEC A345B105,P1=OD,M=E     
//OD03   EXEC A345B106,P1=OD         
//FP01   EXEC FP45P001,P1=FP,M=AY    
//FP02   EXEC A345B105,P1=FP,M=AY    
//FPGBH  EXEC A345B105,P1=FP,M=I     
//FP04   EXEC A345B106,P1=FP         
//TB01   EXEC TB08P001,P1=TB,M=E     
//TB02   EXEC A345B105,P1=TB,M=E     
//TB03   EXEC A345B106,P1=TB         
My output file should take everythink between EXEC and the comma
(or for the first 2 lines everythink after EXEC) and the duplicate should be eliminated.

My output file should look like this:


Expected Output file:

Code: Select all

AB13C123                            
AB88P001                            
AB88P002
A345B105
A345B106
AB45P002
OD99B001
FP45P001
TB08P001

How can I do this using DFSORT?

Thanks in advance.

skolusu
Member
Posts: 43
Joined: Sat Jul 26, 2008 12:38 am

Post by skolusu » Wed Apr 14, 2010 9:27 pm

simo78,

use the following DFSORT JCL

Code: Select all

//STEP0100 EXEC PGM=SORT                              
//SYSOUT   DD SYSOUT=*                                
//SORTIN   DD DATA,DLM=$$                             
//AC01   EXEC AB13C1231                               
//AB01   EXEC AB88P001                                
//AB02   EXEC AB88P002,P1=AB                          
//UNCAT  EXEC PGM=IDCAMS                              
//ABZ    EXEC A345B105,P1=AB,M=Z                      
//ABNH   EXEC A345B105,P1=AB,M=NH                     
//ABGBH  EXEC A345B105,P1=AB,M=GBH                    
//ABM    EXEC A345B105,P1=AB,M=M                      
//AVTT   EXEC A345B105,P1=AB,M=TT                     
//ABGTR  EXEC A345B105,P1=AB,M=V                      
//ACKA   EXEC A345B105,P1=AB,M=KA                     
//CATLG EXEC  PGM=MYPROG1                             
//AB45  EXEC A345B106,P1=AB                           
//UZ45   EXEC A345B106,P1=AU,COND.STEP01=ONLY         
//AC02   EXEC AB45P002,P1=AC                          
//UNCAT  EXEC PGM=IDCAMS                              
//AC07   EXEC A345B105,P1=AC,M=QE                     
//AC45   EXEC A345B106,P1=AC                          
//OD01   EXEC OD99B001,P1=OD,M=E                      
//OD02   EXEC A345B105,P1=OD,M=E                      
//OD03   EXEC A345B106,P1=OD                          
//FP01   EXEC FP45P001,P1=FP,M=AY                     
//FP02   EXEC A345B105,P1=FP,M=AY                     
//FPGBH  EXEC A345B105,P1=FP,M=I                      
//FP04   EXEC A345B106,P1=FP                          
//TB01   EXEC TB08P001,P1=TB,M=E                      
//TB02   EXEC A345B105,P1=TB,M=E                      
//TB03   EXEC A345B106,P1=TB                          
$$                                                    
//SORTOUT  DD SYSOUT=*                                
//SYSIN    DD *                                           
  INCLUDE COND=(1,80,SS,EQ,C'EXEC',AND,1,80,SS,NE,C'PGM') 
  INREC IFTHEN=(WHEN=INIT,PARSE=(%1=(STARTAFT=C'EXEC',    
                ENDBEFR=C',',FIXLEN=16)),BUILD=(%1)),     
  IFTHEN=(WHEN=INIT,OVERLAY=(1,16,JFY=(SHIFT=LEFT)))      
  SORT FIELDS=(1,8,CH,A)                                  
  SUM FIELDS=NONE                                         
  OUTREC BUILD=(1,8)                                      
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

simo78
Member
Posts: 35
Joined: Tue Aug 11, 2009 12:20 am
Location: Munich

Post by simo78 » Thu Apr 15, 2010 3:45 pm

Hello skolusu,

it works perfect!

THANK YOU VERY MUCH!!! :D

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