Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
checking the return code in DSNTEP2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
nabarundas

New User


Joined: 21 Jun 2007
Posts: 28
Location: pune

PostPosted: Wed Aug 06, 2008 5:18 pm    Post subject: checking the return code in DSNTEP2
Reply with quote

Hi,

I am executing the following SQL queries through JCL by using DSNTEP2

Code:

  .
  .
   //SYSIN DD *
   --#SET TERMINATOR ;
   Insert into <tablename1> values <values1);
   Insert into <tablename2> values <values2);
   /*



Now I want to execute the second query depending on the success of the first query. How can I do it?

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

vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Wed Aug 06, 2008 7:54 pm    Post subject:
Reply with quote

Not quite sure how to check the SQLCODE but I have one Idea if it is only two queries.

Put two inserts in two JCL steps using DSNTEP2. If step1 is sucess then execute step2 using condition codes. This way you dont need to be worried about ROLLBACK. If step1 fails it would have been already Rolled back.

Does that work icon_smile.gif.? I would do this rather than cracking DSNTEP2 code. Gues DSNTEP2 is written in Assembler or COBOL?.
Back to top
View user's profile Send private message
nabarundas

New User


Joined: 21 Jun 2007
Posts: 28
Location: pune

PostPosted: Thu Aug 07, 2008 10:12 am    Post subject:
Reply with quote

Thanks for your suggestion Vini.

But I want to check the return code because later few more queries might need to be included. So writing DSNTEP2 steps will not be convenient for me.

If some one knows how to check the return code then it will be helpful for me otherwise I have to go for COBOL program and do the LUW.

What do you suggest?


Regards,
Nabarun
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Aug 07, 2008 7:32 pm    Post subject:
Reply with quote

Hello,

If you use a COBOL program you will have far more flexability and control of the process. Your process could support more than only simple inserts.

You could also incorporate an audit trail of what was done for when there are questions. Makes me breathe easier to have a record of what database maintenance was done "outside" the system and may also satisfy some auditors (if you deal with them - them see red flags when spontaneous updates are done to database content).
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us