GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Data Warehousing  >  DataStage

 Print  |  
Question:  fetching last row from a particular column of sequential file

Answer: how to fetch the last row from a particular column.. Input file may be sequential file...


July 07, 2008 08:08:05 #2
 tina123 Database Expert  Member Since: July 2008    Total Comments: 3 

RE: fetching last row from a particular column of sequential file
 
Develop a job source seq file--> Transformer--> output stage

In the transformer write a stage variable as rowcount with the following derivation
Goto DSfunctions click on DSGetLinkInfo..
you will get "DSGetLinkInfo(DSJ.ME,%Arg2%,%Arg3%,%Arg4%)"
 Arg 2 is your source stage name
Arg 3 is your source link name
Arg 4 --> Click DS Constant and select DSJ.LINKROWCOUNT.
Now ur derivation is
"DSGetLinkInfo(DSJ.ME,"source","link", DSJ.LINKROWCOUNT)"

Create a constraint as @INROWNUM =rowcount
and map the required column to output link.
     

 

Back To Question