I think I have figured out how to resove the problem:
If I comment out all the lines related to "Initialized", I can get what I expected.
Can anybody explain to me why use "If Not(Initialized) Then..." and how to make it work with this condition on? Thanks,
Shepli
How to use routine "StringDecode"
Moderators: chulett, rschirm, roy
Re: How to use routine "StringDecode"
hello,
with this routine, once a Arg2 which is like key-value pair as A=1|B=2|C=3 or even like h=hello|j=jai|k=kamat.
i think the lookup Arg2 is session specific, if you try to add more value to lookup to Arg2 after executing and re-run the routine, it does not work.
if you close your session, i mean to say close datastage and try to add more value to lookup and run the routine it works fine.
above logic refers to memory allocation and its reference.
with this routine, once a Arg2 which is like key-value pair as A=1|B=2|C=3 or even like h=hello|j=jai|k=kamat.
i think the lookup Arg2 is session specific, if you try to add more value to lookup to Arg2 after executing and re-run the routine, it does not work.
if you close your session, i mean to say close datastage and try to add more value to lookup and run the routine it works fine.
above logic refers to memory allocation and its reference.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Read the section on COMMON, particularly named COMMON, in the DataStage BASIC manual. What you got was an artifact of your test processes being in the same session - and would not happen in a real situation.
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.
sachin1 and Ray,
Thank you for your response. I'll try to figure out in which case the "session specific Arg2" will fit my needs.
At this moment, if I comment out all the lines related to "Initialized", I can get what I expected. That means any time when I have an Arg1, and a paired Arg2 string, I can get the right result.
Thank you again,
Shepli
Thank you for your response. I'll try to figure out in which case the "session specific Arg2" will fit my needs.
At this moment, if I comment out all the lines related to "Initialized", I can get what I expected. That means any time when I have an Arg1, and a paired Arg2 string, I can get the right result.
Thank you again,
Shepli
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You don't need to change the code at all. Just disconnect between tests.
Variables in COMMON are persistent. The routine has been written to make use of this fact, to persist the array of match pairs between rows.
What your problem is is merely an artifact of your test strategy.
Variables in COMMON are persistent. The routine has been written to make use of this fact, to persist the array of match pairs between rows.
What your problem is is merely an artifact of your test strategy.
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.