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.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Chanchal,
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.
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'A01'),OVERLAY=(101:50,9)),
* Make a copy of the B01 key from 25-33 in 101-109.
IFTHEN=(WHEN=(1,3,CH,EQ,C'B01'),OVERLAY=(101:25,9))
* Sort on the copy of the key.
SORT FIELDS=(101,9,ZD,A)
* Remove the copy of the key.
OUTREC FIELDS=(1,100)
/*
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
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Hmmm ... the "newer" version has been available since Dec, 2004 so it's not really that new any more. Please show me the //SYSOUT messages you get when you run this job:
Hi Frank,
As you said,I have submitted the JCL whichever you provided to me.
In SYSOUT I found some message that has shown below.Please check the SYSOUT below
Code:
1ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE000I 1 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 08:40 ON TUE NOV 08, 2005 -
0 OPTION COPY
OUTREC OVERLAY=(5:C'A')
$
ICE104A 0 INVALID INREC OR OUTREC STATEMENT OPERAND
ICE012A 3 MISSING FIELDS OPERAND DEFINER
ICE052I 3 END OF DFSORT
If my operating system doesn't have that latest version of DFSORT option ...... is there any Syntax to work using the same version of DFSORT.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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.