Page 1 of 1

Reg variable declaration

Posted: Fri Jul 21, 2006 1:38 pm
by Jelin
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

Posted: Sat Jul 22, 2006 12:23 pm
by arrbee
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.

Posted: Mon Jul 24, 2006 10:20 am
by Jelin
So how can i use a double quote within a single quote????

Posted: Mon Aug 28, 2006 5:52 pm
by preethiraj
Try with a pair of single quotes for each double quote

Reg: variable declaration

Posted: Fri Sep 01, 2006 1:42 pm
by 156138
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.

Posted: Thu Sep 07, 2006 10:36 am
by arrbee
Hi, Try this code and let me know if this is what you are expecting !!

Code: Select all

IDENTIFICATION DIVISION.                        
PROGRAM-ID. QUOTE01.                            
ENVIRONMENT DIVISION.                           
DATA DIVISION.                                  
WORKING-STORAGE SECTION.                        
01 WS-Q1  PIC  X&#40;20&#41; VALUE "THIS ISN""T WRONG". 
PROCEDURE DIVISION.                             
MAIN-PARA.                                      
    DISPLAY ' *** START *** '.                  
    DISPLAY WS-Q1.                              
    DISPLAY ' *** END *** '.                    
    STOP RUN.                                   
The output is shown as given below:

Code: Select all

  *** START ***    
 THIS ISN"T WRONG  
  *** END ***      

Posted: Thu Sep 14, 2006 2:22 pm
by gottabe.grenz
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.'.