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 

Stored Procedures for REBIND

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
vinnay
Beginner


Joined: 13 Mar 2006
Posts: 15
Topics: 9

PostPosted: Fri Jun 30, 2006 1:37 am    Post subject: Stored Procedures for REBIND Reply with quote

Hi,

I want to write a stored procedure which resolves the -805 probelm during the DB2 program execution.

i.e My code looks like:

EXEC SQL
SELECT STATEMENT

END-EXEC

EVALUATE SQLCODE
WHEN -805
CALL "STORED-PROC" USING WS-PROG-NAME
WHEN 100
DISPLAY ' NO ROWS'
WHEN OTHERS
CALL 'ABEND-ROUTIN' USING SQLCODE
END-EVALUATE.

----
So whenever -805 occured my stored procedure will REBIND the given program. ( i will use same DBRM library for all programs).

In future i dont want to see my program abended with -805.

Please help me in writing the stored procedure for this request.
Back to top
View user's profile Send private message Yahoo Messenger
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Fri Jun 30, 2006 2:05 am    Post subject: Reply with quote

vinnay,

If you do not want to execute the condition for -805 in the Evaluate statement ,can you make use of skipping that statement that is continue further execution .
Code:

EVALUATE SQLCODE
   WHEN -805
      CONTINUE
   WHEN 100
      DISPLAY ' NO ROWS'
   WHEN OTHER
      CALL 'ABEND-ROUTIN' USING SQLCODE
END-EVALUATE.

_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
vinnay
Beginner


Joined: 13 Mar 2006
Posts: 15
Topics: 9

PostPosted: Fri Jun 30, 2006 2:36 am    Post subject: Reply with quote

Hi Shekar123,

If i continue with -805 sqlcode it will not fetch any data in program. My question is, i want to resolve -805 in my program itself in stead of doing a seperate BIND process thru JCL or Online.
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Jun 30, 2006 5:01 am    Post subject: Reply with quote

Quote:

If i continue with -805 sqlcode it will not fetch any data in program. My question is, i want to resolve -805 in my program itself in stead of doing a seperate BIND process thru JCL or Online.


vinnay,

You just cannot solve the BIND errors within the program.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vinnay
Beginner


Joined: 13 Mar 2006
Posts: 15
Topics: 9

PostPosted: Fri Jun 30, 2006 6:00 am    Post subject: Reply with quote

Kolusu,

Is there any other way to BIND the program without submitting JCL or thru Interactive panel? It would be a great help for me if you could answer for this .


Thanks in advance.
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Jun 30, 2006 6:51 am    Post subject: Reply with quote

Quote:

Is there any other way to BIND the program without submitting JCL or thru Interactive panel? It would be a great help for me if you could answer for this .


NO

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database 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