Author |
Message
|
LH33 |
Posted: Wed Sep 03, 2003 11:42 am Post subject: BIP 2437 - Array Subscript Error |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
I have a flow that checks a tag for a value and if the value is present, then I need to set the 75th occurrence of a tag to null. I am getting a BIP 2437 when I do this. My input XML is:
<CreateJob environment="Test" revision="1.0.0">
<ApplicationArea>
<Sender>
<Component>OMS</Component>
<Confirmation>Always</Confirmation>
<AuthorizationId>OMS Interface</AuthorizationId>
</Sender>
<CreationDateTime>2003-08-28T10:40:03</CreationDateTime>
<BODId>{270F340A-6A8A-4572-A4EC-E7D7317F982C}</BODId>
</ApplicationArea>
<DataArea>
<Create confirm="Always"/>
<Job>
<ExternalNumbers>
<ExternalNumber index="1">OMS:500001</ExternalNumber>
</ExternalNumbers>
<ParentNumber/>
<Origin>OMS</Origin>
<AgencyCode>EOM</AgencyCode>
<TimeLine>
<CreationDateTime>2003-08-11T09:48:00</CreationDateTime>
<StartAfterDateTime>2003-08-11T09:50:03</StartAfterDateTime>
</TimeLine>
<UDFS>
<UDF index="5">4804</UDF>
<UDF index="6">30103200024</UDF>
<UDF index="7"/>
<UDF index="8">1</UDF>
<UDF index="9">OUT</UDF>
</UDFS>
<Filters>
<Filter index="1">JB</Filter>
<Filter index="2"/>
</Filters>
<Location>
<Address>
<Streets>
<Street index="1">
<Name>Testing Create Street</Name>
</Street>
</Streets>
<CityCode>-</CityCode>
</Address>
<Latitude>1.4099e+006</Latitude>
<Longitude>592746</Longitude>
<Customer>
<Name>Not Applicable</Name>
<Comment/>
<Address>
<FreeFormat/>
</Address>
</Customer>
<Phones>
<Phone index="1">
<Number/>
</Phone>
</Phones>
</Location>
<LevelCode5>3010320</LevelCode5>
<WorkCode/>
<WorkCodeUDFS>
<WorkCodeUDF index="2">7</WorkCodeUDF> <WorkCodeUDF index="3">SBKR</WorkCodeUDF>
<WorkCodeUDF index="4">Protective Device</WorkCodeUDF>
<WorkCodeUDF index="5">A</WorkCodeUDF>
<WorkCodeUDF index="6">A</WorkCodeUDF>
<WorkCodeUDF index="7">0100</WorkCodeUDF>
<WorkCodeUDF index="8"/>
<WorkCodeUDF index="9">15111</WorkCodeUDF>
<WorkCodeUDF index="10"/>
<WorkCodeUDF index="56">ACK</WorkCodeUDF>
<WorkCodeUDF index="57">4804</WorkCodeUDF>
<WorkCodeUDF index="58">30103200024</WorkCodeUDF>
<WorkCodeUDF index="59">1</WorkCodeUDF>
<WorkCodeUDF index="60">0</WorkCodeUDF>
<WorkCodeUDF index="61">0</WorkCodeUDF>
<WorkCodeUDF index="62">0</WorkCodeUDF>
<WorkCodeUDF index="63"/>
<WorkCodeUDF index="74"/>
<WorkCodeUDF index="75">2003-02-05T12:34:56</WorkCodeUDF>
<WorkCodeUDF index="83">R 2418 W FRANKLIN ST</WorkCodeUDF>
<WorkCodeUDF index="84">1</WorkCodeUDF>
<WorkCodeUDF index="85">3500</WorkCodeUDF>
<WorkCodeUDF index="86">517860</WorkCodeUDF>
<WorkCodeUDF index="87">90</WorkCodeUDF>
<WorkCodeUDF index="88">62</WorkCodeUDF>
<WorkCodeUDF index="64">Not Applicable</WorkCodeUDF>
</WorkCodeUDFS>
</Job>
</DataArea>
</CreateJob>
My code is as follows:
DECLARE CONDSTATUS CHAR;
SET CONDSTATUS = THE ( SELECT ITEM R FROM InputRoot.XML.CreateJob.DataArea.Job.WorkCodeUDFS.WorkCodeUDF[] as R where
R.(XML.Attribute)index = '2');
SET OutputRoot.XML.CreateJob.DataArea.Job.testind2 = CONDSTATUS;
IF (CONDSTATUS = 7) THEN
SET OutputRoot.XML.CreateJob.DataArea.Job.WorkCodeUDFS.WorkCodeUDF[75] = NULL;
SET OutputRoot.XML.CreateJob.DataArea.Job.WorkCodeUDFS.WorkCodeUDF[75].(XML.Attribute) index = 75;
END IF;
The contents of my Trace node off the Catch terminal is:
Root
(
(0x1000000)Properties = (
(0x3000000)MessageSet = ''
(0x3000000)MessageType = ''
(0x3000000)MessageFormat = ''
(0x3000000)Encoding = 546
(0x3000000)CodedCharSetId = 437
(0x3000000)Transactional = TRUE
(0x3000000)Persistence = TRUE
(0x3000000)CreationTime = GMTTIMESTAMP '2003-09-03 19:26:06.120'
(0x3000000)ExpirationTime = -1
(0x3000000)Priority = 0
(0x3000000)ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x3000000)ReplyProtocol = 'MQ'
(0x3000000)Topic = NULL
)
(0x1000000)MQMD = (
(0x3000000)SourceQueue = 'DSPCH_OMS_DATA'
(0x3000000)Transactional = TRUE
(0x3000000)Encoding = 546
(0x3000000)CodedCharSetId = 437
(0x3000000)Format = 'MQSTR '
(0x3000000)Version = 2
(0x3000000)Report = 0
(0x3000000)MsgType = 8
(0x3000000)Expiry = -1
(0x3000000)Feedback = 0
(0x3000000)Priority = 0
(0x3000000)Persistence = 1
(0x3000000)MsgId = X'414d51204745544d51312020202020201369533f1240ef02'
(0x3000000)CorrelId = X'000000000000000000000000000000000000000000000000'
(0x3000000)BackoutCount = 0
(0x3000000)ReplyToQ = ' '
(0x3000000)ReplyToQMgr = 'GETMQ1 '
(0x3000000)UserIdentifier = 'MTSRUN_MQ '
(0x3000000)AccountingToken = X'1601051500000008691451fa547e13c811bf7b421f000000000000000000000b'
(0x3000000)ApplIdentityData = ' '
(0x3000000)PutApplType = 11
(0x3000000)PutApplName = ':\WINNT\System32\dllhost.exe'
(0x3000000)PutDate = DATE '2003-09-03'
(0x3000000)PutTime = GMTTIME '19:26:06.120'
(0x3000000)ApplOriginData = ' '
(0x3000000)GroupId = X'000000000000000000000000000000000000000000000000'
(0x3000000)MsgSeqNumber = 1
(0x3000000)Offset = 0
(0x3000000)MsgFlags = 0
(0x3000000)OriginalLength = -1
)
(0x1000010)XML = (
(0x1000000)CreateJob = (
(0x3000000)environment = 'Test'
(0x3000000)revision = '1.0.0'
(0x1000000)ApplicationArea = (
(0x1000000)Sender = (
(0x1000000)Component = (
(0x2000000) = 'OMS'
)
(0x1000000)Confirmation = (
(0x2000000) = 'Always'
)
(0x1000000)AuthorizationId = (
(0x2000000) = 'OMS Interface'
)
)
(0x1000000)CreationDateTime = (
(0x2000000) = '2003-08-28T10:40:03'
)
(0x1000000)BODId = (
(0x2000000) = '{270F340A-6A8A-4572-A4EC-E7D7317F982C}'
)
)
(0x1000000)DataArea = (
(0x1000000)Create = (
(0x3000000)confirm = 'Always'
)
(0x1000000)Job = (
(0x1000000)ExternalNumbers = (
(0x1000000)ExternalNumber = (
(0x3000000)index = '1'
(0x2000000) = 'OMS:500001'
)
)
(0x1000000)ParentNumber =
(0x1000000)Origin = (
(0x2000000) = 'OMS'
)
(0x1000000)AgencyCode = (
(0x2000000) = 'EOM'
)
(0x1000000)TimeLine = (
(0x1000000)CreationDateTime = (
(0x2000000) = '2003-08-11T09:48:00'
)
(0x1000000)StartAfterDateTime = (
(0x2000000) = '2003-08-11T09:50:03'
)
)
(0x1000000)UDFS = (
(0x1000000)UDF = (
(0x3000000)index = '5'
(0x2000000) = '4804'
)
(0x1000000)UDF = (
(0x3000000)index = '6'
(0x2000000) = '30103200024'
)
(0x1000000)UDF = (
(0x3000000)index = '7'
)
(0x1000000)UDF = (
(0x3000000)index = '8'
(0x2000000) = '1'
)
(0x1000000)UDF = (
(0x3000000)index = '9'
(0x2000000) = 'OUT'
)
)
(0x1000000)Filters = (
(0x1000000)Filter = (
(0x3000000)index = '1'
(0x2000000) = 'JB'
)
(0x1000000)Filter = (
(0x3000000)index = '2'
)
)
(0x1000000)Location = (
(0x1000000)Address = (
(0x1000000)Streets = (
(0x1000000)Street = (
(0x3000000)index = '1'
(0x1000000)Name = (
(0x2000000) = 'Testing Create Street'
)
)
)
(0x1000000)CityCode = (
(0x2000000) = '-'
)
)
(0x1000000)Latitude = (
(0x2000000) = '1.4099e+006'
)
(0x1000000)Longitude = (
(0x2000000) = '592746'
)
(0x1000000)Customer = (
(0x1000000)Name = (
(0x2000000) = 'Not Applicable'
)
(0x1000000)Comment =
(0x1000000)Address = (
(0x1000000)FreeFormat =
)
)
(0x1000000)Phones = (
(0x1000000)Phone = (
(0x3000000)index = '1'
(0x1000000)Number =
)
)
)
(0x1000000)LevelCode5 = (
(0x2000000) = '3010320'
)
(0x1000000)WorkCode =
(0x1000000)WorkCodeUDFS = (
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '2'
(0x2000000) = '7'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '3'
(0x2000000) = 'SBKR'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '4'
(0x2000000) = 'Protective Device'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '5'
(0x2000000) = 'A'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '6'
(0x2000000) = 'A'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '7'
(0x2000000) = '0100'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '8'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '9'
(0x2000000) = '15111'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '10'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '56'
(0x2000000) = 'ACK'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '57'
(0x2000000) = '4804'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '58'
(0x2000000) = '30103200024'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '59'
(0x2000000) = '1'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '60'
(0x2000000) = '0'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '61'
(0x2000000) = '0'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '62'
(0x2000000) = '0'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '63'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '74'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '75'
(0x2000000) = '2003-02-05T12:34:56'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '83'
(0x2000000) = 'R 2418 W FRANKLIN ST'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '84'
(0x2000000) = '1'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '85'
(0x2000000) = '3500'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '86'
(0x2000000) = '517860'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '87'
(0x2000000) = '90'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '88'
(0x2000000) = '62'
)
(0x1000000)WorkCodeUDF = (
(0x3000000)index = '64'
(0x2000000) = 'Not Applicable'
)
)
)
)
)
(0x6000002) = '
'
)
)
ExceptionList
(
(0x1000000)RecoverableException = (
(0x3000000)File = 'F:\build\S210_P\src\DataFlowEngine\ImbComputeNode.cpp'
(0x3000000)Line = 453
(0x3000000)Function = 'ImbComputeNode::evaluate'
(0x3000000)Type = 'ComIbmComputeNode'
(0x3000000)Name = '88c1bc79-f500-0000-0080-83480914a757'
(0x3000000)Label = 'OMSTOMDS.TransformCreate'
(0x3000000)Text = 'Caught exception and rethrowing'
(0x3000000)Catalog = 'WMQIv210'
(0x3000000)Severity = 3
(0x3000000)Number = 2230
(0x1000000)RecoverableException = (
(0x3000000)File = 'F:\build\S210_P\src\DataFlowEngine\ImbRdl\ImbRdlFieldRef.cpp'
(0x3000000)Line = 642
(0x3000000)Function = 'PathElement::navigateCursorFirst'
(0x3000000)Type = ''
(0x3000000)Name = ''
(0x3000000)Label = ''
(0x3000000)Text = 'array subscript error'
(0x3000000)Catalog = 'WMQIv210'
(0x3000000)Severity = 3
(0x3000000)Number = 2437
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '493'
)
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '58'
)
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '26'
)
(0x1000000)Insert = (
(0x3000000)Type = 5
(0x3000000)Text = 'WorkCodeUDF'
)
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '75'
)
)
)
)
DestinationList
LocalEnvironment
Any suggestions on what I can do to correct this error?
Thanks, Lisa |
|
Back to top |
|
 |
Craig B |
Posted: Wed Sep 03, 2003 12:21 pm Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
In your ESQL you have used the following :
Code: |
SET OutputRoot.XML.CreateJob.DataArea.Job.WorkCodeUDFS.WorkCodeUDF[75] = NULL;
|
This will attempt to find the 75th child called WorkCodeUDF of the parent WorkCodeUDFS. Your message does not have 75 children of this name. What you are actually want to do is to set the instance of WorkCodeUDF that has a child of type XML.Attribute called index, which has a value of 75. This will involve navigating to this particular field looking at its children and seeing if the child exists with this value. I dont think you will be able to use a SELECT to do this because you actually want to change the value of the field in an existing message tree. I can give you some sample ESQL using dynamic references and the MOVE statement that will do the job if you want it. _________________ Regards
Craig |
|
Back to top |
|
 |
LH33 |
Posted: Wed Sep 03, 2003 12:23 pm Post subject: |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
Yes, please post the code samples for me to apply your suggestion!!
Thanks!! |
|
Back to top |
|
 |
Craig B |
Posted: Wed Sep 03, 2003 12:50 pm Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
Here is one way of doing it :
Code: |
DECLARE searchRef REFERENCE TO OutputRoot.XML.CreateJob.DataArea.Job.WorkCodeUDFS.WorkCodeUDF[1];
DECLARE fieldFound BOOLEAN FALSE;
WHILE LASTMOVE(searchRef) AND (fieldFound = FALSE) DO
IF searchRef.index = '75' THEN
SET searchRef = NULL;
SET fieldFound = TRUE;
ELSE
MOVE searchRef NEXTSIBLING NAME 'WorkCodeUDF';
END IF;
END WHILE;
|
This will find the occurence of the field WorkCodeUDF that has a child field of the name index that has a value of '75'. If it finds this then it will set this instance of WorkCodeUDF to NULL. This will delete the field. If you actually want to set it to the value NULL, then you need to use SET searchRef VALUE = NULL;
Hope this helps. _________________ Regards
Craig |
|
Back to top |
|
 |
LH33 |
Posted: Wed Sep 03, 2003 2:00 pm Post subject: |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
I am getting a syntax error on the bolded item (MOVE searchRef NEXTSIBLING NAME 'WorkCodeUDF') Is there a different value I should be using? Her is the code I have currently:
DECLARE searchRef REFERENCE TO OutputRoot.XML.CreateJob.DataArea.Job.WorkCodeUDFS.WorkCodeUDF[1];
DECLARE fieldFound BOOLEAN;
SET fieldFound = 'FALSE';
WHILE LASTMOVE(searchRef) AND (fieldFound = FALSE) DO
IF searchRef.index = '75' THEN
SET searchRef = NULL;
SET fieldFound = TRUE;
ELSE
MOVE searchRef NEXTSIBLING NAME 'WorkCodeUDF';
END IF;
END WHILE;
Also, I had to DECLARE fieldFound and then set it to BOOLEAN.
Thaks, Lisa |
|
Back to top |
|
 |
Craig B |
Posted: Wed Sep 03, 2003 2:18 pm Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
Hi,
Sounds like you are on WMQI V2.1 CSD02, and the DECLARE with initialisation capability and MOVE with NAME option were introduced in CSD03. if in your input message the WorkCodeUDF fields are always siblings then you dont need the NAME 'WorkCodeUDF' on the end. So you can just code MOVE searchRef NEXTSIBLING. For the DECLARE you have already spotted that you can go back to doing the DECLARE and SET separately.
Let me know if there are any other problems. _________________ Regards
Craig |
|
Back to top |
|
 |
LH33 |
Posted: Wed Sep 03, 2003 2:24 pm Post subject: |
|
|
Master
Joined: 21 Nov 2002 Posts: 200
|
Thanks for all of your help! Taking out the NAME works great!! |
|
Back to top |
|
 |
|