banner



How To Set Environment Variable In Websphere Mq

Author Message
Sridar

Acolyte

Joined: xiv May 2006
Posts: 72
Location: Chennai, India


Hi

I am trying to reduce the 4 Procedure calls to i past trying to send all the variables in a single call and then get each variable one by one in the Procedure and executing it(procedure).

Since there is no Assortment datatype(WBI V5.0) i am trying to prepare these values to Surroundings variables using a LIST and pass the Environmnet Variables to the Procedure.

Tin anyone help me in how to exercise this exactly or is in that location any other way of doing this.

Here is the piece of lawmaking i take washed.
****
In the Main flow

DECLARE Mandatory CHARACTER;

CREATE FIELD Environment.Variables.Mandatory[];

DECLARE MANDATORY REFERENCE TO Environment.Variables.Mandatory;

SET Environment.Variables.Mandatory[] = LIST{a,b,c,d};

Telephone call com.tgt.esb.imn.common.Check_Mandatory_Fields
(Environment.Variables.Mandatory);

*****
*****
In common period where Procedure resides

CREATE Procedure Check_Mandatory_Fields(IN MANDATORY Graphic symbol)
Begin

DECLARE FIELD_NAME CHARACTER '';
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(MANDATORY.*[]);

WHILE I <= J Exercise
SET FIELD_NAME = MANDATORY[I];

--- STATEMENTS TO Be EXECUTED---

ELSE
SET I = I + 1;

Stop IF;

**************
I am getting Mistake in this argument:
Ready FIELD_NAME = FIELD[I];

Can anyone Assistance? Distressing for such a long mail.

Cheers
Sridar[/list]
_________________
Thanks and Regards
Sridar

Back to top
elvis_gn

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai


Hullo Sridar,
Code:
Call com.tgt.esb.imn.common.Check_Mandatory_Fields
(Surroundings.Variables.Mandatory);

Sending a list
Lawmaking:
CREATE Process Check_Mandatory_Fields(IN MANDATORY Character)

Defining in a Character...i.e storing in a character
Code:
Gear up FIELD_NAME = MANDATORY[I];

Trying to use a listing when u defined it as a graphic symbol....

Balance you should figure out....are u not using the debugger....y'all sould have been able to check this there.

Regards.[/code]

Back to top
mgk

Padawan

Joined: 31 Jul 2003
Posts: 1600
Location: IBM Hursley, Britain


Hullo,

What is the error, you don't say?

Also, your code is wrong in places. Is this the actual code you lot are using, or did yous but retype it here? If you retypes it, then delight post the actual code (or as virtually as yous can), as information technology makes understanding your problem much harder.

For example, you declare a reference called MANDATORY then exercise not employ it in the code you posted. I assume you lot ment to laissez passer it equally the parameter to your procedure?

e.thou. CALL com.tgt.esb.imn.common.Check_Mandatory_Fields
(MANDATORY);

If so, so your procedure prototype is wrong. It should exist:

CREATE PROCEDURE Check_Mandatory_Fields(IN MANDATORY REFERENCE)

Also you say

Quote:
am getting Error in this statement: SET FIELD_NAME = FIELD[I];

But this statement does non appear in the lawmaking y'all posted. Again, please make sure your code makes sense in terms of the question you lot are asking. I assume you mean when MANDATORY when you ment FIELD in this case, and if and then and so as I showed in a higher place, MANDATORY needs to be a REFERENCE parameter to the procedure.

Regards,
_________________
MGK
IBM Client Success Manager
The postings I make on this site are my own and don't necessarily stand for IBM's positions, strategies or opinions.

Dorsum to top
Sridar

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India


Hi elvis and mgk

Thanks for your response.

elvis:Trying to use a list when u divers it as a grapheme....

I am non clear on which variable you lot are referring to and how?

mgk: I have given the actual code here. I am getting Syntax error in the below statement

Set FIELD_NAME = MANDATORY[I];

Really i tried to pass a reference to the process but was in doubt whether it would work then i tried passing the actual values.

I do not mind how i pass it, simply i demand to retrieve the variables ane by i in the procedure.

As you had mentioned that the code is wrong in some places are in that location whatever other faults(like syntax errors) or only those that you had mentioned.

Any mode tin you lot please help me. Is at that place any other manner of doing this.

*******
Primary Flow

DECLARE Mandatory Grapheme;

CREATE FIELD Surround.Variables.Mandatory[];

--DECLARE MANDATORY REFERENCE TO Surroundings.Variables.Mandatory;

Prepare Surroundings.Variables.Mandatory[] = LIST{a,b,c,d};

CALL com.tgt.esb.imn.common.Check_Mandatory_Fields
(Environment.Variables.Mandatory);
********
******
Procedure

CREATE Procedure Check_Mandatory_Fields(IN MANDATORY CHARACTER)
BEGIN

DECLARE FIELD_NAME Graphic symbol '';
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(MANDATORY.*[]);

WHILE I <= J DO
SET FIELD_NAME = MANDATORY[I];

--- STATEMENTS TO Be EXECUTED---

ELSE
SET I = I + one;

Finish IF;

Thank you in Advance
Sridar
_________________
Thank you and Regards
Sridar

Back to height
mgk

Padawan

Joined: 31 Jul 2003
Posts: 1600
Location: IBM Hursley, UK


To brand this piece of work, you lot MUST pass a reference to the procedure similar I suggested higher up. You are getting an error considering you are dereferencing a Character string. You can only do this to a Field Reference or a Reference Variable. You should wait upwardly Field References in the docs, and look up how the bulletin tree works.

Regards,
_________________
MGK
IBM Customer Success Managing director
The postings I brand on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.

Back to top
Sridar

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, Republic of india


Thank you mgk

I created a reference and passed it to the process,
just i notwithstanding take problem in the value assigning argument.
I am getting Syntax Fault.

SET FIELD_NAME = MANDATORY[I]; where MANDATORY is the Reference to Environment.Variables.Mandatory where i have stored all the values and I is the increment variable.

I have declared FIELD_NAME as character

Is my Syntax correct or...

Thanks in Accelerate
Sridar
_________________
Thanks and Regards
Sridar

Dorsum to summit
jefflowrey

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981


MANDATORY[I] will the be the I'th sibling named MANDATORY.

You want the I'th child of MANDATORY. So use MANDATORY.[I] instead.

But alter the proper name of this to something other than MANDANTORY.

It's a horrible proper name for a variable.
_________________
I am *not* the model of the modern major general.

Terminal edited past jefflowrey on Thu May 18, 2006 6:22 am; edited i fourth dimension in full

Back to top
mgk

Padawan

Joined: 31 Jul 2003
Posts: 1600
Location: IBM Hursley, UK


And some other thing, once you take renamed mandatory to something nice as jeff suggests, you could effort posting the Actual error bulletin when yous get an error. Only posting
Quote:
I am getting Syntax Error.

Does not help as at that place are lots of possible syntax errors.

As well you lot said:

Quote:
Is my Syntax correct or...

Equally yous got likewise say you got a syntax fault, then the answer is clearly no, your syntax is not correct.
_________________
MGK
IBM Customer Success Manager
The postings I make on this site are my own and don't necessarily represent IBM'southward positions, strategies or opinions.

Back to top
Sridar

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India


Hi

Thanks for all your assist.
I was really trying to practice a null bank check for mandatory fields and that's the reason for the proper name of the variable.
Neways have inverse it.
jefflowrey: Afterwards following your idea in that location was no fault. The exact error i got was 'Syntax Error' merely.

Merely still i had trouble in assigning the value as Nil value was getting assigned eventhough the value of the node is not aught.

Subsequently i changed my logic slightly.
I used FIELDVALUE office to get the value and everything is now working fine.
Below is the code i did.

CREATE PROCEDURE Check_Mandatory(IN FIELD_REF REFERENCE)
Begin
WHILE LASTMOVE(FIELD_REF)=TRUE
Do
IF FIELDVALUE(FIELD_REF) IS Nil THEN
THROW EXCEPTION MESSAGE 3010 VALUES ('MANDATORY FIELD MISSING IN THE BUSEVENT Message:',FIELD_REF);
END IF;
MOVE FIELD_REF NEXTSIBLING;
Cease WHILE;
END;[/code]
_________________
Cheers and Regards
Sridar

Dorsum to pinnacle

Display posts from previous: ��

How To Set Environment Variable In Websphere Mq,

Source: http://www.mqseries.net/phpBB/viewtopic.php?t=29554

Posted by: lordmatur1940.blogspot.com

0 Response to "How To Set Environment Variable In Websphere Mq"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel