ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem with <CR><LF> in esql.

Post new topic  Reply to topic Goto page 1, 2  Next
 Problem with <CR><LF> in esql. « View previous topic :: View next topic » 
Author Message
kishoreraju
PostPosted: Tue May 31, 2005 11:22 am    Post subject: Problem with <CR><LF> in esql. Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue May 31, 2005 11:32 am    Post subject: Reply with quote

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
View user's profile Send private message
kishoreraju
PostPosted: Tue May 31, 2005 12:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue May 31, 2005 1:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
dipankar
PostPosted: Tue May 31, 2005 6:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
kishoreraju
PostPosted: Wed Jun 01, 2005 5:29 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Jun 01, 2005 5:32 am    Post subject: Reply with quote

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
View user's profile Send private message
kishoreraju
PostPosted: Wed Jun 01, 2005 7:42 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Jun 01, 2005 8:00 am    Post subject: Reply with quote

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
View user's profile Send private message
kishoreraju
PostPosted: Wed Jun 01, 2005 10:05 am    Post subject: Reply with quote

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&#13;&#10;sampledata&#13;&#10;sampledata&#13;&#10;xxxxxxxxxx&#13;&#10;</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 &#13;&#10; 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
View user's profile Send private message
jefflowrey
PostPosted: Wed Jun 01, 2005 10:10 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Change your code to insert '&#13;&#10;' instead of X'OA' and X'OD' then.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kishoreraju
PostPosted: Wed Jun 01, 2005 10:56 am    Post subject: Reply with quote

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
View user's profile Send private message
vennela
PostPosted: Wed Jun 01, 2005 12:47 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
fschofer
PostPosted: Thu Jun 02, 2005 1:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Thu Jun 02, 2005 3:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Problem with <CR><LF> in esql.
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.