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
 
What happen if cursor is defined in procedure Division

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
ksikdar

New User


Joined: 30 Jun 2006
Posts: 13

PostPosted: Tue Feb 20, 2007 4:19 pm    Post subject: What happen if cursor is defined in procedure Division
Reply with quote

Hi all,
Please tell me what will happen if a cursor is defined in procedure division instead of declaring in working storage section of data division???
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1188
Location: Bangalore,India

PostPosted: Tue Feb 20, 2007 4:26 pm    Post subject:
Reply with quote

Hi There,

It 's wont effect whether the cursor is declared in working storage or procedure division but it should be declare befor open cursor stmt.

Please use search option befor posting a new thread
Back to top
View user's profile Send private message
ksikdar

New User


Joined: 30 Jun 2006
Posts: 13

PostPosted: Tue Feb 20, 2007 4:29 pm    Post subject: Re
Reply with quote

This question was asked in an interview in IBM.........Is it the corect answer???
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1188
Location: Bangalore,India

PostPosted: Tue Feb 20, 2007 4:35 pm    Post subject:
Reply with quote

Hi There,

No I am kidding icon_confused.gif
Quote:

Is it the corect answer???


What do u mean by this?
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Tue Feb 20, 2007 9:15 pm    Post subject:
Reply with quote

guptae,
If ya decalring the cursor in w-s section can u call the cursor for multiple times, but instd if ya declare the cursor in PD it can be called many times.

Example From a file i am getting the Account number, and from the same i am obtaining the transaction info. for the day from the database and printing the transaction info and this process is done for n no. of records from the input file. so when the account number changes my values inside the cursor also changes, an i need to close the cursor and reopen with new value being moved to a host vaiable in the where clause of the cursor.

Thamilzan.


Thamilzan.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm

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