Page 1 of 2

Using sort stage

Posted: Wed Jul 24, 2002 2:11 pm
by kdronam
I'm new to DataStage.
Can you please suggest on how to use the sort stage.
I'm having trouble in getting it working.

I have a simple test in which I have a seq.file
passed to sort stage and output to a sorted seq. file

Error as following
sorttest..sort1: Internal Error: sort specification error, function create_sort_spec returned [Invalid column 'DSLink3.date' in sort specification]

tried different ways without the Link etc., still no good.

Thanks in advance.

Posted: Tue Jul 30, 2002 7:20 am
by cmueller
The sort specification in the sort stage is case sensitive, check your input sequential stage, specifically 'DSLink3.date'.

Re: Using sort stage

Posted: Wed Aug 25, 2004 8:50 am
by Oancea
kdronam wrote:Error as following
sorttest..sort1: Internal Error: sort specification error, function create_sort_spec returned [Invalid column 'DSLink3.date' in sort specification]
Sort specification has this format:
<ColumnName> <Order> [, <ColumnName> <Order>, ...]
where <Order> take 'ASC' or 'D' values (it's not case sensitive)
In your case, type: date asc

Posted: Wed Aug 25, 2004 9:01 am
by chulett
Don't use link name in the sort spec, simply specify the column names.

Posted: Sun Dec 25, 2011 11:37 am
by ketfos
Hi, This is an old link and I am getting the sam error and the solution mentioned in this post did not help.

sort..Sort_1: Internal Error: sort specification error, function create_sort_spec returned [DSTAGE-SORT-0059`:`Invalid sort specification]

In the sort specifications, i specify the column name and temp directory name. Other parmeters are default.

What else is required?

THanks
Ketfos

Posted: Sun Dec 25, 2011 12:39 pm
by pandeesh
Hi,
What are your input columns and what you are specifying as keys in sort stage?

Posted: Sun Dec 25, 2011 1:06 pm
by ketfos
My source is the database. I do not want to use order by in database SQL.
That is why I using sort stage.

In Sort Specifications , I give the name of the column on which I want to sort.
In temporary directory, I give name of the Unix directory

In input columns, i chose all columns and specify a key column.
In output columns, i chose all columns and specify a key column.

Thanks
Ketfos

Posted: Sun Dec 25, 2011 3:47 pm
by ray.wurlod
Did you give the name of the column followed by a space then one of asc, ASC, desc or DESC ?

Posted: Sun Dec 25, 2011 4:43 pm
by ketfos
I did not give the name of the column followed by asc or desc.

After reading your email, i did give the name of column, followed by asc.

The job now runs correct.

Thanks Ray.

1. Where in the documentation I can see this syntax of sort to specify sort order?

Ketfos

Posted: Sun Dec 25, 2011 8:09 pm
by ray.wurlod
My guess would be the Sort stage chapter in the Server Job Developer's Guide.

Posted: Sun Dec 25, 2011 8:56 pm
by ketfos
I reading the Websphere Datastage Server Job Guide - 46desjd.pdf
The Chapter 4
mentions all the stages below expect SOrt Stage.
1. Folder
2. Seq File
3. hash File
4.Aggregator
5.Merge
6. Transformer
7. Link Collector and Partition
8.IPC
9. Command
10. Ftp

Ketfos

Posted: Sun Dec 25, 2011 10:45 pm
by pandeesh
Ketfos,
I believe your problem gets resolved.
So can you please resolve this topic?

Thanks

Posted: Sun Dec 25, 2011 11:33 pm
by ketfos
Where do I click to maark it resolved?

Posted: Sun Dec 25, 2011 11:44 pm
by pandeesh
You can find the button at the top of te page as mark topic:resolved .

Posted: Sun Dec 25, 2011 11:57 pm
by ketfos
I am not orignal author.

I have opened an old post which had the same error message but there was no clear resolution.

hence I cannot close the issue, athough my problem is resolved after inputs from Ray.

Ketfos