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 » adding newline in ESQL

Post new topic  Reply to topic
 adding newline in ESQL « View previous topic :: View next topic » 
Author Message
cute_pav
PostPosted: Sat Jul 27, 2002 8:11 am    Post subject: adding newline in ESQL Reply with quote

Acolyte

Joined: 04 Jan 2002
Posts: 65
Location: usa

Can any one help me to find a way to add new lines in string using ESQL?
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Nyusser
PostPosted: Sun Jul 28, 2002 9:15 pm    Post subject: Reply with quote

Apprentice

Joined: 02 Jul 2002
Posts: 48

The easiest way to declare a new line character in ESQL:

DECLARE nl CHAR;

nl = CAST(x'<code>' AS CHAR CCSID <characterset>)

In the above <code> is the code of the new line character in your system, for example 0d0a in DOS or 0a in most of the unix. <characterset> is the coded character set id of your system.

For example, in my NT system:

nl = CAST(x'0d0a' AS CHAR CCSID 437)


!!!The CCSID part is essential or otherwise WMQI will convert the code x'0d0a' to a string 0d0a instead of string <CR><LF>.
Back to top
View user's profile Send private message
ernest-ter.kuile
PostPosted: Mon Aug 05, 2002 4:08 am    Post subject: Reply with quote

Apprentice

Joined: 13 May 2002
Posts: 49
Location: KLM Holland

Nyusser wrote:
DECLARE nl CHAR;
nl = CAST(x'<code>' AS CHAR CCSID <characterset>)

In the above <code> is the code of the new line character in your system, for example 0d0a in DOS or 0a in most of the unix. <characterset> is the coded character set id of your system.


As a side note <characterset> can also be extracted from the incomming message header :

InputRoot.MQMD.CodedCharSetId

so, for example :

SET nl = CAST(x'0A' AS CHAR CCSID InputRoot.MQMD.CodedCharSetId)

gives you a line feed on z/OS as wel as NT.

This way you never need to change anything if the flow is send to an other environment.


And for the really freakish, in ESQL you can also add a LF to a string this way :

SET mystr = 'Hello World' || '
';

read carefully and enjoy !

ps: I wouldn't use this last part in production code, it's a bug^H^H^HFeature.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » adding newline 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.