Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How to link with db2 and cobol, What is plan & cursor
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: 464

PostPosted: Mon Sep 05, 2005 4:57 pm    Post subject: Re: db2 cobol
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    Post subject: Re: db2 cobol
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    Post subject:
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    Post subject:
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    Post subject: Re: How to link with db2 and cobol, What is plan & curso
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us