Job aborts with "Input data not sorted" error

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Job aborts with "Input data not sorted" error

Post by abc123 »

Job design:
OraEnt --> Sort --> Dataset

Sort stage:
-----------
Sorting Keys:
Key: BKCol
Sort Key Mode: Don't Sort (Previously Sorted)
Sort Order = Ascending
Input Tab, Partitioning Tab: Auto

Dataset stage:
Input Tab, Partitioning Tab: Hash
Hash partitioned on BKCol

OraEnt: Sorting is being done in the SQL using ORDER BY

This job aborts with the message:
Sort_110,3: Input not sorted at record 20
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well... simply put, you've asserted that the data will be hitting the Sort stage sorted in a certain manner and... you lied. It's not.

You need to figure out the disconnect between what you think you are doing and what you say you are doing.
-craig

"You can never have too many knives" -- Logan Nine Fingers
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

Craig, thank you for your response.

I think I am sending sorted data to the Sort stage but apparently, it doesn't think so.

I tried adding the two environment variables APT_NO_PART_INSERTION and APT_NO_SORT_INSERTION and setting them to True. Same result.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Write a test job where you use the sort stage but actually sort the data and write to a sequential file, then compare your original with the sorted data and you'll see the difference.
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

But how would I achieve the not sorting condition in this job? I want to do it in the database and not in Datastage.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Make sure your ORDER BY in your SQL matches the key column(s) you specify in the Sort stage and that their data types match. A numeric sort and a string sort of the same data can output data in different orders and trip people up sometimes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
abc123
Premium Member
Premium Member
Posts: 605
Joined: Fri Aug 25, 2006 8:24 am

Post by abc123 »

The ORDER BY was not sorting data correctly. That's why the Sort stage was complaining.
prakashdasika
Premium Member
Premium Member
Posts: 72
Joined: Mon Jul 06, 2009 9:34 pm
Location: Sydney

Post by prakashdasika »

Try This:

Input Tab, Partitioning Tab: Same

instead of Auto.
Post Reply