can I copy book which contain db2 statment in procedure
divion?

Answers were Sorted based on User's Feedback



can I copy book which contain db2 statment in procedure divion?..

Answer / vikas pujar

No. Because the Precompiler will comment out all the SQL statements and replace them with equvi call statements. And if use DB2 statment in Copy ,during pre compilation the statements in the copybook wont be commented out.. they will get expanded during compliation of modified source code and we will get Complilation error there.

Is This Answer Correct ?    9 Yes 0 No

can I copy book which contain db2 statment in procedure divion?..

Answer / siddhesh

You can if you are using an integrated COBOL compiler. In
an intergrated COBOL compiler the DB2 precompiler, CICS
translator and the COBOL compiler work together. You can
CICS and/or DB2 statements in a copybook.

If you are using a standalone compiler, you cannot include
SQL statements in COPY.

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More COBOL Interview Questions

I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

0 Answers  


describe 805 error

6 Answers   DELL,


We are using the searching a table which is indexed, once the key is found, how can we get the occurance at which the key was found.

1 Answers  


IF there 5 to 6 files in a JCL and there is some space abends, how can we identify which file has space abend and what can be done to get off that abend or rectify that abend.

2 Answers   ADNA, CSC,


How will you find the currepted records in a file

2 Answers  






given the following: 77 A PIC 9V9 VALUE 9.5 77 B PIC 9 VALUE 9. 77 C PIC V9 VALUE 0.8 77 D PIC 9 77 E PIC 9 77 F PIC 9V999 what are the contenta of D E nad F after the following statements are executed: COMPUTE F ROUNDED=A+C/B MULTIPLY A BY C GIVING E ADD B C A GIVING D ROUNDED a.F=9.589 E=8 D=1 b.F=9.589 E=8 D=9 c.F=9.589 E=7 D=9 d.F=9.589 E=7 D=1

5 Answers   Broadridge, TCS,


How is sign stored in a COMP field ?

3 Answers   Accenture,


How to define variable 9(20) in COBOL, because compiler does not allow us to declare variables with Pic 9(18). Can anyone please let me know the answer... I know one answer to this question which is to use Compiler option Arith (Extend) during Compilation. It extends the maximum limit to 9(32)..Just wanted to know if there is any other way to extend this?

4 Answers   CSC, TCS,


have in 100 records in a flat file i want to move records like 1,3,5,7,9,11,.. to Output file1 and 2,4,6,8,10,12,14 .. records moved to Output file2..Pls Provide real time answer..

5 Answers   TCS,


What rules are to be followed while using the corresponding options?

0 Answers  


What is SET TO TRUE all about, anyway?

5 Answers  


i Want All cobol ERROR codes?

4 Answers   HCL, IBM,


Categories