RAMESH KRISHNA REDDY mainframe discussion forum - cobol, db2,cics,jcl,file-aid,changeman,... interview questions, quizs
Online Tutorials   | PREV  | TOP  | NEXT



DRONA SERIES
SORT INCLUDE TUTORIAL


CHAPTER - 2


Using DATE in SORT INCLUDE CARDS - Example
   
 
Using DATE constants in SORT INCLUDE


SORT INCLUDE EXAMPLE

   Get the records where date value in the input record is betweeen  +/- 10 days from current date.
    

   if input field is in ZD format -   
   INCLUDE COND=(60,8,ZD,LE,DATE1P+10,AND,60,8,ZD,GT,DATE1P-10)

   
   if input file value is in character format.   
   INCLUDE COND=(60,8,CH,LE,DATE1+10,AND,60,8,CH,GT,DATE1-10)
  
  
   TIP :  If input date format is  yyyy-mm-dd,  use DATE1(-) in the plave of DATE1.  



   Example  -  

   Input file for SORT JCL

   10 suresh   20000 01 20120203                    
   20 NARENDRA 40000 06 20110925                    
   30 jacob A  25000 07 20111018                    
   40 RAMESH   34000 03 20120410                    
   50 Kishore  50000 02 20130408                    


  INCLUDE in SORT - selecting the records between the two dates.

  //SYSIN DD *                                                      
     SORT FIELDS=COPY                                              
     INCLUDE COND=(22,8,ZD,LE,DATE1P+10,AND,22,8,ZD,GE,DATE1P-10)  
  /*


  Explanation - In above example, SORT card will select the records , if date in the input 
  record is between current date +/- 10days. Selected records will be copied to output file.

   Output file for  SORT JCL  -  Assume current date is -  4-Apr-2012. 
   Following records will be selected from the input file.
 

   40 RAMESH   34000 03 20120410     
   50 Kishore  50000 02 20120408                        
   ******************************** Bottom of Data *****
                                                     

 
	
    

NEXT CHAPTER TOPIC : Using DATE1P,DATE2P,DATE3P in SORT INCLUDE CARDS - Example 3


                                   




Home | Donations | Online Tutorials | Books | Entertainment | Contactme | privacy |  sql tutorial | jcl interview questions | JCL Tutorial | JCL Tutorial - chapter1 | JCL Tutorial - chapter2 | JCL Tutorial - chapter3 | JCL Tutorial - chapter4 | JCL Tutorial - chapter5 | JCL Tutorial - chapter6 | JCL Tutorial - chapter7 | JCL Tutorial - chapter8 | JCL Tutorial - chapter9 | JCL Tutorial - chapter10 | JCL Tutorial - chapter11