How many minimum number of line codes does PL/1 DB2 program
requires?



How many minimum number of line codes does PL/1 DB2 program requires?..

Answer / Preetam Banarji

The minimum number of line codes required for a PL/1 DB2 program depends on the specific requirements of your program. However, a basic structure would include opening and closing the DB2 environment, declaring variables, executing SQL statements, and handling exceptions. Here is an example with some minimal content:

```PL/1
PROGRAM-ID PROG01;
DECLARE VARIABLES;
DCL-DB DB2-DB-DBNAME PARM('your_db_name') TYPE DB;
DCL-CN DB2-CONNECTION PARM(DB) TYPE DB-CONN;
DCL-STMT DB2-SQL-STATEMENT PARM(DB) TYPE DB-STMT;

EXEC SQL SET SQLDA = DB2_SQL_DATA_AREA;
EXEC SQL OPEN DB-CURSOR FOR STATEMENT 'SELECT * FROM YOUR_TABLE';

DO WHILE SQLCODE = 0;
EXEC SQL FETCH DB-CURSOR INTO :VAR1,:VAR2,:VAR3,...;
... (process the fetched data)
ENDDO;

EXEC SQL CLOSE DB-CURSOR;
EXEC SQL COMMIT WORK;
EXEC SQL DISCONNECT FROM DB-CONNECTION;
ENDPROGRAM

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More IBM MainFrame AllOther Interview Questions

whose product is x-peditor ?

1 Answers  


What are some uses of the evaluate statement?

1 Answers  


Explain lock contention?

1 Answers  


Where is the vsam ksds placed?

1 Answers  


What is the mainframe testing? Categorize the mainframe manual testing?

1 Answers  


Tell me abt any another framework which is challening for Ibm framework

1 Answers   IBM,


If a gdg contains 20 versions .. how to copy those versions ps?

2 Answers   IBM,


what are the common errors that occured while programming in AS/400?

1 Answers  


Mainframe project required Postby mache123 » Thu Jan 29, 2009 9:10 pm hello..... I want to know about some real time projects.If any one have any Mainframes project, please provide me documentation of it Or else give me the link where can I find that Mainframes projects with Documentation...... or suggest me any if......please

1 Answers   IBM,


HOW to change the coloumns in XREF?

1 Answers  


What is the function of iebgener?

1 Answers  


which one of the following cannot cause more than one execution of paragraph that may be nam in statement. A) simple perform B) perform with time C) perform until D) perform varying

3 Answers   Accenture,


Categories