Hi Tim,
Its been many, many years since I've done anything in Rexx but I believe
that a lot of the C APIs have equivalent APIs for Rexx.
For example, to scan through the system database directory (the system
database directory is the one that has all cataloged databases in it) you
could use the following C APIs:
sqledosd
sqledgne
sqledcls
If you look at the manuals for these APIs you should find the corresponding
ones for Rexx. They are:
OPEN DATABASE DIRECTORY [ON path_name] USING :value
GET DATABASE DIRECTORY ENTRY :scanid [USING :value]
CLOSE DATABASE DIRECTORY scanid
In fact, there appears to be a sample Rexx program that is shipped with DB2
that uses these:
sqllib\samples\rexx\dbcat.cmd
Hope this helps.
Kelly
Kelly Schlamb
DB2 Universal Database Development, IBM Toronto Lab, Canada
Email: [EMAIL PROTECTED]
Phone: 905-413-2469
DB2 Online Support Website:
http://www.ibm.com/software/data/db2/udb/winos2unix/support
Tim_Traxson@jb
hunt.com To: [EMAIL PROTECTED]
Sent by: cc:
owner-db2eug@l Subject: Re: [DB2EUG] How can I get a
listing of local databases via
ugwash.org a db2 command line.
03/21/2002
04:56 PM
Please respond
to Tim_Traxson
That example didn't come out like I wanted. Maybe this will be better.
Search for the word "indirect" and go back a retrieve the database
name that is 4 lines above it.
Database 5 entry:
Database alias = TESTDB
Database name = TESTDB<===Retrieve this
Database drive = D:\DB2
Database release level = 9.00
Comment =
Directory entry type = Indirect<===Find this
Catalog node number = 0
Thanks,
Tim Traxson
[EMAIL PROTECTED]
479-820-8811
----- Forwarded by Tim Traxson/Corporate/JBHunt on 03/21/2002 03:53 PM
-----
Tim_Traxson@jb
hunt.com To: [EMAIL PROTECTED]
Sent by: cc:
owner-db2eug@l Subject: Re: [DB2EUG] How can
I get a listing of local databases via a
ugwash.org db2 command line.
03/21/2002
03:42 PM
Please respond
to Tim_Traxson
I knew the list database directory option was available but didn't know
there was
a way to read a previous line once I find the keyword "indirect". My idea
is to
pipe the list database directory to a file and use the file as an input
file to look for the
"Directory entry type = Indirect" then read back four lines
and get the database name. Anyone know how to do this with rexx?
Database 5 entry:
Database alias = TESTDB
Database name = TESTDB
<=======================================
Database drive = D:\DB2
|
Database release level = 9.00
|
Comment = |
Directory entry type = Indirect<========Find this.....retrieve
this==
Catalog node number = 0
Thanks,
Tim Traxson
[EMAIL PROTECTED]
479-820-8811
Steve.Westfall@e
quifax.com To: [EMAIL PROTECTED]
cc: [EMAIL PROTECTED],
[EMAIL PROTECTED]
03/21/2002 03:33 Subject: Re: [DB2EUG] How
can I get a listing of local
PM databases via a db2 command
line.
Tim,
The "LIST DATABASE DIRECTORY" command lists ALL databases, local and
remote. The local databases have "indirect" listed as the Directory entry
type. Since you're using REXX for Windows, you could probably pull these
from the output.
Steve Westfall
Equifax, Inc.
Tim_Traxson@jb
hunt.com To: [EMAIL PROTECTED]
Sent by: cc:
owner-db2eug@l Subject: [DB2EUG] How can I
get a listing of local databases via a db2 command
ugwash.org line.
03/21/2002
01:37 PM
Please respond
to Tim_Traxson
Hello list,
I am currently working on some automation and want to know of a way to get
a listing
of only the local databases that are cataloged on a machine. I thought the
list active
databases might be the direction to go, but would only be effective if all
of the databases
had a connection at all times. Apparently that is not the case here.
DB2 UDB NT version 6.1
REXX for Windows
Anyone have any other ideas?
Thanks,
Tim Traxson
[EMAIL PROTECTED]
479-820-8811
-
::: When replying to the list, please use 'Reply-All' and make sure
::: a copy goes to the list ([EMAIL PROTECTED]).
*** To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
*** For more information, check http://www.db2eug.uni.cc
-
::: When replying to the list, please use 'Reply-All' and make sure
::: a copy goes to the list ([EMAIL PROTECTED]).
*** To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
*** For more information, check http://www.db2eug.uni.cc
-
::: When replying to the list, please use 'Reply-All' and make sure
::: a copy goes to the list ([EMAIL PROTECTED]).
*** To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
*** For more information, check http://www.db2eug.uni.cc
-
::: When replying to the list, please use 'Reply-All' and make sure
::: a copy goes to the list ([EMAIL PROTECTED]).
*** To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
*** For more information, check http://www.db2eug.uni.cc