DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
maximus
Participant



Joined: 03 Mar 2004
Posts: 10

Points: 108

Post Posted: Thu Mar 11, 2004 7:01 am Reply with quote    Back to top    

DataStage® Release: 7x
Job Type: Server
OS: Windows
Hi Pals

Few days back I was going thru a discussion in this forum about returning more than one value from a routine.I used to concatenate those value using a delimiter and use the Field function to get them.

Ray had told about the usage of system variables @User0-@User4.So out of curiosity I tried to use them but failed.I would like to know how to use them coz if I give @User0 in the Derivation it is giving a syntax error.And the list of System variable shows @USERNO.

Max
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 39162
Location: Denver, CO
Points: 199972

Post Posted: Thu Mar 11, 2004 7:40 am Reply with quote    Back to top    

maximus wrote: Ray had told about the usage of system variables @User0-@User4.So out of curiosity I tried to use them but failed. Actually, what Ray mentioned was the use of @USER0 - @USER4. ...

_________________
-craig

If you try and take a cat apart to see how it works, the first thing you have on your hands is a non-working cat. -- Douglas Adams
Rate this response:  
Not yet rated
RamonaReed
Participant



Joined: 27 Feb 2004
Posts: 26
Location: WI, USA
Points: 273

Post Posted: Thu Mar 11, 2004 10:09 am Reply with quote    Back to top    

This is how I used the variables in my Server Routine that Ray had mentioned. I hope it helps you.

*** Arg1
*** Arg2
*** Arg3
*** Arg4
*** Arg5
*** Arg6

*** @USER0 = Returned 1st value
*** @USER1 = Returned 2nd value
*** @USER2 = Returned 3rd value
*** @USER4 = Returned 4th value


nDefault = 1


Begin Case
Case Co = 'X'
@USER0 = 'XYZ'
Case Co = 'Y'
@USER0 = 'YZX'
Case Co = 'Z'
@USER0 = 'ZXY'
Case nDefault
@USER0 = Co
End Case

Begin Case
Case Arg6 = 'IM'
@USER3 = 'XXX'
@USER1 = Arg6
@USER2 = Arg3
Case Arg6 = 'UME'
@USER0 = 'XZY'
@USER1 = Arg6
@USER2 = Arg3
@USER3 = Arg5
Case nDefault
@USER3 = Arg5
@USER1 = Arg6
@USER2 = Arg3
End Case
Rate this response:  
Not yet rated
kduke

Premium Poster


since February 2006

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 29 May 2003
Posts: 5092
Location: Dallas, TX
Points: 33901

Post Posted: Thu Mar 11, 2004 12:32 pm Reply with quote    Back to top    

@USER variables are sort of global variables. They only work across one connection. So a complex job may not work across the whole job because the way DataStage works. Named COMMON variables have the ...

_________________
Mamu Kim
Rate this response:  
Not yet rated
maximus
Participant



Joined: 03 Mar 2004
Posts: 10

Points: 108

Post Posted: Thu Mar 11, 2004 10:20 pm Reply with quote    Back to top    

As far as the routine is concerned there is no problem...The values are getting stored in the variables(@USER0,@USER1,@USER2) properly...how do I use the values in these variable IN MY JOB...ie how do I assign the value stored in the variable @USER0...coz as I said If I use @USER0 in the derivation in the Tranformer...it doesnt accept it

So can someone clarify as to how I use the variable in the job

Max
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 51954
Location: Las Vegas
Points: 282080

Post Posted: Fri Mar 12, 2004 12:14 am Reply with quote    Back to top    

Yes it does. Don't be concerned by the fact that the derivation remains red. All this means is that the system variables @USER0 through @USER4 are not listed in the DSParams file in the pro ...

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
currently hiring: Sydney and Melbourne
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 39162
Location: Denver, CO
Points: 199972

Post Posted: Fri Mar 12, 2004 7:28 am Reply with quote    Back to top    

Interesting. Up to this point, all I've ever done is use them to "pass" information between coordinated routines, so have yet to stumble across the issue of them staying red in the Transformer. Go ...

_________________
-craig

If you try and take a cat apart to see how it works, the first thing you have on your hands is a non-working cat. -- Douglas Adams
Rate this response:  
Not yet rated
maximus
Participant



Joined: 03 Mar 2004
Posts: 10

Points: 108

Post Posted: Sun Mar 14, 2004 11:12 pm Reply with quote    Back to top    

Thanx Ray...So far I have been thinking that if its Red then, it wont compile...thanx for the clarification

Regards
Max
Rate this response:  
Not yet rated
sivatallapaneni
Participant

Group memberships:
Heartland Usergroup

Joined: 05 Nov 2003
Posts: 53

Points: 533

Post Posted: Mon Mar 15, 2004 11:16 am Reply with quote    Back to top    

Thanx Ray, ur True GURU
I didnt know it works like that till now.

Have a good one.
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours