KeyMgmt Function

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

TonyInFrance
Premium Member
Premium Member
Posts: 288
Joined: Tue May 27, 2008 3:42 am
Location: Luxembourg

Post by TonyInFrance »

ray.wurlod wrote:You can't use the DataStage SQL directly. You could use an Execute Command activity to invoke the DataStage shell (dssh) to execute the command.
This works fine. Thanks. Invoking the key management routines from a routine activity doesn't seem to work though fyi. Returns the same result as calling them in an User Variables activity.
Tony
BI Consultant - Datastage
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you please show how you call the function?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
TonyInFrance
Premium Member
Premium Member
Posts: 288
Joined: Tue May 27, 2008 3:42 am
Location: Luxembourg

Post by TonyInFrance »

In an Execute Command Activity I call:

$DSHOME/bin/dssh "UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'ID';" which is the syntax you gave me in a previous post.

In a Routine Activity I was calling the routine KeyMgtGetNextValue and giving a ID as Arg1.
Tony
BI Consultant - Datastage
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

... and what does "doesn't work" mean in this context? For example, if $DSHOME was not set you might get a "command not found" error.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
TonyInFrance
Premium Member
Premium Member
Posts: 288
Joined: Tue May 27, 2008 3:42 am
Location: Luxembourg

Post by TonyInFrance »

Ah well when I said doesn't work I meant that the variable wasn't getting initialized to 0 at the beginning of each run. So I have to run the command:
$DSHOME/bin/dssh "UPDATE SDKSequences USING DICT VOC SET F1 = '1' WHERE @ID = 'ID';" through an Execute Command activity anyway before entering the loop. Once inside the loop I have a choice of either calling KeyMgtGetNextValue and assigning the value derived in a User Variable stage or using a Routine Activity to call the routine KeyMgtGetNextValue and then using its return.
Tony
BI Consultant - Datastage
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Of course that query will initialize the ID sequence to 1, not to 0. But otherwise it should be OK. You need to query (via the routine) to get the next value even after initialization.

Is it now working? If so please mark the thread as resolved.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

They're not the thread starter, so they cannot. However, there seems to be enough information here, so.... <click>

:wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply