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

HOW CAN WE SEE THE DATA IN DATASET?

12 Answers   IBM, TCS,


Thanks to all people who are posting their comments...

1 Answers   CTS,


source contains 2 columns comes to target 4 columns how

1 Answers   IBM,


Source Like department_no, employee_name ---------------------------- 20, R 10, A 10, D 20, P 10, B 10, C 20, Q 20, S and Output should be like this department_no, employee_list -------------------------------- 10, A 10, A,B 10, A,B,C 10, A,B,C,D 20, A,B,C,D,P 20, A,B,C,D,P,Q 20, A,B,C,D,P,Q,R 20, A,B,C,D,P,Q,R,S

3 Answers  


What is the diff between sort performed at sort stage and the stream sort performed at the input of few stages in DS Enterprise edition?

1 Answers  






Parallel job contains more than 20 stages. I want to find out which stage is more performance incentive.

1 Answers   IBM,


I have a scenario like Deptno=10---->First record and last record Deptno=20---->First record and last record Deptno=30---->First record and last record I want those first and last records from each department in a single target. How to do this in DataStage, any one can assist me. Thanks in advance.

8 Answers  


Can we use target hash file as a lookup ?

0 Answers  


Hi am sundar, i have datas like 00023-1010 00086-1010 00184F2-1010 . . . . SCH-AS-1010 200-0196-039 . . . Now i want the result "SCH-AS" in onee column and "1010" in another column.. Can any one tell the answer...

5 Answers  


im new to this tool im now at project plz tell me step by step process how to design plz help me i wnt to go with exp for job plz give me d proper design and explination

0 Answers  


HOW CAN U DO ERROR HANDLING IN DATA STAGE?

8 Answers   ME,


A signal has a wavelength of 1 micro min in air.how far can the front of the wave travel during 1000periods?

0 Answers  


Categories