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



DRONA SERIES
SORT INREC OUTREC TUTORIAL


CHAPTER - 3


INREC in JCL SORT



   
 
 Using SORT INREC in JCL



 

INREC adds, deletes, or reformats fields before the records are sorted or merged. so that performance will be improved OUTREC adds, deletes, or reformats fields after the records are sorted or merged. SORT INREC Example JCL. Let us assume input file has following data and structure
INPUT FILE
MOHANK  23423423434534344 KIRAN 
MOHANK  13342345345345345 RAJEEV 
ARAMES  34535345325354324 SURESH 
SURESH  23447385385933987 PULI 
RAMESH  67575789769876785 MADHU 
KRISHN  50830948530859340 OIIED 
KRISHN  30495849572938495 MADHU 
SURESH  98347385385933987 PULI 
	
SORT INREC Example JCL. //SYSIN DD * SORT FIELDS=COPY INREC FIELDS=(7:2,5,20:10,3) /* //* copyright www.mainframegurukul.com EXPLANATION 1. SORT FIELDS=COPY It is for copy records to output file 2. INREC FIELDS=(7:2,5,20:10,3) (for formatting) Here we have two formattings, 1. 7:2,5 - data at 2nd position of input file with length 5 copied to 7th position of output file 2. 20:10,3 - data at 10th position of input file with length 3 copied to 20th position of output file
OUTPUT FILE
      OHANK        342
      OHANK        334
      RAMES        453
      URESH        834
      AMESH        757
      RISHN        083
      RISHN        049
      URESH        834
	
    

NEXT CHAPTER TOPIC : JCL SORT INREC Example


                                   




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