Author |
Message
|
kishoreraju |
Posted: Tue May 31, 2005 11:22 am Post subject: Problem with <CR><LF> in esql. |
|
|
Disciple
Joined: 30 Sep 2004 Posts: 156
|
Hi
My scenario is
I have a JText adapter at the source side, which picks a message from a file and places it in a queue. From that the message flow will process that message and writes it on to a destination queue. Again from the destination queue Jtext adapter will pick that message writes it on to a target directory.
In the ESQL I have to split the File content into different lines (Every 80 characters into a line). To do this iam adding cartridge return and line fed
The below is the code that i am using to add <CR><LF>
DECLARE CRSTR CHAR;
DECLARE LFSTR CHAR;
SET CRSTR = CAST(x'0D' AS CHAR CCSID InputRoot.MQMD.CodedCharSetId) ;
SET LFSTR = CAST(x'0A' AS CHAR CCSID InputRoot.MQMD.CodedCharSetId) ;
DECLARE CRLF CHAR;
SET CRLF=CRSTR||LFSTR;
I am concatenating the CRLF attribute to the File content when ever I need a new line.
Thanks in advance |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 31, 2005 11:32 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You are using WBIMB and JText to line-wrap a file?
What is your question? Is this not working? How do you know? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kishoreraju |
Posted: Tue May 31, 2005 12:29 pm Post subject: |
|
|
Disciple
Joined: 30 Sep 2004 Posts: 156
|
Yes i am using wimp and Jtext to line-wrap a file.
But the code iam using is not working. Because in the target file i am getting entire message in a single line. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 31, 2005 1:08 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
kishoreraju wrote: |
Yes i am using wimp and Jtext to line-wrap a file. |
And do you slice tomatos with a chain saw?
kishoreraju wrote: |
But the code iam using is not working. Because in the target file i am getting entire message in a single line. |
Can you use amqsbcg to dump the contents of your output message (before it goes to JText again) and see if your CRLF's are in there properly? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
dipankar |
Posted: Tue May 31, 2005 6:49 pm Post subject: |
|
|
Disciple
Joined: 03 Feb 2005 Posts: 171
|
Instead of this
Code: |
SET CRSTR = CAST(x'0D' AS CHAR CCSID InputRoot.MQMD.CodedCharSetId) ;
SET LFSTR = CAST(x'0A' AS CHAR CCSID InputRoot.MQMD.CodedCharSetId) ; |
you use the following code
Code: |
DECLARE CR CHAR CAST(CAST(X'0A' AS BLOB) AS CHAR CCSID InputRoot.MQMD.CodedCharSetId );
DECLARE LF CHAR CAST(CAST(X'0D' AS BLOB) AS CHAR CCSID InputRoot.MQMD.CodedCharSetId );
SET CRLF=LF ||CR; |
I believe it will work.
Let me know whether your problem is solved or not. |
|
Back to top |
|
 |
kishoreraju |
Posted: Wed Jun 01, 2005 5:29 am Post subject: |
|
|
Disciple
Joined: 30 Sep 2004 Posts: 156
|
Thanks for u r reply
I tried with the code that u have given.
i am getting the same output(whole message in a single line) after adding the code that u have given. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 01, 2005 5:32 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
kishoreraju wrote: |
Thanks for u r reply
I tried with the code that u have given.
i am getting the same output(whole message in a single line) after adding the code that u have given. |
I would concentrate first on getting the message correct, and then concentrate of setting jText to write the file properly.
So change the output queue of your flow to some test queue, and use the amqsbcg utility (included as a sample program with MQ) to dump the contents of the message. Then adjust your code until that output indicates the right hex values in the right place.
Of course, rather than writing ESQL to do this, you could also create two TDS models - one that has a repeating set of an 80 character field with no delimiters and one that has a <CR><LF> delimiter, and then just map between the two models. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kishoreraju |
Posted: Wed Jun 01, 2005 7:42 am Post subject: |
|
|
Disciple
Joined: 30 Sep 2004 Posts: 156
|
I tried with the message sets as u told even it is not working.
By using the below code i am able to get line feed but i am not able to get the cartridge return when iam writing in the destination side using jtext adapter.
SET CRSTR = CAST(x'0D' AS CHAR CCSID InputRoot.MQMD.CodedCharSetId) ;
SET LFSTR = CAST(x'0A' AS CHAR CCSID InputRoot.MQMD.CodedCharSetId) ; |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 01, 2005 8:00 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Again, please CONFIRM that the CR and the LF are in the message you SEND to the JText adapter. One way to do this is to inspect the message using amqsbcg.
Then you will know if the problem is with your ESQL, or with the JText adapter! _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kishoreraju |
Posted: Wed Jun 01, 2005 10:05 am Post subject: |
|
|
Disciple
Joined: 30 Sep 2004 Posts: 156
|
The below is the input message given as an input to JText adapter.
sampledata
sampledata
sampledata
xxxxxxxxxx
when we are using OutputRoot=InputRoot in the ESQL iam getting the following message in the requset queue of JText Adapter(Target queue)
RFH ? ¸MQSTR ¸ X<mcd><Msd>mrm</Msd><Set>OMA0TIO002001</Set><Type>JTextSrc</Type><Fmt>CwXML</Fmt></mcd> T<jms><Dst>queue:///EAI.FUEL.JTEXTDEL</Dst><Tms>1117648173811</Tms><Dlv>2</Dlv></jms> ´<usr><WSDLBinding>JTextSrcAgentDeliveryBinding</WSDLBinding><WSDLOperation>JTextSrcCreate</WSDLOperation><PrivacyLevel>None</PrivacyLevel><MessageType>JTextSrc</MessageType></usr> <?xml version="1.0" encoding="UTF-8"?>
<JTextSrc:JTextSrc xmlns:JTextSrc="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/JTextSrc" xmlns:FUEL_Bo_Wrap="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/FUEL_Bo_Wrap" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/JTextSrc file:JTextSrc.xsd" version="3.0.0" verb="Create" locale="en_US" delta="false">
<JTextSrc:FileContent>sampledata sampledata sampledata xxxxxxxxxx </JTextSrc:FileContent>
<JTextSrc:ChildBO>
<FUEL_Bo_Wrap:FUEL_Bo_Wrap version="3.0.0" verb="Create" locale="en_US" delta="false">
<FUEL_Bo_Wrap:InFileName>C:\temp\event\New Text.in</FUEL_Bo_Wrap:InFileName>
</FUEL_Bo_Wrap:FUEL_Bo_Wrap>
</JTextSrc:ChildBO>
<JTextSrc:ObjectEventId>FUEL_JTextConnector_1117648173764_1</JTextSrc:ObjectEventId>
</JTextSrc:JTextSrc>
In the above Message represents <CR><LF>.when the adapter writing the above message onto the target directory we are getting both CR and LF.
When I tried to C0nstruct the same message in the ESQL iam getting the following in the requset queue of JText Adapter(Target queue)
RFH ? ¸MQSTR ¸ X<mcd><Msd>mrm</Msd><Set>OMA0TIO002001</Set><Type>JTextSrc</Type><Fmt>CwXML</Fmt></mcd> T<jms><Dst>queue:///EAI.FUEL.JTEXTDEL</Dst><Tms>1117648093091</Tms><Dlv>2</Dlv></jms> ´<usr><WSDLBinding>JTextSrcAgentDeliveryBinding</WSDLBinding><WSDLOperation>JTextSrcCreate</WSDLOperation><PrivacyLevel>None</PrivacyLevel><MessageType>JTextSrc</MessageType></usr> <?xml version="1.0"?><NS1:JTextSrc xmlns:NS1="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/JTextSrc" xmlns:NS2="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/FUEL_Bo_Wrap" xmlns:NS3="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/MO_DataHandler_Default" xmlns:NS4="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/MO_DataHandler_FUELHandlerConfig" xmlns:NS5="http://www.ibm.com/websphere/crossworlds/2002/BOSchema/MO_FUEL_JTextConnector_Default" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><NS1:FileContent>sampledata
sampledata
sampledata
xxxxxxxxxx
</NS1:FileContent></NS1:JTextSrc>
In the Above message i did't find anything related to CR and LF. but when the adapter writing the above message onto the target directory we are getting line feed(LF).
Iam reading these messages by using RFHUTIL. i am getting the same when iam using amqsbcg. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 01, 2005 10:10 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Change your code to insert ' ' instead of X'OA' and X'OD' then. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kishoreraju |
Posted: Wed Jun 01, 2005 10:56 am Post subject: |
|
|
Disciple
Joined: 30 Sep 2004 Posts: 156
|
We already tried that one it is not working. it is taking it as a string.
Does MQ do any parsing when we are putting the message into queue.
We can set encoding style of the XML in the ESQL when we are pasing the message in XML domain.Can we do the same for XML wire format message in MRM domain?
if we can do that where we have set that properties in the message set ?
Thanks in Advance |
|
Back to top |
|
 |
vennela |
Posted: Wed Jun 01, 2005 12:47 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Quote: |
Does MQ do any parsing when we are putting the message into queue. |
NO |
|
Back to top |
|
 |
fschofer |
Posted: Thu Jun 02, 2005 1:59 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi,
on which platform do you work (windows , unix , mixed),
which CCSIDs are your using.
Maybe there is a problem with conversion unix<=>dos (LF <=> CRLF)
Can you post your message as hex + text ?
Greetings
Frank |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jun 02, 2005 3:09 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I really think that this is a configuration with the JText adapter. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|