View previous topic :: View next topic
|
Author |
Message |
muffirulz
New User
Joined: 14 Sep 2005 Posts: 74 Location: Atlanta, (USA)
|
|
|
|
Hi,
I have the following situation
A 20070101 20071231
A 20071101 20071130
B 20071101
B 20071101 20071130
I need the following output
A 20071101 20071130
A 20070101 20071231
B 20071101 20071130
B 20071101
Basicly need to sort on date fields but the spaces should have priroty after numbers.
Please can you let me know how to achieve it using sort. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
It's not clear what you're actually sorting on. Please show the SORT statement you're using and indicate which field or fields have the dates that should have blanks collated after the numbers |
|
Back to top |
|
|
muffirulz
New User
Joined: 14 Sep 2005 Posts: 74 Location: Atlanta, (USA)
|
|
|
|
Hi,
The file layout is this
ID Date1 Date2
A 20070101 20071231
B 20071101
A 20071101 20071130
B 20071101 20071130
Basicly i need to sort in on id, date2 and then date1.
There are spaces in date2 field so I want then to have least priority.
ID Date1 Date2
A 20071101 20071130
A 20070101 20071231
B 20071101 20071130
B 20071101 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
A 20070101 20071231
B 20071101
A 20071101 20071130
B 20071101 20071130
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
ALTSEQ CODE=(40FA)
OPTION NOCHALT
SORT FIELDS=(1,1,CH,A,14,8,AQ,A,5,8,CH,A)
/*
|
|
|
Back to top |
|
|
muffirulz
New User
Joined: 14 Sep 2005 Posts: 74 Location: Atlanta, (USA)
|
|
|
|
Thanks Frank..
It worked perfect... |
|
Back to top |
|
|
|