we can code COPY DCLGEN or INCLUDE DCLGEN,
At which stage of the precompilation , dclgen get expanded
if we write 1) copy
2) include
one question about dclgen..
Is it mandatory to use declare table in dclgen..
I think no...but
it will be used by the precompiler to validate the table
name,column name etc..,
can one clear my doubt ..is it necessary to include
declare table or not?
Answers were Sorted based on User's Feedback
Answer / rama krishna reddy
During the precompilation time only copybooks mentioned
with INCLUDE are expanded all copy books mentioned with
COPY are expanded during compilation time
we have to specify all the dclgens and host variable
declartions using INCLUDE statement because those are
required during precompilation period.
Declare statement is not mandatory in the DCLGEN.it can be
used to validate the sql statements in the program i.e it
checks the table name and columns names and it gives the
corresponding warning messages.
Is This Answer Correct ? | 13 Yes | 1 No |
Answer / prashanth
The copy books are expanded only in the compilation phase
of the application execution. But we would need the details
from DCLGEN in the pre-compilation phase, wherein the DB2
statements in the COBOL application is separated and put in
a DBRM. The equivalent COBOL ‘CALL’ statements are replaced
for the DB2 statements in the COBOL code. Then the
compilation of the COBOL and binding of the DBRM is done,
before being linked and executed.
Hence the INCLUDE statement is used instead of COPY
statement, an adaptation for the pre-compilation stage. The
same reason applies to the usage of INCLUDE in case of
SQLCA inclusion.
Is This Answer Correct ? | 11 Yes | 3 No |
how to copy the host variables from ps file into cobol program other than include statement
In a Cobol-DB2 program, I am fetching rows from 4 tables using cursor and then based on the a field present in that table, It processes the information accordingly..for example stat-c is one digit field..if stat-c is 'D' then the a row is deleted from table and written those details in to a file. If the stat-c is 'U' then a row is updated (hardcoded what to update)in a table and written those details in to a file. If the stat-c is 'I' then a row is inserted in a table and written those details in to two files. The issue is i have to include the intermediate commits. When an abend occurs, due to commit statement db2 tables will be saved, But there will be lose of file contents. When we resubmitting the job associated with this program there will be insert ,update and delete anomolies to avoid that what measures could be taken?. The intermediate commit is nothing but issuing commit after massive inserts, updates and deletes(sum of 500actions)
What is a buffer in memory?
Is the primary key a clustered index?
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.
What are the various data types available in db2?
What is the function of the Data Manager?
What is the syntax for FETCH in DB2 ?
Can you tell me how can you find out the # of rows updated after an update statement?
what is datacom db?
What are foreign keys?
What are host variables in db2?