Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : Q. If there is a situation, where we need to code more than 255 steps in a JOB? A. We need to split jcl into two jcls , at the end of the first jcl check the condition code and initiate the second jcl.

Google
 
Web mainframegurukul.com

Welcome to the mainframegurukul forums.

You are currently viewing our mainframe forums as a guest which gives you limited access to view most discussions, articles. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support at admin@mainframegurukul.com


what will happen id i didnt close the cursor in the program?

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DB2 SQL - DB2 PROGRAMMING
  View previous topic :: View next topic  
Author Message
sivasaras
Member


Joined: 15 Jun 2010
Posts: 25

PostPosted: Wed Jun 16, 2010 9:27 am    Post subject: what will happen id i didnt close the cursor in the program? Reply with quote

Hi,

If i didn't code the close the cursor in a cobol-db2 prgoram means what it will happen?

EXEC SQL

CLOSE CURSOR

END-EXEC
Back to top
View user's profile Send private message

Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 473
Location: chennai

PostPosted: Wed Jun 16, 2010 10:06 am    Post subject: Reply with quote

When program ended, it automatically closes the cursor.

But in the case, where without closing the DB2 cursor, if you try to open the CURSOR again. OPen command will fail.
_________________
Natarajan
Chennai
Back to top
View user's profile Send private message Visit poster's website
sivasaras
Member


Joined: 15 Jun 2010
Posts: 25

PostPosted: Wed Jun 16, 2010 12:23 pm    Post subject: About Cursor Reply with quote

My doubt is whether it will give any abend if we didnt close the cursor?

Suppose i am updating some records and i didnt close the cursor means will the records get updated or not.

Kindly let me know.

Thanks & Regards,
Siva
Back to top
View user's profile Send private message
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 951
Location: Mumbai, India

PostPosted: Wed Jun 16, 2010 12:54 pm    Post subject: Reply with quote

Well, what happend when you tried that?
_________________
Anuj


//MYWALLET EXEC PGM=SPOUSE
//SYSIN DD DSN=MYWALLET.ALL,DISP=SHR
//SYSOUT DD DUMMY
Back to top
View user's profile Send private message
sivasaras
Member


Joined: 15 Jun 2010
Posts: 25

PostPosted: Wed Jun 16, 2010 1:34 pm    Post subject: hi Reply with quote

This was asked in the interview question and i didnt tried?

Regards,
Siva
Back to top
View user's profile Send private message
Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 473
Location: chennai

PostPosted: Wed Jun 16, 2010 1:55 pm    Post subject: Reply with quote

There are two scenarios.

Scenario 1) If you issue COMMIT, data will be posted to ables and cursor will be clsoed automatically ( If you dont use WITH HOLD option in the cursor )
Scenarios 2) Even you dont use COMMIT and/or CLOSE CURSOR command. At the end of the program all changes will refelected into tables.

But advise is, always use COMMIT & CLOSE CURSOR, wherever it is required.
I guess,these things are part of program standards in every shop.
_________________
Natarajan
Chennai
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DB2 SQL - DB2 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

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Is it possible to throw ISPF panels from PL/I programs? 1 rangab 3079 Thu Aug 20, 2009 11:55 pm
MrSpock View latest post
No new posts Am I using DFSORT or Syncsort? 9 Anuj Dhawan 2317 Thu May 14, 2009 11:59 am
Anuj Dhawan View latest post
No new posts How do I add sticky in this Forum ? 8 Anuj Dhawan 1743 Tue Dec 23, 2008 11:35 am
Anuj Dhawan View latest post
No new posts Pl/I for windows 0 MikeJ024 1731 Tue Jun 24, 2008 2:40 pm
MikeJ024 View latest post
No new posts solve it 9 Abhiyanta 4963 Tue Sep 11, 2007 1:12 pm
manitesh_kumar View latest post
 



This widget requires Flash Player 9 or better








Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB