Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

REXX DB2: Dynamic allocation of DB2.DSNLOAD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: REXX DB2: Dynamic allocation of DB2.DSNLOAD
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: 1754
Location: Bloomington, IL

PostPosted: Mon Dec 19, 2016 9:15 pm    Post subject:
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: 1228
Location: Israel

PostPosted: Wed Dec 21, 2016 2:58 am    Post subject:
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

Senior Member


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

PostPosted: Wed Dec 21, 2016 10:56 pm    Post subject: Reply to: REXX DB2: Dynamic allocation of DB2.DSNLOAD
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 2 Sat Apr 22, 2017 12:42 am
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us