How to generate serial number
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 35
- Joined: Mon May 06, 2013 5:59 am
How to generate serial number
Hi Folks
i have scenario in which two sources are the assume s1,s2 for s1 i have sno column but where as s2 sno is not there but i have to combine both those records and sno should continue from s1 to s2.
Thanks
i have scenario in which two sources are the assume s1,s2 for s1 i have sno column but where as s2 sno is not there but i have to combine both those records and sno should continue from s1 to s2.
Thanks
If your s1 has 2 records with serial numbers 1 & 2, what should the serial numbers of records 1 and 2 in s2 be?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 35
- Joined: Mon May 06, 2013 5:59 am
Sorry but that just looks like math to me... as in "add one". What's the actual problem you're having here - how to combine the two sources in a serial fashion? What have you tried? It would help if you let us know what your sources actually are... files or tables.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 35
- Joined: Mon May 06, 2013 5:59 am
Of course I can see that, I'm just trying to say that the 'serial number' part of your post looks very straight forward to me. You should be able to use stage variables to track the records with a number and then add one after that for the ones that do not. As for the 'serial' part, I would look at the Filter option in the Sequential File stage to cat them together. You could recognize one from the other by the comma... or lack thereof.
Run on a single node or in sequential mode. Or a Server job would make this even easier.
Run on a single node or in sequential mode. Or a Server job would make this even easier.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 91
- Joined: Wed Apr 20, 2005 7:59 pm
- Location: U.S.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Only if your Transformer stage is executing in sequential mode. Otherwise the unqualified +1 approach is pretty much guaranteed to generate duplicates.
Depending on your target there are other strategies you can employ, such as a generated Surrogate Key or a database sequence.
Depending on your target there are other strategies you can employ, such as a generated Surrogate Key or a database sequence.
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.
I would check for a null v. non-null sequence number. Non-null, store it. Once you hit the nulls, add 1 to the previously stored value. And as noted twice now, do this in sequential mode so you have full control over the order the records come in.mobashshar wrote:Just wondering how to use stage variables to track the records with a number and add one after that for ones that do not?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 35
- Joined: Mon May 06, 2013 5:59 am