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: 1753
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: 1226
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: 2033
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 REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts REXX compiled via RXTCOMP sergeyken CLIST & REXX 7 Tue Feb 07, 2017 9:41 pm
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm


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