Sort Utility Tutorial

                                       About Us        Services        Courses        Case Studies        Mainframe Forum        Mainframe Jobs        Contact Us          Mainframe Connectivity


SORT Utility Tutorial:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*DEMO JCL TO SHOW THE SORT UTILTITY WITH COPY OPTION          
//***************************************************           
//STEP10   EXEC PGM=SORT                                        
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SORTIN   DD DSN=IND220.PRIYA.COBOL.EMPFILE,DISP=SHR           
//SORTOUT  DD DSN=IND220.PRIYA.COBOL.EMPFILE.TST1,              
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=30,BLKSIZE=300)      
//SORTWK01 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SORTWK02 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SYSIN    DD *                                                 
   SORT FIELDS=COPY,                                            
   SKIPREC=2,                                                   
   STOPAFT=2                                                    
//                                                              

 

Merging the files:

//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*DEMO JCL TO SHOW THE SORT UTILTITY WITH COPY OPTION          
//***************************************************           
//STEP10   EXEC PGM=SORT                                        
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SORTIN01 DD DSN=IND220.PRIYA.COBOL.EMPFILE,DISP=SHR           
//SORTIN02 DD DSN=IND220.PRIYA.COBOL.SORTOUT,DISP=SHR           
//SORTOUT  DD DSN=IND220.PRIYA.COBOL.MEROUT,                    
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=30,BLKSIZE=300)      
//SORTWK01 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SORTWK02 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SYSIN    DD *                                                 
   MERGE FIELDS=(1,3,CH,A)                                      
//                                                              


Eliminating the duplicate records in the input file.


//IND220SO JOB (123),'INDUS',CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),                          
//             NOTIFY=&SYSUID                
//***************************************************           
//*DEMO JCL TO SHOW THE SORT UTILTITY WITH COPY OPTION          
//***************************************************           
//STEP10   EXEC PGM=SORT                                        
//SYSPRINT DD SYSOUT=*                                          
//SYSOUT   DD SYSOUT=*                                          
//SYSDUMP  DD SYSOUT=*                                          
//SORTIN   DD DSN=IND220.PRIYA.COBOL.EMPFILE,DISP=SHR           
//SORTOUT  DD DSN=CZA058.PRIYA.COBOL.DUPELIM.TST4,              
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(TRK,(1,1),RLSE),                           
//            UNIT=SYSDA,                                       
//            DCB=(DSORG=PS,RECFM=FB,LRECL=30,BLKSIZE=300)      
//SORTWK01 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SORTWK02 DD SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA                 
//SYSIN    DD *                                                 
   SORT FIELDS=COPY                                             
   SUM FIELDS=NONE                <========   note this                             
/*                                                              
//                                                               
                                                                    
http://www.mainframesguru.com

Comments