How to avoid first five rows from the source in Importing

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
subbuvp
Participant
Posts: 15
Joined: Tue Feb 21, 2006 2:07 am

How to avoid first five rows from the source in Importing

Post by subbuvp »

Hi,
I have 200 rows and i need to import the 95 rows to my source (all are in text files).
So how can i avoid first five rows to sourch while importing...

Can you please help me to solve this

thanks

Subbu
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

Hi

The is a DSLinkRowCount function by which you can ignore the first 5 rows. Set DSLinkRowCount > 5.

Regards
Sreeni
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Re: How to avoid first five rows from the source in Importin

Post by thebird »

subbuvp wrote:Hi,
So how can i avoid first five rows to sourch while importing...
Use the Filter option in the Sequential file stage. If you know the number of rows in your file (200 in this case) you can give Tail -195 in the filter and this will read only the last 195 records from the file.

But is the number of records in your file going to be a constant?
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

You can parameterize the rows to be read in the sequential file filter as

tail -#rowcount#
where rowcount is the job parameter. You need to pass the appropriate value to rowcount job parameter.
Last edited by balajisr on Tue Dec 05, 2006 2:24 am, edited 1 time in total.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

So how can i avoid first five rows to sourch while importing
You can use

Code: Select all

tail +6 filename
. Also note that it does not works on all flavors of unix.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Re: How to avoid first five rows from the source in Importin

Post by narasimha »

subbuvp wrote:So how can i avoid first five rows to sourch while importing...
Subbu,
This can be your other option,
If you have a transformer in between your two files, add the below constraint

Code: Select all

@INROWNUM > 5
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Re: How to avoid first five rows from the source in Importin

Post by thebird »

narasimha wrote:This can be your other option,
If you have a transformer in between your two files, add the below constraint

Code: Select all

@INROWNUM > 5
This wouldn't work as there would be Fan out happening from the file and the data would get partitioned when it reaches the transformer - and the ordering would be lost.
Moreover as the transformer is working in parallel, each node would try to execute that constraint - which would not meet the requirement.

Aneesh
Post Reply