what do you mean by copybook? and what is the difference
between the copybook which we are using in working storage
and procedure division.

Answers were Sorted based on User's Feedback



what do you mean by copybook? and what is the difference between the copybook which we are using i..

Answer / michealraj. g

There are two types of copybooks: 1. Working storage
copybook 2. Procedure division copybook

1. Working Storage copybook: It contains the input or
output fields names with the field definitions like type or
length of the fields. Instead of defining so many variables
in the WS section, we can have it in a separate file like
thing. It is also useful in mapping the I/P or O/P records
with the specific fields.

2. Procedure Division copybook: It contains set of COBOL
statements in order to execute it at a particular time. It
acts as a sub-program.

Is This Answer Correct ?    21 Yes 1 No

what do you mean by copybook? and what is the difference between the copybook which we are using i..

Answer / jeena.mj

A common piece of {source code} designed to be copied into
many source programs, used mainly in mainframe programming.

working storage copybooks contains only records which we
are using in more then one program.

procedure division copybooks contains cobol logic
statements.

mostly we use working storage copybooks.

Is This Answer Correct ?    13 Yes 0 No

what do you mean by copybook? and what is the difference between the copybook which we are using i..

Answer / shan

Copy books are nothing but COBOL code which can be used in
multiple programs are written in a separate member.

By using COPY <COPY BOOK NAME> statement(COPY is a compiler
directive command), The piece of code in the copy book will
get expanded during compilation.

Mostly copy books are used to define file structures, any
variables structures,which can be defined in multiple
programs, also for some common paragraphs(Ex: Abend
paragraphs). This does not mean this is the only usage.

Even file section, for select clause also we can write a
copy books.

Any part of your COBOL program can be written into to a
separate copy book and using copy command it can be
expanded. There is no classification as working storage copy
book or procedure division copy book, If any one stands by
this classification, please let me know any books or
materials you have referred, i will also get updated.

Is This Answer Correct ?    11 Yes 2 No

Post New Answer

More COBOL Interview Questions

how would find total records in files using seqientional

1 Answers   HSBC,


How to recover a deleted source physical file from library?

1 Answers   HCL,


hi dudes.....can any one help me..... what is SET TO TRUE all about,anyway?

1 Answers  


if you code move high-values to variable,can you move it into numeric variable or alphanumeric variable?

1 Answers   Patni,


i want to store 20 digits . h will u do it in cobol ?

4 Answers   TCS,






what is record label is empty or standard in file description of data division?

2 Answers   HCL,


The below is the declaration for a variable ws 01 ws pic 9(3). if you want to insert space how will you do that. in which level u should do it

3 Answers   ADP,


IDENTIFICATION DIVISION. PROGRAM-ID. UPDT. AUTHOR.anbu. DATE-WRITTEN. AUG 13. ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT CMSTR ASSIGN TO CINP1 ORGANIZATION IS INDEXED ACCESS IS SEQUENTIAL RECORD KEY CM2-KEY FILE STATUS IS WS-CMSTR-FST. SELECT CTAB ASSIGN TO CINP2 ORGANIZATION IS ACCESS IS SEQUENTIAL RECORD KEY VSAM-WHSE- KEY FILE STATUS IS WS-CTAB- FST. DATA DIVISION. FILE SECTION. FD CMSTR. COPY RXCYFC20. FD CTAB. COPY AITYWHSE. ************************************************************ ****** *** WORKING STORAGE VARIABLES *** ************************************************************ ****** WORKING-STORAGE SECTION. 01 WS- VARIABLES. 05 WS-EB PIC X(02) VALUE ZEROES. 05 WS-DIV PIC 9(03) VALUE ZEROES. 05 WS-CMF-RECS-REWRITTEN PIC 9(01) VALUE ZERO. *** FILE STATUS VARIABLES *** 05 WS- FILESTATUS. 10 WS-CMSTR-FST PIC 9(02) VALUE ZEROES. 10 WS-CTAB-FST PIC 9(02) VALUE ZEROES. *** END OF FILE VARIABLES *** 05 WS-CMSTR-EOF PIC X(01) VALUE 'N'. 88 WS-CMSTR-EOF-YES VALUE 'Y'. 88 WS-CMSTR-EOF-NO VALUE 'N'. 05 WS-CTAB-EOF PIC X(01) VALUE 'N'. 88 WS-CTAB-EOF-YES VALUE 'Y'. 88 WS-CTAB-EOF-NO VALUE 'N'. **** ERROR VARIABLES **** 05 WC-ABEND-900 PIC 9(03) VALUE 900. 05 WE-ERR-CODE PIC 9(02) VALUE ZEROES. 05 WE-ABEND-CODE PIC 9(03) VALUE ZEROES. ************************************************************ **** ********* PROCEDURE DIVISON ********** ************************************************************ **** PROCEDURE DIVISION. 0000- BEGIN. PERFORM 1000-INITIALISE THRU 1000- EXIT. PERFORM 2000-PROCESS THRU 2000- EXIT UNTIL WS-CMSTR-EOF- YES. DISPLAY 'WS-CMF-RECS-REWRITTEN :' WS-CMF-RECS- REWRITTEN. PERFORM 5000-CLOSE THRU 5000- EXIT. GOBACK. 0000- EXIT. EXIT. 1000- INITIALISE. OPEN I-O CMSTR. EVALUATE WS-CMSTR- FST WHEN 00 WHEN 97 CONTINUE WHEN OTHER DISPLAY 'ERROR IN READING INPUT FILE: ' DISPLAY WS-CMSTR-FST MOVE WS-CMSTR-FST TO WE-ERR-CODE PERFORM 9999-ABEND-PARA THRU 9999-EXIT END-EVALUATE. OPEN INPUT CTAB. EVALUATE WS-CTAB-FST WHEN 00 WHEN 97 CONTINUE WHEN OTHER DISPLAY 'ERROR IN READING INPUT FILE: ' DISPLAY WS-CTAB-FST MOVE WS-CTAB-FST TO WE-ERR-CODE PERFORM 9999-ABEND-PARA THRU 9999-EXIT END-EVALUATE. 1000-EXIT. EXIT. 2000-PROCESS. READ CMSTR. EVALUATE WS-CMSTR-FST WHEN 00 CONTINUE WHEN 10 SET WS-CMSTR-EOF-YES TO TRUE GO TO 2000-EXIT WHEN OTHER DISPLAY 'ERROR IN READING INPUT FILE: ' DISPLAY WS-CMSTR-FST MOVE WS-CMSTR-FST TO WE-ERR-CODE PERFORM 9999-ABEND-PARA THRU 9999-EXIT END-EVALUATE IF CM2-RECORD-TYPE-SOLD-TO MOVE CM2-ENTERING-BRANCH TO WS-EB PERFORM 3000-READ THRU 3000-EXIT UNTIL WS-CTAB-EOF-YES END-IF. 2000-EXIT. EXIT. 3000-READ. MOVE WS-EB TO VSAM-WHSE-CD. MOVE 'WHSE' TO VSAM-WHSE-ID. READ CTAB. EVALUATE WS-CTAB-FST WHEN 00 MOVE WHSE-DIV-CODE TO WS-DIV PERFORM 4000-REWRITE-CMF THRU 4000-EXIT WHEN 10 SET WS-CTAB-EOF-YES TO TRUE GO TO 3000-EXIT WHEN OTHER DISPLAY 'ERROR IN READING TABLE FILE: ' DISPLAY WS-CTAB-FST MOVE WS-CTAB-FST TO WE-ERR-CODE PERFORM 9999-ABEND-PARA THRU 9999-EXIT END- EVALUATE. 3000- EXIT. EXIT. 4000-REWRITE- CMF. IF WS-DIV = 250 OR 252 MOVE 'F' TO CM2-FREIGHT- TYPE MOVE 1 TO CM2-FREIGHT-THRESHOLD- AMT ADD +1 TO WS-CMF-RECS- REWRITTEN REWRITE CM2-SOLD-TO- RECORD DISPLAY 'RECORD UPDATED' END- IF. * EVALUATE WS-CMSTR- FST * WHEN 00 * CONTINUE * WHEN OTHER * DISPLAY 'FILE NOT UPDATED' * DISPLAY WS-CMSTR- FST * MOVE WS-CMSTR-FST TO WE-ERR-CODE * PERFORM 9999-ABEND-PARA THRU 9999-EXIT * GO TO 4000-EXIT * END-EVALUATE. 4000-EXIT. EXIT. 5000-CLOSE. CLOSE CMSTR CTAB. 5000-EXIT. EXIT. 9999-ABEND-PARA. COMPUTE WE-ABEND-CODE = WC-ABEND-900 + WE-ERR-CODE CALL 'ILBOABN0' USING WE-ABEND-CODE GO TO 5000-CLOSE. 9999-EXIT. EXIT. 5000-CLOSE. CLOSE CMSTR CTAB. 5000-EXIT. EXIT. 9999-ABEND-PARA. COMPUTE WE-ABEND-CODE = WC-ABEND-900 + WE-ERR-CODE CALL 'ILBOABN0' USING WE-ABEND-CODE GO TO 5000-CLOSE. 9999-EXIT. EXIT. //this program is giving maxcc=0, but not updating..

0 Answers  


why occurs clause not mentioned in 01 level

6 Answers   HCL, NIIT, TCS, Tesco,


suppose there is one PF having two members PF1 PF2.PF has one unique key Emp ID.could you tell me uniqueness in PF will be effective across members as well ? assume emp iD 3333 is in member PF1 would same Emp id be exist also in member PF2 ?

2 Answers   Tesco HSC, Wipro,


What are decleratives in COBOL ?

1 Answers   Xansa,


77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value zeros. move a to b what is the answers for both cases? IS it possible? Give me elementary move rules briefly......

8 Answers  


Categories