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
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 |
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 |
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 |
What will happen if we generate GDG (+2) version without generating (+1) version?
Can we dynamically increase the size of occurs clause? i.e In case I an not sure of the size of array and want to increase the size at run time.If yes , how?
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
What is the difference beetween Arrays and Tables in Cobol? please dont give the answer that arrays in cobol terminology is called tables......
How can you get the ksds file records into your cobol program?
Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks
What is difference between comp & comp-4?
Hi , I am posting some questons which are asked at interview. These may help u for ur interview... what is static and dynamic call?
How many bytes S(8) comp field occupy and its maximum value?
How do u sort the table for Search ALL? Is it only using ASCENDING KEY IS statement in occurs clause? If the data is input in non ascending order, will the ASC KEY IS automatically sort the data? or will it throw compile time error?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
hi is there any means of deletin a record from a ps usin cobol not using jcl?eg if i am reading a record and if some condition is matched tat particular record must be deletd fom the ps