Tuesday, December 6, 2011

COBOL: INITIALIZE Vs FILLER

The INITIALIZE verb can initialize only the fields defined and NOT FILLERs.

Assume the following situation,            
                                                                  
        INITIALIZE Identifier-1                                   
                                                                  
where Identifier-1 has the following structure.

04  Identifier-1                                                
   08  RPT-EMP-NAME             PIC X(33) value 'JOHN JOHN'.    
   08  RPT-EMP-NO               PIC X(04) value '5577'.        
   08  FILLER                   PIC X(27) value 'I AM A FILLER'.


Assume Identifier-1 has got the values shown before executing the INITIALIZE statement. After the execution of INITIALIZE statement, variables RPT-EMP-NAME & RPT-EMP-NO  will be initialized to SPACES. But the FILLER will retain the value 'I AM A FILLER'. 

Hence we conclude that the INITIALIZE verb cannot initialize FILLERs.  

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.