View previous topic :: View next topic
|
Author |
Message |
BHAS
New User
Joined: 17 Dec 2016 Posts: 1 Location: Kolkata
|
|
|
|
Hi,
I have a requirement to allocate DB2.DSNLOAD dynamically. I have found this piece of code to connect REXX with DB2. First 2 commands are working fine but 3rd command is asking for a 8 bytes long DSN(CLIST) name. But I don't know what it will be. Can anyone help me on this ?
1. ADDRESS TSO "ALLOC FI(TRGLLIB) DS(''XXDB2.DSNLOAD')"
2. ADDRESS ISPEXEC " LIBDEF ISPLLIB LIBRARY ID(TRGLLIB) UNCOND STACK"
3. ADDRESS ISPEXEC "SELECT CMD(DSN)"
I have connected the DB2 using ALLOCATE DSNLOAD in ready prompt but this not what I want. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
So if you have a solution that works from native TSO prompt the same solution can simply be incorporated into your Rexx script, yes? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Line 1 asks TSO to give a DD name to the DB2 load library,
Line 2 asks ISPF to add this DD to its LoadLIB,
Line 3 is supposed to run the REXX program, (program names are up to "8 bytes") usually the same program that actually uses DB2.
And don't forget to release the library once the program is over.
However, you may find that this library is already available to you, as there are almost certainly a few rexx tools already running on your site. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2545 Location: Silicon Valley
|
|
|
|
Quote: |
but 3rd command is asking for a 8 bytes long DSN(CLIST) name. |
The 'asking' part is not clear to me. Can you post the messages that you receive?
Your stated requirement is to allocate dynamically. Your steps 1 & 2 do that. Step 3 tries to go beyond allocating and to actually invoke DB2. It is your invocation of DB2 that is not correct.
I think you need to provide the parameters that DB2 needs to start. Something like this (untested):
Code: |
QUEUE 'RUN PROGRAM(mydb2prog) PLAN(mydb2plan)'
QUEUE 'END'
Address ispexec ,
'SELECT CMD(DSN SYSTEM(DB2A)) ' |
|
|
Back to top |
|
|
|