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 » newline character in esql...

Post new topic  Reply to topic Goto page 1, 2  Next
 newline character in esql... « View previous topic :: View next topic » 
Author Message
klabran
PostPosted: Wed Jan 19, 2005 12:56 pm    Post subject: newline character in esql... Reply with quote

Master

Joined: 19 Feb 2004
Posts: 259
Location: Flagstaff AZ

How do I add the newline character to a character variable in esql....

I am trying to format my output for an email.



Kevin


Last edited by klabran on Thu Jan 20, 2005 7:30 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Wed Jan 19, 2005 1:17 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You can convert a BLOB hex character return value to a character, and concatenate that.

Or you can concatenate a carriage return inside single quotes, literally
Code:
'
'

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
klabran
PostPosted: Wed Jan 19, 2005 1:22 pm    Post subject: Reply with quote

Master

Joined: 19 Feb 2004
Posts: 259
Location: Flagstaff AZ

Thanks!
Back to top
View user's profile Send private message Visit poster's website
kirani
PostPosted: Wed Jan 19, 2005 11:42 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

jefflowrey wrote:
Or you can concatenate a carriage return inside single quotes, literally

This is an undocumented feature, so I'd not use it I'd go with first option.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Thu Jan 20, 2005 5:02 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Is there any documentation that the ESQL parser might strip line endings from code?

Is there any doucmentation that the ESQL parser might in any way mangle string literals?

That is to say, it may be an undocumented feature, but there's no documentation to suggest it won't work either...

There is a bit of a problem with my second option, in that the return key will be in the character set of the Toolkit, which may not be the character set of the message being manipulated. This particularly could be a problem with email in the headers - although klabran is only talking about the body text.

So the first option is a lot more "safe", because it requires you to know what you want, rather than allowing the system to decide for you.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
alexey
PostPosted: Thu Jan 20, 2005 5:47 am    Post subject: Reply with quote

Acolyte

Joined: 18 Dec 2003
Posts: 62
Location: Israel

Quote:

You can convert a BLOB hex character return value to a character, and concatenate that.


Simple and works fine:

Code:

DECLARE CR CHAR CAST(CAST('X''0A''' AS BLOB) AS CHAR CCSID ...);
SET your_string = your_string||CR;


Alexey.
Back to top
View user's profile Send private message
klabran
PostPosted: Thu Jan 20, 2005 7:30 am    Post subject: Reply with quote

Master

Joined: 19 Feb 2004
Posts: 259
Location: Flagstaff AZ

Thanks everyone for your input....

I did try and it works fine...
Quote:
Or you can concatenate a carriage return inside single quotes, literally


However, it looks like the second option is better so I will adjust accordingly.

Kevin
Back to top
View user's profile Send private message Visit poster's website
kirani
PostPosted: Fri Jan 21, 2005 12:17 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

jefflowrey,

I never said that it will not work.

It's not documented anywhere, that's why I am afraid that IBM might remove this "feature" anytime.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Fri Jan 21, 2005 5:46 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

kirani wrote:
I never said that it will not work.


I know!

kirani wrote:
It's not documented anywhere, that's why I am afraid that IBM might remove this "feature" anytime.

It's true. But it's not documented that it WON'T work, either...
And I think that removing this feature would involve mangling string literals. And that would break LOTS of things besides this.

So personally I feel the risks are slight that it will be changed.

But using a converted BLOB literal is a little "cleaner" visually. I might tend even to assign it to a "constant" variable called "return" or somesuch.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
maxis
PostPosted: Tue Feb 01, 2005 5:33 am    Post subject: Reply with quote

Centurion

Joined: 25 Jun 2002
Posts: 144

am having pretty much the similar requirement, where NEW-LINE is required. Am using CWF, have defined a element - newLine with 2 char length. Am using this newLine element where ever there is a need for NEW-LINE (or carriage return however one would like to call ).

I tried both the options its not working .. any suggestion/tip would be appreciated ...

wmsi version : 2.1
CSD : 6

thanks
M
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Feb 01, 2005 11:43 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

What is your data type for CWF element?
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
maxis
PostPosted: Wed Feb 02, 2005 6:21 am    Post subject: Reply with quote

Centurion

Joined: 25 Jun 2002
Posts: 144

thanks for responding. Message type is fixed format .... and its working now (earlier I was using incorrect CCSID).


Is there any diff in the following ESQL declaration ? how about memory allocation ?

-------------
int A ;
integer B ;
------------

cheers
M
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Feb 03, 2005 11:56 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

No there is no difference.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
lerner
PostPosted: Mon Aug 13, 2012 4:03 am    Post subject: Reply with quote

Apprentice

Joined: 17 May 2012
Posts: 26

Hi all,

I want email body as
TEST MAIL
secondline

set OutputRoot.XMLNSC.EmailBody.lastname='TEST MAIL';
set OutputRoot.XMLNSC.EmailBody.firstname='second line';
SET OutputLocalEnvironment.Destination.Email.BodyContentType ='text/html';

SET OutputRoot.BLOB.BLOB = CAST(OutputRoot.XMLNSC.EmailBody.lastname||', ||OutputRoot.XMLNSC.EmailBody.firstname as BLOB CCSID InputRoot.Properties.CodedCharSetId encoding InputRoot.Properties.Encoding);

but i tried with the suggested symbol
Quote:
',

but it gave me error..please suggest me how to get new line in email body
Back to top
View user's profile Send private message
lerner
PostPosted: Mon Aug 13, 2012 4:10 am    Post subject: Reply with quote

Apprentice

Joined: 17 May 2012
Posts: 26

Thanks alexey...
got it by using below code

DECLARE CR CHAR CAST(CAST('X''0A''' AS BLOB) AS CHAR CCSID InputRoot.Properties.CodedCharSetId );
SET your_string = OutputRoot.XMLNSC.EmailBody.lastname||CR||OutputRoot.XMLNSC.EmailBody.firstname;
-- SET OutputLocalEnvironment.Destination.Email.BodyContentType = "text/html; charset=utf-8";
SET OutputRoot.BLOB.BLOB = CAST(your_string as BLOB CCSID InputRoot.Properties.CodedCharSetId encoding InputRoot.Properties.Encoding);
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 » newline character 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.