In A cobol program , we can use COPY Statement in FILE-
SECTION / WORKING-STORAGE SECTION / ENVIRONMENT DIVIION
basically what is the difference

Answers were Sorted based on User's Feedback



In A cobol program , we can use COPY Statement in FILE- SECTION / WORKING-STORAGE SECTION / ENVIRON..

Answer / vikas pujar

At File and WS section we declare variables so copy is used
oftenly in projects , in ENV Division just declare files
ddname and logical file name in Input-output section, so
its not used here.

Copy Copybook1, if this is copybook name this can be used
only once tn program either in file section or ws section,
or else will get error that duplicate varaiable names used.

Copy used at File-Section or WS section behaves same way,
so dont think there is any diff in the way Copy behaves at
diff sections.

Is This Answer Correct ?    8 Yes 0 No

In A cobol program , we can use COPY Statement in FILE- SECTION / WORKING-STORAGE SECTION / ENVIRON..

Answer / suresh ramaiyan

There is no difference.

COPY statement just copy all the lines from the copybook
into the source code.

When we feel some piece of codes are used repeatly then we
can code it into the copylib.

So, it is in our hand where to use COPY.

Is This Answer Correct ?    3 Yes 0 No

In A cobol program , we can use COPY Statement in FILE- SECTION / WORKING-STORAGE SECTION / ENVIRON..

Answer / kanika

yes we can copy it any where basically it will copy the
line of code mentioned in another source program.

Is This Answer Correct ?    4 Yes 4 No

Post New Answer

More COBOL Interview Questions

what are the steps to sort in a cobol program?

2 Answers   Patni,


What is COMP-1? COMP-2?

4 Answers   CitiGroup,


01 x pic s9(8) comp. How will the following value be internally allocated '18787'

4 Answers   Steria,


how do u indetify files succesfully executed or not ?

4 Answers   TCS,


tell me about examine inspect and evaluate ?

2 Answers   CTS,






I have a source program compiled with Cobol-2. The output file has a record length of 100 defined in the program but a record of 60 bytes getting written into it. i.e. The rest of 40 bytes I am not Writing anything. But it by default puts some values into the last 40 bytes. However it does not impact anything. But when Compiled the module with Enterprise Cobol the last 40 bytes were spaces as fillers. Can anyone explain?

5 Answers   Cognizant,


What is the linkage section?

4 Answers  


1.Can we define condition-name conditions in FD entry.

11 Answers  


When the working storage variables get allocated? a.At Compile time b.At starting of the run time c.At end of the run time. d.None of these

6 Answers   Wipro,


what is the size of W-REC in the following 01 W-REC 05 A PIC 9(4)V99 05 B READLINES A 10 C PIC XX 10 D PIC S9(4) 05 E OCCURS 7 PIC ZZ.ZZ 05 F OCCURS 5 10 G PIC ZZ.ZZZ99 10 H OCCURS 3 15 J PIC 9(3) 15 K PIC V99

2 Answers   TCS,


If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will display only 3.(the next sentence, ie., after fullstop/period) ____________________________________ if a>b continue end-if display 1 display 2. display 3. If a>b, it Will display 1 2 3 (the next statement) ____________________________________ if a>b continue display 1 end-if display 2 display 3. display 4. If a>b, Will it display 2 3 4 (or) 1 2 3 4 ?

8 Answers   UST,


how to transfer the file from pc to mainframe??

2 Answers  


Categories