hi all,
When I've tried to sort the time field using Sort Stage, it didn't get work out. So that I've converted the time field value using iconv function. Is there any direct way of sorting then pls. let me know.
Your time will be highly appreciated...
Thanks in advance...
veera...
sort
Moderators: chulett, rschirm, roy
Can you explain what didn't work? DataStage server internal time is an integer (number of seconds since midnight) so it will sort correctly. If you somehow declare this as a character then it will not sort appropriately, so part of the question back is to ask how you are sorting.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
ArndW wrote:Can you explain what didn't work? DataStage server internal time is an integer (number of seconds since midnight) so it will sort correctly. If you somehow declare this as a character then it will not sort appropriately, so part of the question back is to ask how you are sorting.
no.. If i sort the timestamp field directly, then it didn get work out. I've kept the datatype as timestamp only. I meant to say it was not properly been sorted.
So that i've changed the value using iconv function then it went fine. Now my question is, whether sort stage will support for sorting timestamp field directly or should we use iconv function? Meanwhile if there is any other way of sorting the timestamp, pls. let me know.
hi arndw,ArndW wrote:Can you explain what didn't work? DataStage server internal time is an integer (number of seconds since midnight) so it will sort correctly. If you somehow declare this as a character then it will not sort appropriately, so part of the question back is to ask how you are sorting.
Let me explain the situation in detail.
I was in need to sort the dates. My datatype was timestamp only. I've used sort stage to sort the data. But the output was not proper. I mean, it was not being sorted. So that i've used iconv function and then sorted.
What am asking is, why the data has not been sorted regularly when the value for the column was date (say, 1995-01-03). Should i always use iconv function or i use directly?
Hope you will get my point..
Your time will be highly appreciated.
Thanks in advance...
veera...
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It should not matter. The ISO 8601 standard prescribes yyyy-mm-dd and yyyy-mm-dd hh:mm:ss formats precisely because they can be sorted as strings without conversion.
Can you please explain, therefore, what you mean by "not working", preferably with examples?
Can you please explain, therefore, what you mean by "not working", preferably with examples?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Server has no concept of dates or timestamps. If you data is in the form "2008-07-01" (i.e. YYYY-MM-DD) then if you sort it, it will be done as a string and will sort correctly, this wouldn't work with a format of DD-MM-YYYY.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>