I declared one variable like this
01 WS-MESSAGE-TABLE.
05 PIC X(83) VALUE
'00 PROCESSING WAS SUCCESSFUL'.
05 PIC X(83) VALUE
'01 CRI-RATE-DATE NOT FOUND. MOST RECENT DATE AND RATE
- ' TO CONVERT THE AMOUNT'.
05 PIC X(83) VALUE
'02 FUNCTION IS "R" BUT CRI-AMOUNT <> 0. RATE WAS
- ' CRI-AMOUNT WAS SET TO 0.'.
shows error in this code.Can u plz resolve this issue
Reg variable declaration
Moderators: dbzTHEdinosauer, Moderator Group
Put your compile listing error here. Otherwise, the problem could be with the quotes you are using in the third variable. Within single quotes you are trying to have a alphabet "R" in the double quotes. I think it is not permitted that way.
HTH.
HTH.
Arr Bee
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)
-
- Member
- Posts: 1
- Joined: Mon Aug 28, 2006 5:48 pm
- Location: Trivandrum
Reg: variable declaration
I don't think the double quote inside the last literal will be a cause for
u r compile error. I have tried with double quote and it is working
fine.
What might be the cause iam thinking is that if you want continue a literal
in next line there should be '-' in the indent column(7th column) and you
must start the value of literal in area B(12th column) in the next line.
I will give you a sample code that has worked for me.
01 WK-WORKING-EXAMPLE.
05 PIC X(83) VALUE 'ABCD'.
05 PIC X(83) VALUE 'ABCD "12" ABCD1233333333333333333333333
- 'ACD'.
(this continuation should start at 12th column).
Hope this might be useful for you.
Could you please let me know if something else caused the compile error.
Regards,
vinod reddy.
u r compile error. I have tried with double quote and it is working
fine.
What might be the cause iam thinking is that if you want continue a literal
in next line there should be '-' in the indent column(7th column) and you
must start the value of literal in area B(12th column) in the next line.
I will give you a sample code that has worked for me.
01 WK-WORKING-EXAMPLE.
05 PIC X(83) VALUE 'ABCD'.
05 PIC X(83) VALUE 'ABCD "12" ABCD1233333333333333333333333
- 'ACD'.
(this continuation should start at 12th column).
Hope this might be useful for you.
Could you please let me know if something else caused the compile error.
Regards,
vinod reddy.
Hi, Try this code and let me know if this is what you are expecting !!
The output is shown as given below:
Code: Select all
IDENTIFICATION DIVISION.
PROGRAM-ID. QUOTE01.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-Q1 PIC X(20) VALUE "THIS ISN""T WRONG".
PROCEDURE DIVISION.
MAIN-PARA.
DISPLAY ' *** START *** '.
DISPLAY WS-Q1.
DISPLAY ' *** END *** '.
STOP RUN.
Code: Select all
*** START ***
THIS ISN"T WRONG
*** END ***
Arr Bee
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)
-------------
?My joy in learning is partly that it enables me to teach? - Seneca(Roman philosopher, mid-1st century AD)
-
- Member
- Posts: 6
- Joined: Thu Sep 14, 2006 10:41 am
HI,
you v emissed the continuation on some of the lines.. this one works perfectly..
01 WS-MESSAGE-TABLE.
05 PIC X(83) VALUE
- '00 PROCESSING WAS SUCCESSFUL'.
05 PIC X(83) VALUE
- '01 CRI-RATE-DATE NOT FOUND. MOST RECENT DATE AND RATE
- ' TO CONVERT THE AMOUNT'.
05 PIC X(83) VALUE
- '02 FUNCTION IS "R" BUT CRI-AMOUNT <> 0. RATE WAS
- ' CRI-AMOUNT WAS SET TO 0.'.
you v emissed the continuation on some of the lines.. this one works perfectly..
01 WS-MESSAGE-TABLE.
05 PIC X(83) VALUE
- '00 PROCESSING WAS SUCCESSFUL'.
05 PIC X(83) VALUE
- '01 CRI-RATE-DATE NOT FOUND. MOST RECENT DATE AND RATE
- ' TO CONVERT THE AMOUNT'.
05 PIC X(83) VALUE
- '02 FUNCTION IS "R" BUT CRI-AMOUNT <> 0. RATE WAS
- ' CRI-AMOUNT WAS SET TO 0.'.
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page