IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REXX DB2: Dynamic allocation of DB2.DSNLOAD


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
BHAS

New User


Joined: 17 Dec 2016
Posts: 1
Location: Kolkata

PostPosted: Mon Dec 19, 2016 8:26 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Mon Dec 19, 2016 9:15 pm
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Dec 21, 2016 2:58 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2545
Location: Silicon Valley

PostPosted: Wed Dec 21, 2016 10:56 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top