View previous topic :: View next topic
|
Author |
Message |
r2k1984
New User
Joined: 21 Jun 2005 Posts: 69 Location: chennai
|
|
|
|
HI,
I tried the following tso command and it works to get the dclgen for a table.
TSO DSN
DCLGEN TABLE(TABLENAME) ACTION(REPLACE)
'DSN NAME'
BUT WHEN I TRIED IT IN REXX in the below syntax it is not working.
any one have any clue to sort this?
ADDRESS TSO
" DSN"
"DCLGEN TABLE(TABLENAME) ACTION(REPLACE)"
"'DSN NAME'" |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
r2k1984 wrote: |
BUT WHEN I TRIED IT IN REXX in the below syntax it is not working. |
WOW, what a huge mountain of useful information you have given us to work with.
A little help on asking for help .................
All that we know is that there is a problem, we do not know what the problem is because you have not told us.
We do not know what you have read to look for help because you have not told us.
We do not know what you have tried yourself because you have not told us.
Without the obvious information we can do nothing to help you, or if we do, only guessing wildly which of course may cause you more problems than you originally have. Unless of course we all sit back and wait for psychic day
Now sit back and think about what we might need to know to be able to help you. |
|
Back to top |
|
|
r2k1984
New User
Joined: 21 Jun 2005 Posts: 69 Location: chennai
|
|
|
|
i tried the above tso commands and the i was able to get the dclgen for a table.
But when i execute the below rexx
/* REXX TO GET DCLGEN FOR A TABLE */
/* ITRACE */
ADDRESS TSO
"DSN "
"DCLGEN TABLE(NRODB2T.RESPONSE) ACTION(REPLACE)"
"SSYG.USER.RAM.OUT(RESPONSE)"
it was executing only till dsn and the below two commands are not executed . I want the dclgen to be written to the file. is there other ways to get the dclgen in batch mode. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
expat,
your turn. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
So what have you told me that is different from your original post ?
So yet again I say ........................................
expat wrote: |
r2k1984 wrote: |
BUT WHEN I TRIED IT IN REXX in the below syntax it is not working. |
WOW, what a huge mountain of useful information you have given us to work with.
A little help on asking for help .................
All that we know is that there is a problem, we do not know what the problem is because you have not told us.
We do not know what you have read to look for help because you have not told us.
We do not know what you have tried yourself because you have not told us.
Without the obvious information we can do nothing to help you, or if we do, only guessing wildly which of course may cause you more problems than you originally have. Unless of course we all sit back and wait for psychic day
Now sit back and think about what we might need to know to be able to help you. |
|
|
Back to top |
|
|
r2k1984
New User
Joined: 21 Jun 2005 Posts: 69 Location: chennai
|
|
|
|
Expat iam really sorry. I dont know what else information is required.
I have told my problem above.
Please could you point the things which is required.
When i execute the above 3 commands in tso it is working and whn i kept the code in rexx and execute since the control is going to tso and only the dsn command is executing, the rest dclgen and libraries are not executing.
please let us know how to execute |
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
r2k1984,
Rather than stating what your "problem" is and asking for help to "solve" it with insufficient information, try stating what objective you are attempting to satisfy and seeking advice as to possible methods for meeting that objective - for example:
"I am trying to create a DCLGEN in Batch. Can someone provide sample JCL showing how to accomplish that?"
REXX may not be the best method. It may not even be a viable method. |
|
Back to top |
|
|
r2k1984
New User
Joined: 21 Jun 2005 Posts: 69 Location: chennai
|
|
|
|
my requirement is to get the DDL statements for a table .
Since i dont have access to platinum or db2look or any other tools.
Can any one suggest a good way to solve the issue |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
well, this link DCLGEN indicates your syntax sucks. |
|
Back to top |
|
|
r2k1984
New User
Joined: 21 Jun 2005 Posts: 69 Location: chennai
|
|
|
|
dbzTHEdinosauer wrote: |
well, this link DCLGEN indicates your syntax sucks. |
First of all it is working when i tried it in TSO directly
but i was able to pass the DCLGEN to the dsn after the DSN command is executed.
If the syntax is wrong it would not have executed in TSO tooo right?????? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
well, excuse me for living,
you seem to have a handle on everything,
i will try to refrain from making anymore posts in this thread. |
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
r2k1984 wrote: |
my requirement is to get the DDL statements for a table .
Since i dont have access to platinum or db2look or any other tools.
Can any one suggest a good way to solve the issue |
Now, you've "changed horses in mid-stream". First you say ( and show DB2 commands that would lead one to believe that ) you want to generate the DCLGEN for a table ( using REXX, of course ), but now it appears you want to generate the DDL, NOT the DCLGEN. You also state that the commands you show work under TSO.
Well first of all, a table's DCLGEN and its DDL are two very, very different things. DCLGEN only describes the table and its columns as a structure generated in a target host language, while DDL describes the declarations ( in DB2 terms ) that a DBA would use to construct the table itself, including such elements as Foreign Keys, Constraints, Defaults, Partitions, etc.
Second, as Dick has already pointed out, the Command Set you show would NOT pass the syntax requirements for a DCLGEN request - under TSO or anywhere else. Perhaps you 're-keyed' your statements instead of using CUT/PASTE, and made some errors in doing so?
Anyway, you really need to step back and describe what it is you REALLY want ( DCLGEN or DDL ). It might really help to know what you intend to do with the output - perhaps you don't really need what you think you do. |
|
Back to top |
|
|
wanderer
Active User
Joined: 05 Feb 2007 Posts: 199 Location: Sri Lanka
|
|
|
|
It seems to me you want to see the columns in table but don't know how to get the DDL so you are trying to gen DCLGEN instead.
My assumption here could be wrong, but if right then this is not the right way to look at table structure.
Talk to your DBAs, they will have the right tools to get the DDL. You can also query catalog tables using SPUFI to get most details about table structure.
On REXX, do you have just one default DB2 subsystem or something like that? Because after DSN I don't see any DB2 subsystem name in your code that you posted. |
|
Back to top |
|
|
r2k1984
New User
Joined: 21 Jun 2005 Posts: 69 Location: chennai
|
|
|
|
Expat : I want to find the DDL for a table , but I dont have any tools to find it out. so Iam trying a way to create a DDL statement with help of DCLGEN.
Wanderer: You are exactly thinking the same way Iam thinking. We are not able to reach DBA and access for the tools will not be given to us. THat is the reason Iam trying another way to solve the issue...
We have only one DB2 region set . So it accepts the region without giving subsystem. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Do you not have read access to the catalog tables? Has it been requested yet?
If you find a way to get what you are looking for, how will this be used? As RB mentioned, if we knew what you were trying to accomplish (rather than the problems associated with getting the info you want), we might be able to offer something more usable. |
|
Back to top |
|
|
r2k1984
New User
Joined: 21 Jun 2005 Posts: 69 Location: chennai
|
|
|
|
Yes I have access to catlog tables.
I have a requirement to extract DDL statement for all tables in our system.
But we dont have access to execute platinum and db2look.
So we tried to create a rexx to generate ddl statement for a table. Which can be achived , when we get the DCLGEN. Which is the indirect way to get the data.
It woud be great, if any one can tell a way to get the DDL statements of the table without platinum or db2look.. |
|
Back to top |
|
|
wanderer
Active User
Joined: 05 Feb 2007 Posts: 199 Location: Sri Lanka
|
|
|
|
Who could have provided you with that requirement but doesn't bother to provide you access to any tools and knows that you can't contact a DBA?
This is very unreasonable!
DCLGEN doesn't provide whole table DDL. e.g. If table has a constraint, if columns have default values or if fieldprocs are present and many more don't show up in DCLGEN.
If you just want column names and NULL or not, why don't you just get from SYSCOLUMNS? Why the REXX route? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
As long as you will not provide requested info, we will not be much help. . .
To repeat:
Quote: |
If you find a way to get what you are looking for, how will this be used? As RB mentioned, if we knew what you were trying to accomplish (rather than the problems associated with getting the info you want), we might be able to offer something more usable. |
Quote: |
I have a requirement to extract DDL statement for all tables in our system. |
Typically provided by the dba. . . Many (most?) developers would not have the background to do this. Where/how did this requirement originate? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Where/how did this requirement originate?
|
[No attempt at political correctness on]
oh, let me guess, please, please.
the company contracted with the client, saying, yes you can fire all your experienced people because we can do everything.
So,the rule is: no communications with the clients DBA staff.
Otherwise someone would notice that the outsourcers were actually sorta out of IT.
[No attempt at political correctness off] |
|
Back to top |
|
|
|