Home > Software > Data-Warehouse > DataStage
Interview Questions   Tutorials   Discussions   Programs   Discussion   

DataStage - My input has a unique column-id with the values 10,20,30.....how can i get first record in one o/p file,last record in another o/p file and rest of the records in 3rd o/p file?




789
views
asked Prem April 22, 2014 07:34 AM  

My input has a unique column-id with the values 10,20,30.....how can i get first record in one o/p file,last record in another o/p file and rest of the records in 3rd o/p file?


           

3 Answers



 
answered By   0  
Use sequential stage with rownumbers. Then filter out rownum = 0(that will be your first record). Then sort the other data in descending order. Send the sorted data to a transformer, use a stagevariable svval with initial value as 0. In the derivation for svval use svval + 1. The transformer should have two output links. The constraint for the first link is svval != 1 (that will be all the records but last), the constraint for the second link will be svval = 1 (This will be the last record).
flag   
   add comment

 
answered By   0  
use head stage, tail stage 
flag   
   add comment

 
answered By Prem   0  

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert