Page 1 of 2

how to skip first 4 records

Posted: Mon Mar 20, 2006 10:56 pm
by somu_june
Hi,

I want to skip four records. I tried with @INROWNUM and I gave columm name for @INROWNUM as linenum. I got numbers 1 to 24 . I want to take record from linenum 5 so in transformer constraint I gave linenum>=5 but Iam getting only 5 records i.e linenum 5 to 9 but I want records from 5 to the end i.e 24 in this condition . How to achieve his ,plz help me.



Thanks,
Somaraju.

Posted: Mon Mar 20, 2006 11:09 pm
by rasi
Somu

What is your source?. Are you executing your job in parallel mode or sequential mode?

Easiest way is to change your job to run in sequential mode and have the constraint as @INROWNUM >=5

Thanks

Posted: Mon Mar 20, 2006 11:13 pm
by chulett
Isn't there a property in the PX Sequential File stage to skip the first X records? :? Seem to recall that...

Posted: Mon Mar 20, 2006 11:31 pm
by rasi
Craig

I don't think that there is an option to skip first N rows in PX Sequential Stage. I do remember that there is an option to Read First N Rows in PX Sequential stage...

Posted: Mon Mar 20, 2006 11:44 pm
by chulett
Perhaps that's what I was thinking of.

Posted: Mon Mar 20, 2006 11:45 pm
by ray.wurlod
There's a Skip option in View Data but not, I believe, in the Sequential File stage.

Do you want to skip four records per partition, or four records in total? Is your source a text file or a database table or some other source?

Posted: Mon Mar 20, 2006 11:51 pm
by rasi
Guys

Had a quick look in the Parallel Developer Guide Manual and found that not all options for Sequential stage is described inside the manual. It seems that we need to browse the real object to see all the options available for a stage.

Posted: Mon Mar 20, 2006 11:57 pm
by ray.wurlod
There's a lot of that. That's why it's useful (vital) to have the Orchestrate manuals available also.

Posted: Tue Mar 21, 2006 2:38 am
by daniel0623
Hi somu_june,
It seems datastage can't skip first N rows.But we can read all rows firstly,then filter by Filter Stage.

You may choose Row Number Column in Sequential File Stage's Properties page.Name a value,such as RowNum.Add a column with same name in Columns page. SQL type:Integer .Then we can get real row num.Pay attention,this value will start with 0.

Now you can filter first 4 rows in Filter Stage.Just type RowNum > 4 when output.

By the way,System variable @INROWNUM can't indicate the real row number of file when DSEE has more than 1 partition.It just shows row num in every partition.Good luck!

Posted: Tue Mar 21, 2006 7:56 am
by kumar_s
May be possible if dont really want to stick with Sequential stage. And the provide the input file is Sequential Flat file.
You can use Head stage. Where you have option to 'Skip n rows per partiton. Also that you have option to read N rows.
Also make sure the partion is made to single. Either by Forcing in sequential mode or by including a APT_CONFIG_FILE paramter with one node.

Posted: Tue Mar 21, 2006 10:34 am
by somu_june
Hi,


Thank you every one for helping me.



Thanks,
Somaraju

Posted: Wed Mar 22, 2006 9:51 am
by mpouet
Hi,

Why don't you use a UNIX command in a before job subroutine ?
tail +5 yourfile > newfile

Bye
Matthieu

Did anyone ever figure this out?

Posted: Tue Oct 01, 2013 10:13 am
by dmalsobrook
Hello Somaraju and others,

I know this is old but was this issue ever solved? I have the same problem.

Thank you.

Posted: Tue Oct 01, 2013 12:22 pm
by prasson_ibm
There could be possibly workaroud, if your source is sequential file then you can generate sequence nunumber and then in transformer constraint give condition like seqno> 4

Posted: Tue Oct 01, 2013 4:31 pm
by rsomiset
Row number column in the options category can be used to generate row numbers if required...using which we can filter in subsequent stages.