Clicky
Skip to Content
Custom Search

Reply to comment

Anonymous

 

I have defined a group variable in a COBOL program as
follows
 
01 GROUP-VAR.
   05 VAR1 PIC X(10).
   05 VAR2 PIC 9(2).
   05 VAR3 PIC 99.99.
   
Now I moves the following values to VAR1, VAR2 and VAR3 respectively.
  
ABCD                    
22                      
23.45                   
 

After this move I am initializing the group variable GROUP-VAR by the following statement
 
INITIALIZE GROUP-VAR REPLACING NUMERIC BY ZEROS 
ALPHANUMERIC BY SPACES.                        
 
But when I display the values of variables VAR1,VAR2 and VAR3 after initialize. I find that
it works for VAR1 and VAR2 as intended but VAR3 which is edited numeric remains un initialized.
 
Value of VAR3 after initialization
 
23.45                   
 
What could be the reason for such behavior?
 
Thanks
Arun

Reply

  • Allowed HTML tags:
      1. Lines and paragraphs break automatically.

    More information about formatting options

    CAPTCHA
    This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Navigation

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer



Number of Registered users 714
Theme by Dr. Radut.