I have a source like file it have Number of records and i want to load without first and last records in target?Datastage?

Answers were Sorted based on User's Feedback



I have a source like file it have Number of records and i want to load without first and last record..

Answer / shivam

For this we can use Head and tail stages from development
and debug stages. Suppose we have 10 records,And we are
asked to pick 2nd to 9th record in the output, then go for
the following:
Sequential file--->Head stage--->Tail stage---->Data set

In the Head stage properties mention the number of records
you want to extract 9 records, this way you will get 1st to
9th records(top 9) extracted. Now, in Tail stage properties
mention number of records to extract 8, this way you get
last 8 records out of top 9 i.e 2nd to 9th. Finally as an
output you will find records 1st and 10th dropped.

Is This Answer Correct ?    7 Yes 1 No

I have a source like file it have Number of records and i want to load without first and last record..

Answer / prasad

In seq file, we have filter option (datastage)

filter= sed '1d;$d'

In Unix= sed '1d;$d' File_Name

it will remove header and footer records(quotes must and should)

Is This Answer Correct ?    3 Yes 0 No

I have a source like file it have Number of records and i want to load without first and last record..

Answer / srinu

using external filter
in this we use command sed -n '1d,
$d'(this is unix command we use we get answer)
(or)
we use command tail +2 |sed -n '$d'

Is This Answer Correct ?    6 Yes 4 No

I have a source like file it have Number of records and i want to load without first and last record..

Answer / prabhu

we use seq file
in that stage properties->options->filter in that SED'2,$!P' FILENMAE
IT ISWORKING

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Data Stage Interview Questions

4) source target c1 c1 c2 c3 c2 c4 c4 c5 c3 c6 c7 c4 c5 c6 c7 please send me answer this question my mail

1 Answers  


how to convert rows into columns

2 Answers   IBM,


5) A file contains 10 (1-10) I want trgt like Trgt 1 trgt 2 trgt 3 1 2 3 4 5 6 7 8 9 10

2 Answers  


which is more expensive hash or modulus partitioning? when do you use modulus partitioning?

2 Answers   TIAA CREF,


input Name Salay Sam 10 Sam 30 Sam 20 Ram 40 Ram 50 Output should be Name Salary Count Sam 10 3 Ram 40 2 get min salary and count of name . OutPut 2 Name Seq Sam 1 Sam 2 Sam 3 Ram 1 Ram 2

1 Answers   HCL,


I have source like "abcdefghijklmnopqrs", how to change 10th character from j to z in datastage?

2 Answers  


How to write a expression to display the first letter in Caps in each word using transformer stage ? Please let me know ASAP Thanks in advance...

0 Answers   Alpharithm Technologies,


what is diff b/w datastage 8.1,8.5,8.7?

1 Answers   IBM,


How can u execute the sql query through unix? What is the Primary key for Dimension table? what is the primary key for Fact table?

5 Answers   TCS,


Hai..,in datastage how to explain project in interview?please explain any domain please.

1 Answers   Wipro,


How can we achive parallelism

1 Answers   CTS,


What is the difference between orabulk and bcp stages?

0 Answers  


Categories