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
 

 

Dynamically adding Loadlib for the session !!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
mjadwani2785

New User


Joined: 28 Apr 2009
Posts: 89
Location: Noida , Dublin

PostPosted: Mon Sep 19, 2011 4:13 pm    Post subject: Dynamically adding Loadlib for the session !!
Reply with quote

Hi ,
Following is the code i have written trying to dynamically allocate SDSNLOAD for my session .. I cant find why it is not allowing me to do so. The same task I can do it by TSOLIB .. but I have seen LIBDEF also works but not in my case.
Here is code...

/*rexx */
parse arg db2sid
ds1 ="SYS1.DSN"db2sid".SDSNLOAD"
db2loadlib ="'"ds1"'"
address tso
"alloc fi(trgllib) ds("db2loadlib") shr reuse "
address ispexec
"control errors "
address ispexec
"libdef ispllib library id(trgllib) uncond stack

address tso "SUBCOM DSNREXX"
if rc<>0 then ,
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
address dsnrexx "CONNECT" db2sid
If rc <> 0 Then Do
Say 'Cannot connect to ' DB2_subsys ' RC=' rc
RC = RXSUBCOM('DELETE','DSNREXX','DSNREXX')
Exit(23)
End
return rc

when it is run it gives me this output (with trace )

9 *-* address tso
10 *-* "alloc fi(trgllib) ds("db2loadlib") shr reuse "
>L> "alloc fi(trgllib) ds("
>V> "'SYS1.DSNDB2V.SDSNLOAD'"
>O> "alloc fi(trgllib) ds('SYS1.DSNDB2V.SDSNLOAD'"
>L> ") shr reuse "
>O> "alloc fi(trgllib) ds('SYS1.DSNDB2V.SDSNLOAD') shr reuse "
11 *-* address ispexec
12 *-* "control errors "
>L> "control errors "
13 *-* address ispexec
14 *-* "libdef ispllib library id(trgllib) uncond stack" /*8"db2loadlib") "
*/
>L> "libdef ispllib library id(trgllib) uncond stack"
16 *-* address tso "SUBCOM DSNREXX"
>L> "SUBCOM DSNREXX"
+++ RC(1) +++
17 *-* if rc<>0
>V> "1"
>L> "0"
>O> "1"
*-* then ,
18 *-* S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
>L> "ADD"
>L> "DSNREXX"
>L> "DSNREXX"
CSV003I REQUESTED MODULE DSNTZANB NOT FOUND
CSV028I ABEND806-04 JOBNAME=D05922E STEPNAME=IKJACCNT
IRX0250E System abend code 806, reason code 00000004.
IRX0253E Abend in external function RXSUBCOM.

What can be the problem. Load module is there in the dataset .

Pedro replied "Libdef doesnot work for rexx process " .. but the other day i have seen libdef working with CLIST ...

what can be the alternative for TSOLIB .. I want to add this load dataset dynamically . Linklist addition of DB2 load lib is not allowed at my site.


Please Help . !!
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Mon Sep 19, 2011 4:30 pm    Post subject: Reply to: Dynamically adding Loadlib for the session !!
Reply with quote

for the umpteen time... LIBDEF works for ISPF <controlled> <loads>

ISPF uses <directed loads> , it means that whn doing the bldl mumbo-jumbo
for something it check the LIBDEF chain/stack to determine the DDNAME to use

Address TSO uses only the standard library search so it knows nothing about the libdefs

if You want more flexibility than TSOLIB provides, <You> should install one of the many flavors of dynamic steplib available free
at www.cbttape.org or for a charge
remeber installing software requires proper management agreement/permission
it' s a pity that installing free software is quite often frowned upon !
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Sep 19, 2011 8:21 pm    Post subject: Reply to: Dynamically adding Loadlib for the session !!
Reply with quote

Hello,

Please keep in mind that posting the same question multiple times is the easiest way to lose posting privileges. . .

d
Back to top
View user's profile Send private message
mjadwani2785

New User


Joined: 28 Apr 2009
Posts: 89
Location: Noida , Dublin

PostPosted: Mon Sep 19, 2011 11:14 pm    Post subject:
Reply with quote

Hi Dick,

I apologize for multiple postings, I thought that one is old post so chances of getting a reply on that one is very less.

Will not repeat that in future. I myself a regular visitor of this this site and losing a posting right here is just like getting being banned from facebook and I am sure nobody can think of that.

I will stop posting here and will continue with my old post .

Thanks.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Mon Sep 19, 2011 11:26 pm    Post subject: Reply to: Dynamically adding Loadlib for the session !!
Reply with quote

I am not sure this will work, but try a two exec approach:

1. first exec does the LIBDEF
2. first exec does Address ISPEXEC "SELECT CMD(%second_exec parms) PASSLIB"
3. second exec does the work you want to do.

In ISPF Services Guide", see the description for LIBDEF, which includes a section titled 'User link libraries'. It mentions:
Quote:
If the SELECT program service is invoked using ISPEXEC SELECT CMD(MYCMD), MYCMD is considered a member of the load libraries specified with LIBDEF ISPLLIB. The command processor (a program coded to support a unique argument list format) can then use MVS contents supervision macros such as ATTACH, LINK, LOAD, or XCTL. This is because ISPF attaches MYCMD as a subtask to ISPF. The load library, defined using LIBDEF ISPLLIB, is passed as a task library to the subtask.


Note: it mentions TSO command processors... but I still have doubts that your rexx processes will work. They are not command processors and I doubt they are called through ATTACH, LINK or LOAD.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Mon Sep 19, 2011 11:44 pm    Post subject:
Reply with quote

And you have not checked the return codes from your ALLOCs
Back to top
View user's profile Send private message
mjadwani2785

New User


Joined: 28 Apr 2009
Posts: 89
Location: Noida , Dublin

PostPosted: Tue Sep 20, 2011 12:00 am    Post subject:
Reply with quote

Hi Nic,

I just verified my return codes from the alloc .. they all are fine rc =0 even I checked the allocation of sdsnload to my ispf session with the ddname of trgllib .

I even tried Pedro suggestion "select pgm(dsnrexx) " still it says 806-04 .

How can libdef work for clist and loadlibs can be dynamically allocated and not for rexx ? icon_question.gif

Will try to explore more .
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Sep 20, 2011 12:22 am    Post subject: Reply to: Dynamically adding Loadlib for the session !!
Reply with quote

Quote:
How can libdef work for clist and loadlibs can be dynamically allocated and not for rexx ?


I already gave the reply,
no reason for anybody to waste time explaining if You do not care to read the answers icon_evil.gif

Quote:
but the other day i have seen libdef working with CLIST .

most probably You have seen an ALTLIB, not a LIBDEF
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Tue Sep 20, 2011 1:26 am    Post subject: Reply to: Dynamically adding Loadlib for the session !!
Reply with quote

Quote:
I even tried Pedro suggestion "select pgm(dsnrexx) " still it says 806-04 .


No, that was not my suggestion. Please read again. And please read the section of the manual cited.
Back to top
View user's profile Send private message
mjadwani2785

New User


Joined: 28 Apr 2009
Posts: 89
Location: Noida , Dublin

PostPosted: Tue Sep 20, 2011 1:29 am    Post subject:
Reply with quote

Just tried this sample code.. and according to dynamic allocation of libdef works

ds1 ="SYS1.DSNDB2V.SDSNLOAD"
db2loadlib="'"ds1"'"
address tso
"alloc fi(trgllib) ds("db2loadlib") shr reuse"
address ispexec
"libdef ispllib library id(trgllib) uncond stack"
address ispexec "select cmd(dsn) "

now jst to think how to bring rxsubcom and dsnrexx accordingly icon_smile.gif
Back to top
View user's profile Send private message
mjadwani2785

New User


Joined: 28 Apr 2009
Posts: 89
Location: Noida , Dublin

PostPosted: Tue Sep 20, 2011 1:36 am    Post subject:
Reply with quote

Thanks Pedro .. in a rush I wrote pgm... cmd works... icon_smile.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Tue Sep 20, 2011 10:26 am    Post subject:
Reply with quote

As the DB2 libraries need to use DB2 via Rexx should already be available to you why are you doing this? Read the Rexx section of the DB2 Application Programming and SQL Guide.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm
This topic is locked: you cannot edit posts or make replies. How to supply called sub-program from... dchristensen JCL & VSAM 25 Wed Sep 14, 2016 11:36 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm
No new posts PL/I: opening file w/ dynamically det... Sam Dodgers PL/I & Assembler 6 Wed Jul 27, 2016 4:05 pm
No new posts Adding a descending character to a file Steve Ironmonger DFSORT/ICETOOL 3 Fri Jul 15, 2016 4:57 pm


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