How to use routine "StringDecode"

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
shepli
Participant
Posts: 79
Joined: Fri Dec 17, 2004 9:56 am

Post by shepli »

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
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: How to use routine "StringDecode"

Post by sachin1 »

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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
shepli
Participant
Posts: 79
Joined: Fri Dec 17, 2004 9:56 am

Post by shepli »

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply