Wednesday, December 5, 2012

How to find the nth highest salary in file?


Job:
sequential file-->sortstage-->transformer stage--->targetsequentialfile
sort stage settings
Sal-desc 

Transformer stage settings
constraint-@INROWNUM=n

Both the sort stage and transformer must run in sequential mode.

9 comments:

  1. I tried it but it doesn't work..... Please give correct solution. I appreciate your effort...

    ReplyDelete
  2. may i know what is the problem your are facing to resolve the issue?

    ReplyDelete
  3. When i give this "@INROWNUM=n" in transformer contraint. it shows error like "Error in constraint Variable 'n' not defined.

    ReplyDelete
  4. We should not use n and it should be replaced by some integer For ex: 2 if u want to find the 2 highest salary.

    ReplyDelete
  5. Thanks for helping me ji.... How can we find last record of the file?

    ReplyDelete
  6. sequentialfilestage-->tail-->sequentialfilestage

    execution Mode for tail stage is sequential and Number of rows (per partition)=1

    ReplyDelete
  7. Vamsi I did course in datastage. Could you help me find better job in datastage?

    ReplyDelete