nvasanth_16,
You can use DFSORT Symbols to do that kind of thing. Here's an example:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD * input file1
AABBBB
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Create DFSORT Symbols as follows:
* SYM1,'xx'
* SYM2,'yyyy'
* where xx is the value in positions 1-2 of the input record
* and yyyy is the value in position 3-6 of the input record
OUTFIL BUILD=(C'SYM1,''',1,2,C'''',80:X,/,
C'SYM2,''',3,4,C'''')
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD * input file2
AABBBB RECORD 01
AACCCC RECORD 02
AABBBB RECORD 03
BBAAAA RECORD 04
/*
//SORTOUT DD SYSOUT=* output file
//SYSIN DD *
OPTION COPY
* Use SYM1 and SYM2 in the DFSORT INCLUDE statement.
INCLUDE COND=(1,2,CH,EQ,SYM1,AND,
3,5,CH,EQ,SYM2)
/*
SORTOUT would have:
AABBBB RECORD 01
AABBBB RECORD 03
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
http://www.ibm.com/servers/storage/supp ... tmpub.html