RAMESH KRISHNA REDDY mainframe discussion forum - cobol, db2,cics,jcl,file-aid,changeman,interview questions
Online Tutorials   | PREV  | TOP  | NEXT



DRONA SERIES
COBOL STUDY MATERIAL


INITIALIZE

Author : Vasanta T.



   
 

COPY




INITIALIZE The INITIALIZE statement sets selected categories of data fields to predetermined values; it is functionally equivalent to one or more MOVE statements. INITIALIZE perform no action on FILLER areas and also OCCURS DEPENDING ON clause untouched. INITIALIZE Moves spaces to alphabetic, alphanumeric, and alphanumeric-edited items and zeros to numeric items. 01 WS-RECORD. 05 WS-NUMBER PIC 9(09). 05 WS-NAME PIC X(10). 05 WS-LOB PIC X(03). INITIALIZE WS-RECORD. This Moves zeros to WS-NUMBER and Spaces to WS-NAME and WS-LOB. INITIALIZE REPLACING: To move data with a specific constants instead of Zeros and spaces. Example Program : INITIALIZE WS-RECORD REPLACING NUMERIC DATA BY 3 ALPHANUMERIC DATA BY X. This above statement Moves 3 TO WS-NUMBER AND X is being moved to WS-NAME and WS-LOB.
    

NEXT CHAPTER TOPIC : COBOL


                                   



Previous chapter in COBOL tutorial Starting of COBOL tutorial Next chapter in COBOL tutorial


Visit COBOL books section in this site for good books




Home | Donations | Online Tutorials | Books | Entertainment | Contactme | privacy |  sql tutorial | jcl interview questions | JCL Tutorial | JCL Tutorial - chapter1 | JCL Tutorial - chapter2 | JCL Tutorial - chapter3 | JCL Tutorial - chapter4 | JCL Tutorial - chapter5 | JCL Tutorial - chapter6 | JCL Tutorial - chapter7 | JCL Tutorial - chapter8 | JCL Tutorial - chapter9 | JCL Tutorial - chapter10 | JCL Tutorial - chapter11