Fetching last row from a particular column of sequential file

How to fetch the last row from a particular column.. Input file may be sequential file...

Questions by sharmilas

Showing Answers 1 - 12 of 12 Answers

tina123

  • Jul 10th, 2008
 

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.

  Was this answer useful?  Yes

Akil

  • Apr 1st, 2013
 

There are 2 ways to fetch the last row of any file if the number of records in the file is not known before run time:

1) Use the tail stage and run the tail stage in sequential mode
2) Use the lastrow() function in the transformer stage

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions