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?
Answers were Sorted based on User's Feedback
We can do in this way as well:
In the same job,
SeqFile--->Target1
SeqFile--->Target2
SeqFile--->Target3
for Target1,
add Filter condition in the SeqFile as below:
Head -1
for Target2,
add Filter condition in the SeqFile as below:
Tail -1
for Target3,
add Filter condition in the SeqFile as below:
sed '1,$ d'
| Is This Answer Correct ? | 8 Yes | 2 No |
Answer / kumar
As you have a single text file as Source. Use folloowing
approach to get the desired output.
Head1 Target1
Seq. File Copy Tail2 Target2
Head3 Tail Target3
Steps:
1.> Read your source file using sequential file stage.
2.> Pass the records to copy stage and take 3 output link.
3.> 1 to Head stage head1, 2nd to Head2 and 3rd to Head3.
4.> In the 1st Head Stage Head1, in the properties specify
1, it will pick up the 1st record and make that record to
target 1.
5.> Similarly, to capture last record in target2, in Tail
stage property mention 1. It will take last record and pass
it to target2.
6.> To load rest records 1st using head stage, capture top
records say, if u have 10 records in the source pick top 9
records using head stage then use tail stage followed by
head stage and mention 8, it will pick all records except
1st one. then u can load these to target3.
If u get confused ask me ....
Thanks
Kumar
| Is This Answer Correct ? | 8 Yes | 4 No |
How many Key we can define in remove duplicate stage?
Describe the main features of datastage?
What are operators in datastage?
Is there any possibility to generate alphanumeric surrogate key?
Hi Gus, Can u pls tell me How can u Call the Shell Scripting/Unix Commands in Job Sequence?
how to sort two columns in single job in datastage.
What are datastage sequences?
What is ds designer?
Hi guys, Please design a job for dis requirement with derivation(solution). my source table like dis. emp_no qualification 1 a 1 c 2 a 3 c 3 b To loaded to target like dis emp_no qualification 1 b 2 b 2 c 3 a my requirement is every employer have three qualifications i.e a,b and c. what qualification missed in source table that will be move to target systems. Hope u got it the requirement. Right Thanks.
if 3 table having different columes. like first table having 4 columns , second table having 3 columns and third table having 2 columns then how to capture the data by using funnel stage in parallel jobs...srinu.thadi
17 Answers IBM, TCS,
i/p 1,a,1000 2,b,2000 3,c,3000 i want to get o/p as o/p 1,a,3000 2,b,4000 3,c,5000 how it can be done on using datastage?
what is sparse lookup?