View previous topic :: View next topic |
Author |
Message |
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Fri Mar 30, 2007 8:06 am Post subject: Establishing a DB2 DSN Session in REXX |
|
|
I would like to execute the DCLGEN subcommand through a REXX command. THE DCLGEN subcommand needs to be submitted from a DSN session. (Per section 3.10.1 in the DB2 Command Reference manual).
How do you establish yourself as being in a DSN session in REXX? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Fri Mar 30, 2007 9:17 am Post subject: |
|
|
I don't have a problem getting connected to the DB2 REXX facility DSNREXX. I have a number of commands that work in this environment and execute SQL statements.
The DCLGEN command needs to be run in a DSN session.
I'm not sure what a DSN session is exactly. I think it may be similar to connecting to the Call Attach Facility. Do I get into the DSN environment through a REXX ADDRESS command?
Once I'm in the DSN Environment, do I execute the DCLGEN command using the EXECSQL PREPARE like I do for normal SQL? DCLGEN isn't really part of SQL. It's a command. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
jim haire Beginner
Joined: 30 Dec 2002 Posts: 140 Topics: 40
|
Posted: Fri Mar 30, 2007 12:56 pm Post subject: |
|
|
That is a good idea Kolusu, although not what I was looking for.
Through experimenting, I found that I can attach to the DSN environment if I am in the TSO address space. My next step will be to try and execute the DCLGEN command.
The final solution I am trying to get towards is to be able to build a DCLGEN for multi-row fetches....the DCLGEN needs occurs clauses built in.
IBM has not built this feature into its DCLGEN command yet. I suppose I could execute a job as you suggested, monitor for its completion, and then add the occurs clause via a change command or some other method.
I am trying to do this in the foreground environment for simplicity.
Any other suggestions are welcome! Thanks for your responses. |
|
Back to top |
|
 |
|
|