View previous topic :: View next topic
|
Author |
Message |
sailaja cherla
New User
Joined: 08 Oct 2007 Posts: 13 Location: India
|
|
|
|
Hi,
Is it possible to check the DB2 table status through JCL?
If so please do let me know |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
What type of "status" you are looking for ? |
|
Back to top |
|
|
sailaja cherla
New User
Joined: 08 Oct 2007 Posts: 13 Location: India
|
|
|
|
I need to check if the table is active or not. sometimes the regions are down, in such case I need to check if the region is up or not and depending on that I would like to proceed. |
|
Back to top |
|
|
sailaja cherla
New User
Joined: 08 Oct 2007 Posts: 13 Location: India
|
|
|
|
Is it possible to check SQL Code through JCL.May be I can issue a select statement and check for SQL code of that statement. Is it possible? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Why not try it out and see the result ? |
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
yes you can execute SQL query thru jcl using IKJEFT01. |
|
Back to top |
|
|
sailaja cherla
New User
Joined: 08 Oct 2007 Posts: 13 Location: India
|
|
|
|
What I want to know is how to check the SQL code of a DB2 statement through JCL |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Maybe you can execute the step:
Code: |
//CHECKDB EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2T)
-DIS DATABASE(databasename) SPACENAM(tablespacename)
END |
(on our site, each table is in its own tablespace)
Then check the return code:
Code: |
// IF (CHECKDB.RC = 0) THEN
//* all correct, can work with table
// ELSE
//* something wrong with access to table
// ENDIF |
Does it help you ?? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
What I want to know is how to check the SQL code of a DB2 statement through JCL |
Jobs that require the database be "up" should be scheduled as such. If the database is not up, the job should not be submitted.
There should be no reason to check if the database is "up". |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
I believe database up or down should be a concern of system programmers , as an application prgrammer I fail to recall any such check if I've ever seen in my system. Well, if my JOB is fails in Production due to this, I would be happy to point "that" to system programmers right away.. |
|
Back to top |
|
|
|