Thursday, February 28, 2013

OMIT Condition

Suppose we have an input file layout as given below :-


(TITLE)        (NAME)     (DOB)
MATHS         RAM         11111991
ENGLISH      KRISH      01011990


Suppose we have to sort the above data excluding the header(TITLE). For this we can use OMIT Condition in the SORT JCL. It can be included as follows :-

//JOB CARD
//*                                                     
//STEP001 EXEC PGM=SYNCSORT                             
//SORTIN  DD DSN=<INPUT FILE NAME>,               
//           DISP=SHR                                   
//SORTOUT DD DSN=<OUTPUT FILE NAME>,            
//           DISP=SHR ( give parameters if u have not created input file)                                   
//SYSOUT DD SYSOUT=*                                    
//SYSIN  DD *                                           
  SORT FIELDS=COPY                                      
  OMIT COND=(01,01,CH,EQ,C'(')                          
/*                                                      
//*                                                

In the omit Condition, the Parameters are as follows :-

OMIT COND=(<start column>,<length of field from starting column>,CH,EQ,C'<field>')   

   

No comments:

Post a Comment