Where would you specify the DECLARE CURSOR statement?
Moderator: Moderator Group
Where would you specify the DECLARE CURSOR statement?
Where would you specify the DECLARE CURSOR statement?
In Working storage section.
In working Storage section.
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
since the question is Where would
my answer would be according to site standards
had the question been Where could
my answer would have been either in Working-Storage, Linkage, or Procedure Division (physically before the OPEN and the FETCH.
my answer would be according to site standards
had the question been Where could
my answer would have been either in Working-Storage, Linkage, or Procedure Division (physically before the OPEN and the FETCH.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Member
- Posts: 15
- Joined: Thu Feb 23, 2012 6:55 am
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
Fredrick Andrews,
no difference, not performance advantage.
it is cosmetic. by that i mean, it depends on the coding standards for the site.
i have worked at sites and have seen all three methods employed.
just depends on where the coding standards stipulate the code must be layed.
remember, a declare cursor is not an invocation of SQL.
it is used by the pre-compiler to generate the code placed between the PROCEDURE DIVISION statement and the first line of user code.
The inserted code is executed once, regardless of number of times the program is CALLed,
as long as the program is not CANCELed or has the INITIAL statement in the ID Division.
no difference, not performance advantage.
it is cosmetic. by that i mean, it depends on the coding standards for the site.
i have worked at sites and have seen all three methods employed.
just depends on where the coding standards stipulate the code must be layed.
remember, a declare cursor is not an invocation of SQL.
it is used by the pre-compiler to generate the code placed between the PROCEDURE DIVISION statement and the first line of user code.
The inserted code is executed once, regardless of number of times the program is CALLed,
as long as the program is not CANCELed or has the INITIAL statement in the ID Division.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page