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
 

 

Invoking another version from within a program

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

New User


Joined: 15 Aug 2008
Posts: 3
Location: Chicago IL

PostPosted: Mon Aug 18, 2008 10:48 pm    Post subject: Invoking another version from within a program
Reply with quote

I have this requirement where I want to invoke a different version of a program based on the parameter value.

Example:
JCL:
//STEP010 EXEC PGM=PROGX,PARM='A'
//STEPLIB DD DSN=NEW.LOADLIB,DISP=SHR

PROGX is a REXX program (compiled and link-edited). If the PARM value is 'A', then the PROGX REXX program should invoke an older version of PROGX located in OLD.LOADLIB. Since the above REXX program executes in a non-TSO address space, I cannot use the TSO CALL statement(CALL statement allows us to specify the full path of a load module). So, I am trying to use the LINKMVS or ATTCHMVS command to invoke the old version of PROGX. However, it looks like we cannot include a load library in the LINKMVS and ATTCHMVS commands. Is there a way to accomplish this thru any other means?

Appreciate your help.
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 Aug 18, 2008 11:08 pm    Post subject:
Reply with quote

Hello,

Set a return code based on the parm and have 2 steps that conditionally execute - One with the "old" lib and The Other with the current lib specified in the STEPLIB.

Another way to accomplish this is to rename the old one to modnameo while the current module is modname.
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Mon Aug 18, 2008 11:39 pm    Post subject:
Reply with quote

To elaborate on Dick's naming scheme, have the variable 'A' be the suffix of the old progam name. Both old and new in a common STEPLIB.
Code:
//OLD  SET TYPE=A
//STEP1 EXEC PGM=PROGX&TYPE
or set TYPE= to null value to pick new pgm.
Back to top
View user's profile Send private message
AmritrajKurup

New User


Joined: 15 Aug 2008
Posts: 3
Location: Chicago IL

PostPosted: Tue Aug 19, 2008 1:06 am    Post subject: Reply to: Invoking another version from within a program
Reply with quote

Thanks for the quick reply. But I am looking for a way in REXX that will enable me to invoke a program from a specific load library. I think I should have given some details about why I am trying to accomplish this. I have about 3000 batch jobs that use a particular vendor utility. We are trying to develop a wrapper program with the same name as the vendor utility so that we won't have to make any changes to the JCLs. The wrapper program will by default invoke the new utility but should also have the ability to invoke the old vendor utility if a different parm value is passed to it. Please let me know if you have any suggestions.

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

Global Moderator


Joined: 06 Jun 2008
Posts: 7995
Location: Bellevue, IA

PostPosted: Tue Aug 19, 2008 1:20 am    Post subject:
Reply with quote

Either the new program or the old vendor utility has to be renamed to a unique name. You can concatenate multiple libraries in your STEPLIB or JOBLIB DD statement but the first library to contain the named module is the library used and there's no way that I know of to change this. So using the same name for old and new means the one concatenated after the other one will never be available.
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: Tue Aug 19, 2008 1:21 am    Post subject:
Reply with quote

Hello,

You could rename the vendor utility and when your wrapper determined tha original version of the module be invoked, invoke the renamed module.

Before doing this with the "real" load module, a copy and some testing would be good. . .
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Tue Aug 19, 2008 2:19 am    Post subject: Reply to: Invoking another version from within a program
Reply with quote

REXX is great, but not always the best tool for the job. I think you could easily do this by calling an assembler routine which:

1. opens vendor library DD name.
2. uses LINK macro specifying program name, with DCB parameter to specify DD name.
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: Tue Aug 19, 2008 2:27 am    Post subject: Reply to: Invoking another version from within a program
Reply with quote

Hi Pedro,

Quote:
REXX is great, but not always the best tool for the job.
Completely agree.

And have similar feelings about the often over/mis-use of the sort product on a system too. . .

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

New User


Joined: 15 Aug 2008
Posts: 3
Location: Chicago IL

PostPosted: Tue Aug 19, 2008 2:35 am    Post subject: Reply to: Invoking another version from within a program
Reply with quote

Thank you. I will try the Assembler routine approach. Appreciate the quick responses from everyone.
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 GDG version number PANDU1 JCL & VSAM 4 Sat Mar 04, 2017 8:28 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm


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