How to display single quote in cobol
cobol
Solution
Quote escaping works in COBOL as it does in many other languages. Try:
`DISPLAY 'COMPANY''S POLICY'`
Two apostrophes in a row indicate a single literal apostrophe character. Or:
`DISPLAY "COMPANY'S POLICY"`
Use quotation marks as the outer string delimiter which allows you to use unescaped apostrophes within the literal
Within DFHMDF (strictly speaking this isn't COBOL), you are restricted to using the apostrophe as the literal delimiter. Here you need to resort to using two apostrophes in a row.
DFHMDF POS=(1,23),LENGTH=30, X
INITIAL='company''s policy', X
ATTRB=PROT
Problem
I want to display these words using display statement Company's Policy But if i use so, it is considering the words as variables. I've tried using ``` DISPLAY "COMPANY'S POLICY" DISPLAY 'COMPANY\'S POLICY' ``` But none worked. How escape this single quote? sample code: ``` DFHMDF POS=(1,23),LENGTH=30, INITIAL="company's policy" ATTRB=PROT ```