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
 

 

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: 1187
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: 1187
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 Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm
No new posts Getting -504 Cursor Name GTT-ARTS-CUR... Robin Sulsona DB2 2 Fri Mar 17, 2017 1:43 am
No new posts Release of Adabas Cursor mohitsethi All Other Mainframe Topics 1 Mon Feb 06, 2017 8:36 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 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