Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

EScape character in Cobol

518 views
Skip to first unread message

Harshad Karekar

unread,
Feb 22, 2008, 11:24:08 AM2/22/08
to
Hi Guys,

This is just for my information .So if u can help it wud be fine.

I m trying to find out if ther is an escape character in Cobol so that
I can print the line with quotation marks
For Example: I want to display the following line

"My Name is Harshad" with the quotes

I hve tried using the following

DISPLAY ""My name is Harshad"".

but this has returned me obvious errors.

Thanx in advance ...


Bye


Doug Cowie

unread,
Feb 22, 2008, 12:30:49 PM2/22/08
to
Try 3 quotes. DISPLAY """My name is Marshad"""

mas...@sbcglobal.net

unread,
Feb 22, 2008, 1:29:30 PM2/22/08
to
display quote My name is Harshad quote

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDem

Doug Miller

unread,
Feb 22, 2008, 5:43:22 PM2/22/08
to
In article <e824120c-0978-4986...@p43g2000hsc.googlegroups.com>, Harshad Karekar <harsh...@gmail.com> wrote:
>Hi Guys,
>
>This is just for my information .So if u can help it wud be fine.

Please don't write in IM-Speak.
"you".
"would".

Thank you.


>
>I m trying to find out if ther is an escape character in Cobol so that
>I can print the line with quotation marks
>For Example: I want to display the following line
>
>"My Name is Harshad" with the quotes
>
>I hve tried using the following
>
>DISPLAY ""My name is Harshad"".
>
>but this has returned me obvious errors.

This is *very* clearly documented in *any* Cobol manual.

"Quotation marks in balanced pairs enclose nonnumeric literals. ... Within a
simple nonnumeric literal, two consecutive quotation marks represent one
quotation mark." [Tandem Cobol85 Manual, Ch. 3 "Language Elements", "Quotation
Marks" section]

Thus, you need "" for each of the quotation marks you want to appear inside
the literal, and also " at each end of the literal -- like so:
"""R T F M"""

--
Regards,
Doug Miller (alphageek at milmac dot com)

It's time to throw all their damned tea in the harbor again.

mas...@sbcglobal.net

unread,
Feb 23, 2008, 8:29:57 AM2/23/08
to

On 22-Feb-2008, mas...@sbcglobal.net wrote:

> display quote My name is Harshad quote

Sorry. Meant


display quote "My name is Harshad" quote

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service

------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access

0 new messages