I'm trying to work out how to write out tab delimited character output under MQSI v2.0.2
Tried a number of tests using BLOB with X'10' but cant work out how to combine them with printable characters.
Looking at other threads here it looks like TREEASIS may allow this - will this help ?
I dont have TREEASIS support pack installed yet....
You can define a tab-delimited structure in MRM using
NULL-terminated strings. Then you map your onto this MRM
message in a compute node and transform it into a BLOB
using another (you can't do it all in one compute node)
compute node, like this:
SET OutputRoot.Properties.MessageDomain = 'BLOB';
SET OutputRoot."BLOB"."BLOB" = BITSTREAM(InputBody);
-- convert NULLS to TABS
DECLARE delimiter BLOB;
DECLARE pos INTEGER;
SET delimiter = X'10'; -- whatever delimiter you like
SET pos = POSITION(OutputRoot."BLOB"."BLOB",X'00');
WHILE (pos > 0) DO
SET OutputRoot."BLOB"."BLOB" = OVERLAY(OutputRoot."BLOB"."BLOB" PLACING delimiter FROM pos FOR 1);
SET pos = POSITION(OutputRoot."BLOB"."BLOB",X'00');
END WHILE;
_________________ Mathias Puetz
IBM/Central WebSphere Services
WebSphere Business Integration Specialist
Posted: Wed May 22, 2002 1:56 am Post subject: thanks for the suggestion....
Apprentice
Joined: 01 May 2002 Posts: 31
but i'm not sure this would work in my case as my tab delimted output is totally dependant on the incoming XML message structure and a set of ESQL transformations which would make constructing an MRM defination of the outgoing tab delimeted message impossible.
however i did manage to get solve this using TREEASIS - see folowing code snipet :
SET c_TAB = X'10';
-- incoming message tag count
SET v_Card = CARDINALITY(InputRoot.XML.ZOO.Value[]);
SET J = 1;
SET K = 1;
WHILE J <= v_Card DO
SET OutputRoot.TREEASIS.Value[K] = InputRoot.XML.ZOO.Value[J];
SET K = K + 1;
SET OutputRoot.TREEASIS.Value[K] = c_TAB;
SET K = K + 1;
SET J = J + 1;
END WHILE;
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