Sample Cobol Program With Copybook
Sony Ericsson Mw600 Stereo Bluetooth Headset Driver on this page. Scalable Cobol Copybook Data Processing Using. We will use the parser in a Cascading application to read sample data and. If you ran the program in. About the COBOL sample. The COBOL program was designed to use the value of the level 5. When the COBOL copybook 'CustomerAddress' is used to.
COBOL layout is the description of use of each field and the values present in it. Following are the data description entries used in COBOL − • Redefines Clause • Renames Clause • Usage Clause • Copybooks Redefines Clause Redefines clause is used to define a storage with different data description. If one or more data items are not used simultaneously, then the same storage can be utilized for another data item. So the same storage can be referred with different data items. Syntax Following is the syntax for Redefines clause − 01 WS-OLD PIC X(10). 01 WS-NEW1 REDEFINES WS-OLD PIC 9(8). 01 WS-NEW2 REDEFINES WS-OLD PIC A(10).
Following are the details of the used parameters − • WS-OLD is Redefined Item • WS-NEW1 and WS-NEW2 are Redefining Item Level numbers of redefined item and redefining item must be the same and it cannot be 66 or 88 level number. Do not use VALUE clause with a redefining item. In File Section, do not use a redefines clause with 01 level number. Redefines definition must be the next data description you want to redefine. A redefining item will always have the same value as a redefined item. Example IDENTIFICATION DIVISION.
DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-DESCRIPTION. 05 WS-DATE1 VALUE '20140831'. 10 WS-YEAR PIC X(4). 10 WS-MONTH PIC X(2). 10 WS-DATE PIC X(2).
05 WS-DATE2 REDEFINES WS-DATE1 PIC 9(8). PROCEDURE DIVISION. DISPLAY 'WS-DATE1: 'WS-DATE1. DISPLAY 'WS-DATE2: 'WS-DATE2. JCL to execute the above COBOL program − //SAMPLE JOB(TESTJCL,XXXXXX),CLASS = A,MSGCLASS = C //STEP1 EXEC PGM = HELLO When you compile and execute the above program it produces the following result − WS-DATE1: 20140831 WS-DATE2: 20140831 Renames Clause Renames clause is used to give different names to existing data items.