IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to link with db2 and cobol, What is plan & cursor


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
johnsingh

New User


Joined: 11 May 2005
Posts: 22

PostPosted: Mon Sep 05, 2005 4:04 pm
Reply with quote

hi,

1> How to link with db2 and cobol and what is utility to link between them.
2> What is plan.

3> what is cursor.

Thanking in advance.
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Mon Sep 05, 2005 4:57 pm
Reply with quote

HI,


Quote:
what is cursor

DB2 has a mechanism called a cursor to allow an application program to
retrieve a set of rows. You can use a cursor to retrieve rows from a table
or from a result set returned by a stored procedure.

You can retrieve and process a set of rows that satisfy the search conditions of an SQL statement. However, when you use a program to select the rows, the program cannot process all the rows at once. The program must process the rows one at a time.

For more information refer manual for DB2

Regards
Rupesh
Back to top
View user's profile Send private message
Anbudan

New User


Joined: 07 Sep 2005
Posts: 26
Location: Germany

PostPosted: Wed Sep 07, 2005 3:30 pm
Reply with quote

2> What is plan.

Hi

Plan is used for DB2 Pgms.

You have to create Package and plan for a DB2 pgm.



Anbudan
Back to top
View user's profile Send private message
johnsingh

New User


Joined: 11 May 2005
Posts: 22

PostPosted: Fri Sep 09, 2005 12:34 pm
Reply with quote

hi all,

Thanks of valuable time.
Back to top
View user's profile Send private message
anadhamohan

New User


Joined: 27 Sep 2005
Posts: 25
Location: india

PostPosted: Thu Sep 29, 2005 9:46 am
Reply with quote

hi john,
The utility used to join cobol & db2 is IKJEFT01, you have to use this in JCL segment in the exec statment to make this work, also there is other utility called DSNHPC which is also used to join cobol-db2.





Impossible is often Untried
Back to top
View user's profile Send private message
karthi_ind

Active User


Joined: 24 Feb 2004
Posts: 131
Location: Chennai

PostPosted: Thu Sep 29, 2005 11:09 am
Reply with quote

Hi,

Cursor is used to retrieve more that one rows. The steps involved in cursor is

1) Declare cursor
2) Open cursor - Which activates Cursor
3) Fetch cursor - Retrieves rows frm Table
4) Close cursor

Once commit is issued , cursor vll be closed. To avoid this thre is an option in cursor, WITH HOLD option.

If you want to update particular columns in a table, u can specify it
in the cursor by using FOR UPDATE OF option.

Suppose if u want to update or delete a particular row in a cursor u can use use WHERE CURRENT OF cursor name OPTION .

In a COBOL-DB2 program if u are not using cursor for retrieving more than one row. instead ur usng Select u will get -811 SQLCODE.
which means Select retrieves more than one rows.

Corrections are welcome....


Karthi G.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top