Hi All,
I have a file which i have to sort using 3 different criteria, first on number(1-15) as A, second on the Y or N(50-51) as D fianlly on date(51-60) as D. I have written a sort card as below. but its not working. can any one help...
SORT FIELDS=(01,15,CH,A,49,01,CH,D,50,10,CH,D) im using PGM=SORT
File layout:
456565750176768 TNYEU STUHUBAU GESMBH Y07.02.2003
Sorting a file using JCL Sort
Re: Sorting a file using JCL Sort
You say,
But you have coded=>
But, your code is=>
And also is the date MM.DD.YYYY or DD.MM.YYYY?
second on the Y or N(50-51) as D
But you have coded=>
Code: Select all
49,01,CH
fianlly on date(51-60) as D
But, your code is=>
Code: Select all
50,10,CH,D
And also is the date MM.DD.YYYY or DD.MM.YYYY?
- Frank Yaeger
- Global moderator
- Posts: 1079
- Joined: Sat Jun 09, 2007 8:44 pm
- Skillset: DFSORT, ICETOOL, ICEGENER
- Referer: Search
- Contact:
Re: Sorting a file using JCL Sort
Karthick,
Your description of the fields doesn't match the input record example you show, and it's not clear if the date is mm.dd.yyyy or dd.mm.yyyy. In the future, please give examples of your input records and expected output records and explain the rules for getting from input to output.
This doesn't tell us anything. Do you mean it's not sorting the records in the way you want it to, or that you received an error message, or what?
In order to sort on a date correctly, you must do it by year, then month, then day.
If your date is in the form mm.dd.yyyy, then this would be the correct DFSORT statement going by your example input record:
If your date is in the form dd.mm.yyyy, then this would be the correct DFSORT statement going by your example input record:
Your description of the fields doesn't match the input record example you show, and it's not clear if the date is mm.dd.yyyy or dd.mm.yyyy. In the future, please give examples of your input records and expected output records and explain the rules for getting from input to output.
but its not working
This doesn't tell us anything. Do you mean it's not sorting the records in the way you want it to, or that you received an error message, or what?
In order to sort on a date correctly, you must do it by year, then month, then day.
If your date is in the form mm.dd.yyyy, then this would be the correct DFSORT statement going by your example input record:
Code: Select all
SORT FIELDS=(1,15,CH,A,49,1,CH,D,
56,4,CH,D,50,5,CH,D)
If your date is in the form dd.mm.yyyy, then this would be the correct DFSORT statement going by your example input record:
Code: Select all
SORT FIELDS=(1,15,CH,A,49,1,CH,D,
56,4,CH,D,53,2,CH,D,50,2,CH,D)
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort