Login Next
© 2012 Mainframestechhelp.com
Mainframes Tech Help
Help for all Mainframe technical needs
Its our planet.. Go Green
For any Queries/Suggestions/Issues, Send a mail to Support@mainframestechhelp.com
DB2 Tutorial Conti...
How the data retrieved in the COBOL program: o DB2 is an external system and can’t able to update from the program. o The can’t able to retrieve the directly by the SQL and can’t able to use it directly. o There is a requirement to use intermediate fields to capture the data and then only it is ready to use in the program. o There is one more limitation for the working storage fields are, the declaration should match with the corresponding table column cobol declaration. o These variables are called as HOST VARIABLES. o Equivalent data types in COBOL & DB2 COBOL DB2          S9(8)COMP ------ INTEGER          S9(4)COMP ------ SMALLINT             X(n) ------ NUM(n) S9(m)V9(n)COMP-3 ------ DECIMAL(m,n)             X(n) ------ CHAR(n)             X(n)+2 ------ VARCHAR(n)             X(8) ------ TIME             X(10) ------ DATE             X(26) ------ TIMESTAMP o DCLGEN is used to create the Host variables layout. DCLGEN : o DCLGENis the tool which is used to generate the COBOL copybook for the specific table. o The columns names of the table will be remain same but the underscores are replaced by Hyphens. o That copybook can be used in the program by using INCLUDE command like below. EXEC SQL INCLUDE table-copybook END-EXEC. o If the INCLUDE is used to add the copybook to the program, the copybook will be expanded during the pre- compilation process. So the INCLUDE needs to be used for the table copybooks too hence those also required to be expanded during the pre-compilation process. How the programs get the execution status of SQL? o SQLCA is called as a SQL communication Area. o SQLCA will have all the information like return code, error id, error details etc,. after the DB2 query execution.
If any questions on the above, post your queries on DB2 Discussion forum
Previous Next Home Forums Tutorials Interview questions Tools About Us Contact us Login