IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to set return code using PLIRETC in PLI/DB2 program


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hemanthj642

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Sat Jul 18, 2009 10:13 am
Reply with quote

Hi,

I have a PLI program which has DB2 calls in it. I want to set a Return Code of 12 if there is a SQl error. I have tried using PLIRETC by capturing the SQL return code. But my program still gives me a return code of zero when there is a DB2 return code of -911. I use the utility IKJEFT01 to execute my DB2/PLI program. if a use PLIRETC in a normal PLI program I able to throw the desired return code.
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Mon Jul 20, 2009 12:09 pm
Reply with quote

Hemanth,
Looks like you are not handling the sqlcode properly in your program. Can you please let us know how you are using PLIRETC function in your program.
Back to top
View user's profile Send private message
hemanthj642

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Tue Jul 21, 2009 10:54 am
Reply with quote

I have coded the DB2 SQl code as follows:

SELECT (SQLCA.SQLCODE)
WHEN (0)
DO;
END:
OTHERWISE
DO;
CALL PROCESS_DB2_ERROR('FETCH_CPMX2_CURSOR');
END:

*******************************************
in PROCESS_DB2_ERROR PARA

RETURN_CODE = 12;

at the end of the program I have coded like

IF RETURN_CODE > 0 THEN
CALL PLIRETC(12);
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Wed Jul 22, 2009 2:54 pm
Reply with quote

Hemanth,
Can you please try this?

SELECT (SQLCA.SQLCODE)
WHEN (0)
DO;
END:
OTHERWISE
DO;
CALL PLIRETC(12);
END:

Just for debugging purpose only.
Back to top
View user's profile Send private message
hemanthj642

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Wed Jul 22, 2009 4:44 pm
Reply with quote

Hey Srihari,

Thanks a lot for your quick response. I got the solution while debugging that program. The problem was with the control card that I was using to execute this DB2/PLI program. I was not capturing the return code from the program to pass it on to the utility IKJEFT01. so, IKJEFT01 was returning a return code of zero in all these cases.

My code is working now.

Thank You!

Regards,
Hemanth.
Back to top
View user's profile Send private message
kevin peterson
Warnings : 1

New User


Joined: 03 Sep 2009
Posts: 3
Location: Hyderabad

PostPosted: Sat Sep 05, 2009 4:14 pm
Reply with quote

Hi Hemanth and Srihari,

Can you please send me PLI DB2 sample programs.... I am very new to PLI.
Please do this as early as possible. Please mail to xxxxxxxxxxx@xxxxxxx
Thanks in advance

Edited by expat to remove email address
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Sep 05, 2009 6:16 pm
Reply with quote

kevin peterson wrote:
Can you please send me PLI DB2 sample programs.... I am very new to PLI.
Please do this as early as possible. Please mail to xxxxxxxxxxx@xxxxxxx
Thanks in advance

Please note that this is a HELP forum, not a give me code forum.

What research have you carried out for yourself before asking for code. Please post when you have some code of your own that is giving problems.

It is also one of the forum rules that you DO NOT post personal contact details.
Back to top
View user's profile Send private message
kevin peterson
Warnings : 1

New User


Joined: 03 Sep 2009
Posts: 3
Location: Hyderabad

PostPosted: Sun Sep 06, 2009 10:05 am
Reply with quote

Sorry Mr Prino and Expat,

I am really very sorry for that, I am very new to PLI, I thought I could learn it by seeing some sample code. I accept my mistake of giving my personal mail address.

I am sorry to say you prino, your way of warning really hurts people. Expat said the same thing what you wanted to convey but in a very decent way.
What you need to understand is I am very new to PLI, and do not think that everybody in this forum is of your age and experience.

Thank You.
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sun Sep 06, 2009 1:01 pm
Reply with quote

Kevin,

It is difficult to accept someone telling "I am new in PL/I", give me PL/I code for this , even with "please" and see that you claim to have

"Mainframe Skills: PLI, COBOL, JCL, VSAM, DB2"


Some people here called 'experienced' worked hard during several years before telling "now, I can tell I know Cobol, PL/I, or whatever".

The resume of Prino and yours is the same. Each tells "mainframe skills : PL/I".

Don't you believe a difference must be seen? And more honesty and modesty.

Pierre
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Sun Sep 06, 2009 1:19 pm
Reply with quote

PeD wrote:
Kevin,


His name is unlikely to be Kevin, he registered with this (probably) false name to avoid being identified as someone from India and the effect is exactly the opposite.
Back to top
View user's profile Send private message
kevin peterson
Warnings : 1

New User


Joined: 03 Sep 2009
Posts: 3
Location: Hyderabad

PostPosted: Sun Sep 06, 2009 10:46 pm
Reply with quote

Hi Prino/PeD,

You are very correct my is not Kevin, it is not the biggest sin in the world. I like that name, Kevin Peterson is my favorite Cricketer. Can't I use his name.

Coming to my technical skills, I have been trained on COBOL, JCL, VSAM, DB2 and I am learning PL/I. I have two years of experience but I did not work on any Project. I was on Bench.

I am an Indian and I am very proud of being an Indian, I never said I am from United States of America, you can see, in the location I have given Hyderabad not Not York. I do not know why you people took it in a very offensive way.

I hope I have cleared all your doubts. Lets leave this matter here.

Regards,
Kevin
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Sun Sep 06, 2009 10:48 pm
Reply with quote

Please tell me where and when I offended you?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Mon Sep 07, 2009 12:01 am
Reply with quote

kathula.chandraa wrote:
Hi Prino/PeD,

You are very correct my is not Kevin, it is not the biggest sin in the world. I like that name, Kevin Peterson is my favorite Cricketer. Can't I use his name.


His name is Kevin Pietersen. In IT integrity is very important, your integrity is non-existent. Did you ask Mr Pietersen for permission to (ab)use his name?

kathula.chandraa wrote:
Coming to my technical skills, I have been trained on COBOL, JCL, VSAM, DB2 and I am learning PL/I. I have two years of experience but I did not work on any Project. I was on Bench.


So you do not have any real experience whatsoever...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top