Assume we have a file of 100 LRECL ,first 3 bytes of each records says Message type.lets assume A01 and B01 ,for A01 type of records we have a field called account nbr starting at 50th position having offset of 9 bytes ,similarly for B01 account nbr is at 25th position having offset of 9 bytes,now i want to sort this file based on account nbr .since account nbr for all records are not starting at same postion so i cant do normal DFSORT.but i believe ,still this can be done using DFSORT ,but not sure of Syntax ...
any sggestions with sort steps will be appriciable.
The DFSORT below will do what you asked for. You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's IFTHEN and OVERLAY functions. Only DFSORT has these functions, so if you don't have DFSORT, you won't be able to use them. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/100)
//SORTOUT DD DSN=... output file (FB/100)
//SYSIN DD *
* Make a copy of the A01 key from 50-58 in 101-109.
* Make a copy of the B01 key from 25-33 in 101-109.
* Sort on the copy of the key.
* Remove the copy of the key.
Your solution is superb. But If we dont have the newer version installed in our system,Is there any possibility to have some other syntax?? Because earlier you provided me one solution like that which contained the older version syntax. So is there any provision like that? If so... could you please provide us the solution
Yes, that message means you don't have the Dec, 2004 DFSORT PTF so you can't use OVERLAY. Based on the note you sent me offline, this two-pass DFSORT job will do what you want without using any of the Dec, 2004 DFSORT PTF functions.