how to sort two columns in single job in datastage.



how to sort two columns in single job in datastage...

Answer / srinivas

We can do this by using the sort stage.

Specify the key columns what ever the you are sort.

Specify column name sort specifications
For example i have 3 columns data like below

Name score rank

abc 85 1
bcd 74 3
abc 82 2
bcd 67 4

When u r sort based on first two colmns

u have to specify two colmn names and specificaton

Like: Name Asc, Score Dsc.

Then u will get the output like below.

Name score rank
abc 85 1
abc 82 2
bcd 74 3
bcd 67 4

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Data Stage Interview Questions

What are the various kinds of containers available in datastage?

0 Answers  


Difference between sequential file and data set?

0 Answers  


How to read multiple files at different directories using a single Sequential File stage in DS Enterprise Edition

6 Answers   TCS,


How can we improve performance of data stage jobs?

0 Answers  


i have a scenario like two columns(Empno, Ename) in that duplicate records are there, so my question is how to get second duplicate record in datastage.

4 Answers   Wipro,






How many number of reject links merge stage can have?

7 Answers   TCS,


How to display errors in datastage?

1 Answers   TCS,


Drop duplicate records ... SOURCE LIKE .......... ID flag1 flag2 100 N Y 100 N N 100 Y N 101 Y Y 101 N Y 102 Y N 103 N N 104 Y Y 105 N N 106 N Y 102 N Y 105 Y Y in above file if any id having both the flags as "N" then that corresponding id records should be dropped, in above case o/p should be as ID flag1 flag2 101 Y Y 101 N Y 102 Y N 102 N Y 104 Y Y 106 N Y Steps to do : 1) Identified the id’s that got duplicated (both the flag values having vales “N”) 2) Look up with these id’s to existing id’s to drop .

2 Answers  


how can we validate the flat files using the date in the header and number of records in the flat file? Using both conditions at a time.

0 Answers   JPMorgan Chase,


How you Remove the Dataset in Unix?

5 Answers  


Differentiate between Join, Merge and Lookup stage?

0 Answers  


specify data stage strength?

1 Answers  


Categories