Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need help in calling COBOL/DB2 program from REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Prasun De

New User


Joined: 17 Jan 2008
Posts: 28
Location: Kolkata, INDIA

PostPosted: Wed Jun 04, 2014 2:55 am    Post subject: Need help in calling COBOL/DB2 program from REXX
Reply with quote

Hi,

I have gone through the available threads on this topic. The code that is working for others is not working for me. Obviously I'm missing something.
Any help in figuring out what, would really be helpful.

I am using the below code
Code:

/*REXX*/
TRACE A
"ALLOCATE DATASET ('xxxxxxxxxxxxxxx') F(LOADDP) SHR"
"ALLOCATE DATASET ('x1',",
        "'x2',",
        "'x3',",
        "'x4',",
        "'x5',",
        "'x6',",
        "'x7') F(PROGLIB) SHR"
PARM='yyyy'
DROPBUF
QUEUE "RUN PROGRAM(pgm1) PARM('"PARM"') PLAN(testplan) LIB(PROGLIB)"
QUEUE "END"
"DSN SYSTEM(zzzz)"
"FREE FI(LOADDP PROGLIB)"
DROPBUF
EXIT


When I'm running this I'm getting the below trace

Code:

3 *-* "ALLOCATE DATASET ('xxxx') F(LOADDP) SHR"
  >>>   "ALLOCATE DATASET ('xxxx') F(LOADDP) SHR"
4 *-* "ALLOCATE DATASET ('x1',",
       "'x2',",
     "'x3',",                                            "'
x4',",                                        "'x5',",                                     "'x6',",                                        "'x7') F(PROGLIB) SHR"
       >>>   "ALLOCATE DATASET ('x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7') F(PROGLIB) SHR"
    11 *-* PARM='yyyy'
    12 *-* DROPBUF
       >>>   "DROPBUF"
    13 *-* QUEUE "RUN PROGRAM(pgm1) PARM('"PARM"') PLAN(testplan) LIB(PROGLI
B)"
    14 *-* QUEUE "END"
    15 *-* "DSN SYSTEM(zzzz)"
       >>>   "DSN SYSTEM(zzzz)"
DATASET NOT IN USE
    16 *-* "FREE FI(LOADDP PROGLIB)"
       >>>   "FREE FI(LOADDP PROGLIB)"
    17 *-* DROPBUF
       >>>   "DROPBUF"
    18 *-* EXIT
***


The message "DATASET NOT IN USE" seems to be the problem. But I don't know why it is happening.

Please Note : I have masked all the actual dataset, plan, program and DB2 SSID names.
Back to top
View user's profile Send private message

Pedro

Senior Member


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

PostPosted: Wed Jun 04, 2014 6:32 pm    Post subject: Reply to: Need help in calling COBOL/DB2 program from REXX
Reply with quote

Check the data sets in your search order. It seems like you have some local program called 'DSN'.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1247
Location: Israel

PostPosted: Thu Jun 05, 2014 4:47 pm    Post subject: Reply to: Need help in calling COBOL/DB2 program from REXX
Reply with quote

Funny, I always thought that the LIB parameter must specify a DSN, not a DD...

When I tried something similar to your code, I got message IKJ56228I and a return code of 8:
Code:
IKJ56228I DATA SET PROGLIB.LOAD NOT IN CATALOG OR CATALOG CAN NOT BE ACCESSED
       +++ RC(8) +++

(and that's because I have TSO PROF NOPREFIX, otherwise same message but for dataset myprefix.PROGLIB.LOAD)
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1247
Location: Israel

PostPosted: Thu Jun 05, 2014 4:52 pm    Post subject:
Reply with quote

Also, try TSO PROF MSGID before running your program.
If it is a system message, it will have an id (like IKJ56228I).
There will be no change if it is a message issued from one of your programs.
Back to top
View user's profile Send private message
Prasun De

New User


Joined: 17 Jan 2008
Posts: 28
Location: Kolkata, INDIA

PostPosted: Fri Jun 06, 2014 9:46 pm    Post subject: Re: Reply to: Need help in calling COBOL/DB2 program from RE
Reply with quote

Thanks guys for your feedback..

Marso wrote:
Also, try TSO PROF MSGID before running your program.
If it is a system message, it will have an id (like IKJ56228I).
There will be no change if it is a message issued from one of your programs.


I tried this.. no change..

Pedro wrote:
Check the data sets in your search order. It seems like you have some local program called 'DSN'.


You are right...
I looked at the SYSPROC and SYSEXEC libraries but found no DSN command.
But I found a DSN module in SYSTEM Linklist libraries, which say's whether a perticuler dataset is in use by which job or userID.

That explains why my code was not working.

Now, how to avoid it searching the system linklist.
I tried putting the ALTLIB command in the CLIST to specify executing the DSN command from '*.SDSNLOAD' library.
But that too did not work. I guess because the system linklists are getting searched before anything.

Is there an way out without contacting the my site system programmer.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Fri Jun 06, 2014 10:45 pm    Post subject:
Reply with quote

Please note that ALTLIB affects the SYSPROC and SYSEXEC concatenations, not the STEPLIB concatenation containing load modules. If you are running outside of ISPF, you can use the TSOLIB command to alter STEPLIB. If not, there are several third-party products that will do this; ask your support workgroups if your system has one installed.
Back to top
View user's profile Send private message
Prasun De

New User


Joined: 17 Jan 2008
Posts: 28
Location: Kolkata, INDIA

PostPosted: Sat Jun 07, 2014 12:41 am    Post subject:
Reply with quote

Akatsukami wrote:
Please note that ALTLIB affects the SYSPROC and SYSEXEC concatenations, not the STEPLIB concatenation containing load modules. If you are running outside of ISPF, you can use the TSOLIB command to alter STEPLIB. If not, there are several third-party products that will do this; ask your support workgroups if your system has one installed.


Thanks...
But I need my rexx to run under ISPF as I would need ISPF panels.. icon_sad.gif
Talked to one of the support guy, was not aware of any such third party softwate that can do the tsolib function under ISPF..

I guess the only way I'm seeing is to request system programmer to remove/rename that dsn local command from link list.

or I have to re-write all the cobol db2 code in rexx itself..to avoid that bumpy road of changing the old system, which no body has ever complained on.. icon_sad.gif
Back to top
View user's profile Send private message
Prasun De

New User


Joined: 17 Jan 2008
Posts: 28
Location: Kolkata, INDIA

PostPosted: Sat Jun 07, 2014 1:17 am    Post subject: Re: Reply to: Need help in calling COBOL/DB2 program from RE
Reply with quote

Marso wrote:
Funny, I always thought that the LIB parameter must specify a DSN, not a DD...

When I tried something similar to your code, I got message IKJ56228I and a return code of 8:
Code:
IKJ56228I DATA SET PROGLIB.LOAD NOT IN CATALOG OR CATALOG CAN NOT BE ACCESSED
       +++ RC(8) +++

(and that's because I have TSO PROF NOPREFIX, otherwise same message but for dataset myprefix.PROGLIB.LOAD)


Guess what guys I found that DSN is just an alias of DSNECP00. (may be only for our system)
So I used DSNECP00 instead of DSN which solved my problem of local DSN program. Then I understood the error you talked about in the above quote.
So I have removed the allocation and specified the loadlib directly... and it worked... WOW... Thanks guys...

My code now looks like below..

Code:

/*REXX*/
"ALLOCATE DATASET ('xxxx') F(LOADDP) SHR"
PARM='zzzz'
DROPBUF
DSN1='prefix.project.loadlib'
QUEUE "RUN PROGRAM(pgm1) PARM('"PARM"') PLAN(testplan) LIB('"DSN1"')"
QUEUE "END"
"DSNECP00 SYSTEM(SSID)"
"FREE FI(LOADDP)"
DROPBUF
EXIT
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Sat Jun 07, 2014 1:55 am    Post subject: Reply to: Need help in calling COBOL/DB2 program from REXX
Reply with quote

You did not say the origin of your DSN program... it could be a local tool. It is somehow mis-named. It seems inappropriate for your system programmers to allow such a name. I think the best solution is for that module to be renamed.

I think we have success in calling DB2 locally by using LIBDEF to ISPLLIB from our clist. The search order is ISPLLIB before the system linklist libraries.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 658
Location: Whitby, ON, Canada

PostPosted: Mon Jun 09, 2014 8:59 pm    Post subject:
Reply with quote

The LIBDEF to ISPLLIB approach also works in our shop. We need to do it that way because we have more than one DB2 subsystem in our development environment.
Back to top
View user's profile Send private message
Prasun De

New User


Joined: 17 Jan 2008
Posts: 28
Location: Kolkata, INDIA

PostPosted: Tue Jun 10, 2014 1:15 am    Post subject: Re: Reply to: Need help in calling COBOL/DB2 program from RE
Reply with quote

Pedro wrote:
You did not say the origin of your DSN program... it could be a local tool. It is somehow mis-named. It seems inappropriate for your system programmers to allow such a name. I think the best solution is for that module to be renamed.

I think we have success in calling DB2 locally by using LIBDEF to ISPLLIB from our clist. The search order is ISPLLIB before the system linklist libraries.


Yes.. it is a local tool.. talked to the system programmer.. could not be renamed as it is used widely in other tools... Anyway, I got a command DSTEPLIB which adds the SDSNLOAD to the linklist dynamically to resolev the conflict.

tried the LIBDEF as well, it changed the search order and picked up the DSN program but it abended saying DSNCEP10 module not found.. but it is present in the library I added to ISPLLIB using LIBDEF.
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 to send an email without SMTP Se... upendrasri All Other Mainframe Topics 4 Sun Nov 19, 2017 7:59 pm
No new posts ISREDIT Macro is not returning back t... nico_neoz CLIST & REXX 4 Sat Nov 18, 2017 7:40 pm
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts REXX LISTDSI () SMSINFO is not working upendrasri CLIST & REXX 4 Fri Nov 17, 2017 11:33 am
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 4 Wed Nov 15, 2017 4:27 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us