Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: how to set return code using PLIRETC in PLI/DB2 program
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Regarding PLI DB2 Program
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: 8593
Location: Back in jolly old England

PostPosted: Sat Sep 05, 2009 6:16 pm    Post subject: Re: Regarding PLI DB2 Program
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    Post subject: Sorry
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: 456
Location: Belgium

PostPosted: Sun Sep 06, 2009 1:01 pm    Post subject:
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

Active Member


Joined: 07 Feb 2009
Posts: 985
Location: Oostende, Belgium

PostPosted: Sun Sep 06, 2009 1:19 pm    Post subject:
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    Post subject:
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: 456
Location: Belgium

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

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

Active Member


Joined: 07 Feb 2009
Posts: 985
Location: Oostende, Belgium

PostPosted: Mon Sep 07, 2009 12:01 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us