how to skip first 4 records

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

somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

how to skip first 4 records

Post 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.
somaraju
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post 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
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Isn't there a property in the PX Sequential File stage to skip the first X records? :? Seem to recall that...
-craig

"You can never have too many knives" -- Logan Nine Fingers
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post 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...
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Perhaps that's what I was thinking of.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post 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.
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There's a lot of that. That's why it's useful (vital) to have the Orchestrate manuals available also.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
daniel0623
Charter Member
Charter Member
Posts: 34
Joined: Tue May 31, 2005 8:17 pm
Location: ShangHai,China

Post 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!
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi,


Thank you every one for helping me.



Thanks,
Somaraju
somaraju
mpouet
Participant
Posts: 34
Joined: Mon Oct 18, 2004 10:23 am
Location: France

Post by mpouet »

Hi,

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

Bye
Matthieu
dmalsobrook
Participant
Posts: 1
Joined: Wed Sep 04, 2013 10:06 am

Did anyone ever figure this out?

Post by dmalsobrook »

Hello Somaraju and others,

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

Thank you.
Devin L
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post 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
rsomiset
Premium Member
Premium Member
Posts: 46
Joined: Fri Sep 21, 2007 7:16 pm

Post 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.
--
Raj
Post Reply