Edited Numeric item not getting initialized

2 posts / 0 new
Last post
Anonymous
Edited Numeric item not getting initialized

 

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
Anonymous
use inspect

hi,

  i am not sure of using initialize in that way, instead use inspect verb

thanks,

naveen

Log in or register to post comments
Sponsored Listing