Stop the job after 1 read row
Moderators: chulett, rschirm, roy
Stop the job after 1 read row
Hi to all,
I have the job below:
HASH ---> TRANSFORM ---> SEQFILE
This hash have millions of rows, but i need stop the job after read the first only. In transform stage i put @INROWNUM in constraint, but the dstage read all rows in hash...It's take 6hours to finish...
I try with @OUTRONNUM too, but the result as the same.
Any idea?
Thanks a lot!
I have the job below:
HASH ---> TRANSFORM ---> SEQFILE
This hash have millions of rows, but i need stop the job after read the first only. In transform stage i put @INROWNUM in constraint, but the dstage read all rows in hash...It's take 6hours to finish...
I try with @OUTRONNUM too, but the result as the same.
Any idea?
Thanks a lot!
Split the job. Simple as that. Aborting the job or even stopping the job before its true end doesnt always comeout with good results, IMHO. Thats why i advised to finish the job by limiting the execution to one row.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Re: Stop the job after 1 read row
Can you post the exact constraint that you put in your Xfmr stage?
gateleys
gateleys
HASH-->XFM--->SEQ means ALL rows output from the HASHed file to get to the XFM to be thrown away. Split the jobs if your logic is messy.
As for the first row out of the hashed file, how do you qualify the first row? By order written into the file? Sorry, hashed data is randomized throughout the file. There is no "first" row concept.
If you use the UV/ODBC (Universe) stage, you could use SQL to limit the rows via a WHERE clause, or if your hashed file is created in the project (if not use SETFILE, search the forum) then you can use the WITH @ID=xxxx where xxxx is the single key value for the row you want output.
As for the first row out of the hashed file, how do you qualify the first row? By order written into the file? Sorry, hashed data is randomized throughout the file. There is no "first" row concept.
If you use the UV/ODBC (Universe) stage, you could use SQL to limit the rows via a WHERE clause, or if your hashed file is created in the project (if not use SETFILE, search the forum) then you can use the WITH @ID=xxxx where xxxx is the single key value for the row you want output.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The Hashed File stage has a Selection tab does it not? An appropriate selection phrase phrase to put in here is
If that builds a WITH phrase that causes a syntax error, trick DataStage into generating a legal phrase, for example
Code: Select all
FIRST 1
Code: Select all
1 = 1 FIRST 1
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.