Hi
Is there a way we can sort the fields leaving the sign integer. Example i would like to sort the data -1000,200, 500 when i do the asending order sort i should get 200,500,1000 leaving the negative sign! is there a way to solve this using sort.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can do that with DFSORT, but exactly how depends on what your input fields actually look like and what you want the output to look like. Please show an example of your input records and what you want the output records to look like. What is the starting position and length of the field you want to sort on? What is the RECFM and LRECL of your input file?
My input file looks like one below:
=COLS> ----+----1----+----2----+----3----+----4----
****** ***************************** Top of Data **
000001 -10000
000002 200
000003 -800
000004 -1200
****** **************************** Bottom of Data
I need the output like one below:
=COLS> ----+----1----+----2----+----3----+----4----+
****** ***************************** Top of Data ***
000001 200
000002 800
000003 1200
000004 10000
****** **************************** Bottom of Data ***
LRECL is 80 and recfm is FB, can we do this if we have a packed decimal field variable of length S9(8)v9(2) or s9(8). let me know how my sort statement should look like.
let me know if you need any more information. and once again thanks for yor time
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: