Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Declaration cursor in WS section or Procedure Division

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
mouli

New User


Joined: 19 May 2005
Posts: 12
Location: kolkata

PostPosted: Thu Jun 02, 2005 7:06 pm    Post subject: Declaration cursor in WS section or Procedure Division
Reply with quote

Hi All,
What is the difference between declaring the cursor in working storage section and declaring in procedure divison.
Plz explain me.

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

ayyappa_22523
Warnings : 2

New User


Joined: 02 Jun 2005
Posts: 36
Location: Hyderabad

PostPosted: Sat Jun 04, 2005 12:25 pm    Post subject:
Reply with quote

HI MOULI

declare the cursor in working-storage and procedure division is same


but most of doing in working srotage section .

urs

AyyAppA
Back to top
View user's profile Send private message
paramreddy

New User


Joined: 06 Jun 2005
Posts: 1

PostPosted: Mon Jun 06, 2005 2:50 pm    Post subject: Re: Declaration cursor in WS section or Procedure Division
Reply with quote

HI ,
U can declare the cursor position either working storage or procedure.But usually we use working storage because it is non executable statements(just is declaration of data items) .
Back to top
View user's profile Send private message
mouli

New User


Joined: 19 May 2005
Posts: 12
Location: kolkata

PostPosted: Mon Jun 06, 2005 3:11 pm    Post subject: Declaration of cursor in WS section or Procedure Division
Reply with quote

paramreddy wrote:
HI ,
U can declare the cursor position either working storage or procedure.But usually we use working storage because it is non executable statements(just is declaration of data items) .


Hi reddy,
can u explain it in detail, when should i delclare it in procedure division.

regards
mouli
Back to top
View user's profile Send private message
Pushpak

New User


Joined: 06 May 2005
Posts: 18

PostPosted: Thu Jun 09, 2005 1:25 pm    Post subject: Re: Declaration cursor in WS section or Procedure Division
Reply with quote

Hi

Its depends on you where you have to define a cursor. Only thing you have to take care is definition of cursor should be prior to the OPEN statement of the same cursor.

As definition of cursor is non executable statement, it is advisable not to define in procedure division as it may misunderstood others.

Pushpak.
Back to top
View user's profile Send private message
shailendra

New User


Joined: 08 Jun 2005
Posts: 10
Location: Pune

PostPosted: Thu Jun 09, 2005 1:48 pm    Post subject:
Reply with quote

Hi

No need to worry where to declare cursor. You can define it in procedure or working division. It does not cause any difference.

Declare cursur wherever you wish.

shailendra
Back to top
View user's profile Send private message
bnsahoo

New User


Joined: 06 Jun 2005
Posts: 18
Location: mumbai,india

PostPosted: Thu Jun 09, 2005 5:16 pm    Post subject:
Reply with quote

It is right,that there is no difference between these two .when open statement is executed then the cursor (Result Table) will be created(declared in the DECLARED statement),so it is like object is instance of class in OOconcept. That is class is blue print of object.
Thanks
Biranchi
Back to top
View user's profile Send private message
Pushpak

New User


Joined: 06 May 2005
Posts: 18

PostPosted: Fri Jun 10, 2005 3:12 pm    Post subject: Re: Declaration cursor in WS section or Procedure Division
Reply with quote

Hi All,

I am sorry for my previous statement related to this query. The statement was
"Only thing you have to take care is definition of cursor should be prior to the OPEN statement of the same cursor. "

I have tested it with DB2 Ver 7 & found that you can define CURSOR any where in the application program no matter whether it has been defined. It can be after/before OPEN/FETCH/CLOSE statements of the same cursor.

Sorry once again for your inconvenience.

Pushpak.
Back to top
View user's profile Send private message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Wed Jun 15, 2005 2:58 pm    Post subject:
Reply with quote

Hi Mouli,

I was answered this already ... Please refer to the following post...

http://www.ibmmainframes.com/viewtopic.php?p=4860&highlight=#4860

Thanks,
Reddy.
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 Handling result sets in the calling N... Rusikesh DB2 7 Fri Apr 13, 2018 12:25 am
No new posts COBOL declaration for table Poha Eater DB2 3 Mon Feb 26, 2018 6:58 pm
No new posts Xpediter: STEP OVER cobol section Auryn Compuware & Other Tools 0 Thu Feb 22, 2018 9:30 pm
No new posts -502 Error - Cursor already open anand jeyapaul DB2 7 Sun Oct 29, 2017 4:22 am
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us