MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Basic Q on Fetch

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Thu Apr 26, 2012 7:28 am    Post subject: Basic Q on Fetch Reply with quote

Hi, this is a basic question on Fetch.

Quote:

Declare
Open
Fetch
Close


Above is the order to use a cursor in a batch program. Now, after open, is it must to do the fetch right after it or can code it somewhere after an IF condition?

Please advise.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Apr 26, 2012 8:24 am    Post subject: Reply with quote

mf_user,

let us start at the beginning.

db2, mqs, cics, ims all have API's (application interface)
these API's allow you to imbed invocations to DB2, ... from a program,
whether it be written in COBOL, HLASM, PL1, JAVA, REXX, etc...

The API's are converted to the source language of the program (COBOL in this case)
by a pre-compiler.

after that, your program contains a CALL with a handful of parms in a USING List, instead of the coded API
(EXEC SQL ... END-EXEC)

in order to uses a cursor, it needs to be DECLAREd, OPENed, FETCHed
in that order.
after the Cursor is OPENed, your FETCHes can come at anytime.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group