View previous topic :: View next topic
|
Author |
Message |
AmritrajKurup
New User
Joined: 15 Aug 2008 Posts: 3 Location: Chicago IL
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
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 |
|
|
AmritrajKurup
New User
Joined: 15 Aug 2008 Posts: 3 Location: Chicago IL
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
AmritrajKurup
New User
Joined: 15 Aug 2008 Posts: 3 Location: Chicago IL
|
|
|
|
Thank you. I will try the Assembler routine approach. Appreciate the quick responses from everyone. |
|
Back to top |
|
|
|