Sorting in Server Jobs

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Sorting in Server Jobs

Post by ds2000 »

Hi,
I want to do sort in a server job. I tried to get help for server SORT stage but couldnt. Can anyone help me out what options has to be set in SORT stage with some example plz.

Thanks.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Meaning you didn't understand the help or couldn't find any help for the stage?
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The two biggest things to know are:

1. Never leave the Temporary Directory empty as that puts all work files in the Project
2. How to enter the Sort Specifications

The sort specs are simply a column separated list of the columns to sort on (in that order) and the 'direction' to sort:

Code: Select all

Column_A asc, Column_B ASC, Column_C desc
A or ASC = ascending, case insensitive
D or DESC = descending, case insentive
a or asc = ascending, case sensitive
d or desc = descending, case sensitive

You can also supply a custom collation order using an 'external character map' but let's not worry about that quite yet.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The two biggest things to know are:

1. Never leave the Temporary Directory empty as that puts all work files in the Project
2. How to enter the Sort Specifications

The sort specs are simply a column separated list of the columns to sort on (in that order) and the 'direction' to sort:

Code: Select all

Column_A asc, Column_B ASC, Column_C desc
A or ASC = ascending, case insensitive
D or DESC = descending, case insentive
a or asc = ascending, case sensitive
d or desc = descending, case sensitive

You can also supply a custom collation order using an 'external character map' but let's not worry about that quite yet.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

I provided Sort Specification as below and it errored out:

TRAN_NO Desc

Drivertest..Sort_29: Internal Error: sort specification error, function create_sort_spec returned [Invalid sort specification]

I mentioned Temp directory as follows:
\\xyz1\DEV\temp
mikegohl
Premium Member
Premium Member
Posts: 97
Joined: Fri Jun 13, 2003 12:50 pm
Location: Chicago
Contact:

Post by mikegohl »

It is case sensitive
Michael Gohl
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Right, so either desc or DESC but not mixed case.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ds2000
Premium Member
Premium Member
Posts: 109
Joined: Sun Apr 22, 2007 7:25 pm
Location: ny

Post by ds2000 »

It worked with correct case. Thanks.
code_titan
Premium Member
Premium Member
Posts: 1
Joined: Mon Feb 13, 2006 11:00 am

Re: Sorting in Server Jobs

Post by code_titan »

Now, can someone tell me how to sort the entire record using a server sort.

I have 1013 Rows
With column structure: RTC OTC RecType ...
RTC and OTC are Keys and columns I need to sort by.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

A) Welcome.
B) You really need to start your own topic.
C) When you start you new post, explain what you mean by 'server sort'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply