DataStage Universe Routine

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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

For the sake of our sanity, can you explain in words what this routine is meant to accomplish / return? I really don't want to infer anything based on a reading of the code.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

You need to use @USER0 or @USER1 to store values between calls.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How do you know you're processing the correct level of delimiter? For example Char(252) is - probably - a sub-value mark, while Char(253) is - probably again - a value mark. Some operations, such as Trans() with a multi-valued first argument, effect an automatic Lower() on the dynamic array. Add debugging statements to determine precisely what delimiter character is in Arg1.

Code: Select all

DebugMsg = "Arg 1 = " : Quote(Convert(@FM:@VM:@SM:@TM,'~}|{',Arg1)
Call DSLogInfo(DebugMsg, "Debugging")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rachit82
Premium Member
Premium Member
Posts: 41
Joined: Thu Jul 17, 2008 9:49 am

Post by rachit82 »

chulett wrote:For the sake of our sanity, can you explain in words what this routine is meant to accomplish / return? I really don't want to infer anything based on a reading of the code.
What i am trying to do is get the position numbers for a given multi-valued column. Eg: Arg1 = (ABC~DEF~GHI~JKL ) Then i want the return to be 1:2:3:4.

The problem is when i compile and test the routine it works fine. But when i use the routine in a job it gives me a value of 1
rachit82
Premium Member
Premium Member
Posts: 41
Joined: Thu Jul 17, 2008 9:49 am

Interesting Point but seems like a DS engine problem

Post by rachit82 »

ray.wurlod wrote:How do you know you're processing the correct level of delimiter? For example Char(252) is - probably - a sub-value mark, while Char(253) is - probably again - a value mark. Some operations, such as Trans() with a multi-valued first argument, effect an automatic Lower() on the dynamic array. Add debugging statements to determine precisely what delimiter character is in Arg1.

Code: Select all

DebugMsg = "Arg 1 = " : Quote(Convert(@FM:@VM:@SM:@TM,'~}|{',Arg1)
Call DSLogInfo(DebugMsg, "Debugging")
The situation is that a Value Mark in UniVerse is being treated as an @SVM in DataStage. I created this routine in UniVerse and modified it so that it can be run in Datastage. however there are some issues with the DataStage engine. Clifton from IBM was here the other day and he gave me another Convert funtion called RAISE which is not recognized by DataStage but compiles fine and runs great.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'd be surprised if you could actually pass @SM or @VM characters into the test harness correctly. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
rachit82
Premium Member
Premium Member
Posts: 41
Joined: Thu Jul 17, 2008 9:49 am

Post by rachit82 »

chulett wrote:I'd be surprised if you could actually pass @SM or @VM characters into the test harness correctly. :?
I have not passed any @VM or @SM expressions. i have passed the equivalent delimiters that are provided by the view data from DataStage. This shows that DataStage masks @VMs as @SVMs which is incorrect and the Test part of Datastage also suffers from the same problem....
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

rachit82 wrote:
chulett wrote:I'd be surprised if you could actually pass @SM or @VM characters into the test harness correctly. :?
I have not passed any @VM or @SM expressions. i have passed the equivalent delimiters
Which is exactly what I meant. :roll:
-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 »

Code: Select all

argArg1 = Arg1
Counter = 0
Ans = ""
Loop
Remove Element From argArg1 Setting Delim
   Counter += 1
   Ans := Element : Char(256 - Delim)
While Delim
Repeat
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

"Spot my deliberate error" :wink:

argArg1 = Arg1
Counter = 0
Ans = ""
Loop
Remove Element From argArg1 Setting Delim
Counter += 1
Ans := Counter : Char(256 - Delim)
While Delim
Repeat
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