dileep


{ City } hyderabad
< Country > india
* Profession * software engineer
User No # 72685
Total Questions Posted # 0
Total Answers Posted # 2

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 10
Users Marked my Answers as Wrong # 3
Questions / { dileep }
Questions Answers Category Views Company eMail




Answers / { dileep }

Question { Scope International, 29048 }

Hi I am Vijay
In my source i've 10 records in a single column.... but i
want to split those records into 5 sequential files each
seq file contains 2 records.?.... can any body help me?


Answer

Hi This is Dileep,

Take one Sequential File, One Copy Stage and Put 5 O/P Links to Sequential Files.

From Sequential File, Map Directly to Copy Stage and to Sequential Stage.

In the target Sequential File, In the "Options", One 'Filter' Option is there. In that... Put the Condition like the below..
1 O/P---- head -2
2 O/P---- head -4| tail -2
3 O/P---- head -6| tail -2
4 O/P---- head -8| tail -2
5 O/P---- tail -2.
Similarly U can achieve this in Datastage by Using the Debug Stages 'Head' and 'Tail'. Precondition is to Run the Job on 'Single Node' or 'Sequentially'.

Is This Answer Correct ?    4 Yes 0 No

Question { Caterpillar, 10348 }

How can we read latest records in a text file named
file1.txt using seq file stage only?

file1 having 100 records in that 5 record sare latest
records.How can we read that latest records?


Answer

Question is not clear... Be more specific.
As my asumption, the letest records might be the last 5 records in the Sequential file. If so...

In Sequential File stage,
In Filter option Give the Command "tail -5 File_name".

It will give last 5 records.

Correct me if I wrong ...

Is This Answer Correct ?    6 Yes 3 No