IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to change dates in a jcl using Rexx? And more....


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
LeeWebb

New User


Joined: 19 Jan 2007
Posts: 11
Location: southampton, uk

PostPosted: Fri Jan 19, 2007 11:19 pm
Reply with quote

Hi,

I'm an operator, not a programmer, but in my time I have written lots of macros in rexx. Unfortunately, it's been a while now since I did anything in rexx and, since I was self taught, I'm having to relearn it.

I've been given the task of automating a process that involves the data control guys manually updating the dates in their jcls. These jcls (200 or so) are filled with several different date parameters formatted like this 310107010107 etc etc. These dates need to be changed to reflect the new calendar month/tax period. It's been suggested that I create another rexx macro or xedit file that will act as a database for all the different date types.

In doing a bit of research to refresh my rexx memory I have found several threads that suggest I could run a rexx macro from within a batch job. I'm thinking that this coould help me. Is this possible? Is this even the best way to do it?

The rexx macros I've run before just run in cms and they would interact with jcls or they would call another rexx macro to for instance create a backup jcl....things like that. Never before have I run, or known that I could run, a rexx from a batch job.

What is the best way to do this?

Sorry to go on, but I'm not sure of the best way to pose my question.

I thank you in advance for any help you can offer

Lee

p.s. We run a mainframe system running VM, VSE/ESA, and CMS. I would write my REXX in XEDIT....

Cheers
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Sat Jan 20, 2007 1:59 am
Reply with quote

Hello Lee,

If I understand you correctly, here is what you want


1) Is it possible to run REXX from JCL ?
==================

yes its possible, see below the example


2) REXX macro is reading input file say A, now you want to make it to read a different file say 'B' and the change should be done in JCL not inside rexx..

EXAMPLE:

jcl:
===

PARM1 is the name of your rexx program/macro
PARM1 should be present in USERID.REXX.MACLIB



//*
//STEPREX EXEC PGM=IKJEFT01,
// PARM='PARM1 '
//SYSEXEC DD DSN=USERID.REXX.MACLIB,
// DISP=SHR
//SYSTSIN DD DUMMY
//INDD1 DD DSN=USERID.REXXINP.FILE1,
// DISP=OLD
//INDD2 DD DSN=USERID.REXXINP.FILE2,
// DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//

REXX:
===

/* rexx */

ADDRESS TSO
"EXECIO * DISKR INDD1 (STEM INMEMB1. FINIS"

if rc > 0 then exit

"EXECIO * DISKR INDD2 (STEM INMEMB2. FINIS"

exit
============


now what ever you assign to INDD1/INDD2 in JCL, rexx will read it.
Back to top
View user's profile Send private message
LeeWebb

New User


Joined: 19 Jan 2007
Posts: 11
Location: southampton, uk

PostPosted: Sat Jan 20, 2007 7:35 pm
Reply with quote

Hi jz,

Thanks for your reply. There are some things that I don't understand though and it may be that I am just in over my head. Tell me what you think.

Firstly:
jcl:
===

PARM1 is the name of your rexx program/macro
PARM1 should be present in USERID.REXX.MACLIB - What is this library? Do I need to put my rexx program into that library? How do I do that?



//*
//STEPREX EXEC PGM=IKJEFT01, - What is this?
// PARM='PARM1 '
//SYSEXEC DD DSN=USERID.REXX.MACLIB,
// DISP=SHR
//SYSTSIN DD DUMMY
//INDD1 DD DSN=USERID.REXXINP.FILE1,
// DISP=OLD
//INDD2 DD DSN=USERID.REXXINP.FILE2,
// DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//

Can you please tell me what this jcl step is doing?

Secondly:
REXX:
===

/* rexx */

ADDRESS TSO
"EXECIO * DISKR INDD1 (STEM INMEMB1. FINIS"

if rc > 0 then exit

"EXECIO * DISKR INDD2 (STEM INMEMB2. FINIS"

exit
============


Please explain what this is doing.

I'm not at work at the moment, but when I'm back I can paste in some of the jcl I'll be working with and perhaps some rexx code that I've done.

again, thanks for your time.

Lee
Back to top
View user's profile Send private message
LeeWebb

New User


Joined: 19 Jan 2007
Posts: 11
Location: southampton, uk

PostPosted: Mon Jan 22, 2007 1:50 pm
Reply with quote

Here is an example of the jcl I need to be changing the dates to. In this part there are only a few different dates but there are lots more further on. Some of these jcl decks are 900 lines long!

So basically, with every new period, the criteria that the date parms are based on will change. I need to make something to automate that.

* ?? JOB JNM=784RUN,CLASS=K,DISP=H,SYSID=1
* ?? LST LST=SYSLST,CLASS=Z,DISP=L
// JOB 784RUN
// OPTION NOLOG
/*
// GOTO GL
/*
/* PERIOD = 10
/*
// LIBDEF PHASE,SEARCH=UNILIB.PROD
// DLBL GPFILE,'P784.UNIPAY.GROUP',,VSAM,CAT=BD9CAT
// DLBL TABDIR,'P784.UNITAB.TABLES',,VSAM,CAT=BD9CAT
// EXEC UNIPAYX,SIZE=AUTO
/INCLUDE GROUP784 LIVE
G10784 101 310107310107310107 010107310107

/*
// LIBDEF PHASE,SEARCH=UNILIB.PROD
// DLBL GPFILE,'P784.UNISSP.GROUP',,VSAM,CAT=BD9CAT
// EXEC UNIPERX,SIZE=AUTO
P10784 102006 01042003 30042003 102006

/*
// DLBL IJSYSUC,'BIM.BD0009.CAT',,VSAM
// EXEC IDCAMS,SIZE=AUTO
/INCLUDE 784 DEL
/INCLUDE 784


Any further help much appreciated.

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

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Tue Jan 23, 2007 1:58 am
Reply with quote

Hello Lee,

What you have here is a skeleton of JCL.... you need to modify this JCL and change the dates based on some condition..

//INCLUDE GROUP784 LIVE
G10784 101 310107310107310107 010107310107
/*

What I have listed in one //include, but you have many inlcudes in JCL where you need to modify the dates.. is that correct?


if thats correct, please send me the sample/skeleton JCL and the sample conditions (based on which) you want to modify the dates.

Please write down the requirements and sample jcl's conditions.. I will try to write the rexx for you..
Back to top
View user's profile Send private message
LeeWebb

New User


Joined: 19 Jan 2007
Posts: 11
Location: southampton, uk

PostPosted: Tue Jan 23, 2007 2:00 pm
Reply with quote

Hi,

Thanks for your reply. By now you've probably realised (as I have since found out) that I am not using the MVS version of REXX which I now understand is different. This is a problem cos I think I've stumbled upon things that I thought I was gonna be able to do, like invoke a REXX from a jcl, and now I realise that perhaps this isn't possible with the version that I am using. Bummer. Let's just say that the company I work for is, ahem, stuck in the dark ages. For the record, we are running z/vm, with z/vse version 2.7.3.

Anyway, onto the jcl. There are no parms that need modifying in any of the includes in the jcl. The dates that need changing are beneath the include line that I showed as an example. The thing is that there are many of these kind of date parms that occur throughout the jcl, and they depend on different criteria. For instance, the 310107 date is the last day of the current period, of the current year. The 010107 date is clearly the first day of the same. These are quite simple but other dates are less obvious. What the user wants to do is edit the jcl and merely change a period date parm at the top, save it and submit it. Whilst submitting, the jcl will be intercepted by the REXX program and the appropriate dates will then be changed throughout the jcl.

I appreciate you coming back to me on this. I don't expect you to write the jcl/rexx for me, that would be asking too much of your time. But any help would be gratefully received.

Thanks

Lee
Back to top
View user's profile Send private message
LeeWebb

New User


Joined: 19 Jan 2007
Posts: 11
Location: southampton, uk

PostPosted: Tue Feb 13, 2007 6:39 pm
Reply with quote

So doesn't anyone around here use vm/vse esa 2.7 rexx?
Back to top
View user's profile Send private message
LeeWebb

New User


Joined: 19 Jan 2007
Posts: 11
Location: southampton, uk

PostPosted: Mon Mar 05, 2007 5:48 pm
Reply with quote

Can anyone help me with this?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 05, 2007 6:28 pm
Reply with quote

If memory serves me correctly, there should be a spooler exit that should work for you, allow you to see the period number and convert the following dates while submitting.
Back to top
View user's profile Send private message
LeeWebb

New User


Joined: 19 Jan 2007
Posts: 11
Location: southampton, uk

PostPosted: Mon Mar 05, 2007 6:30 pm
Reply with quote

I'm sorry William, can you explain a bit more, that means nothing to me as is.

Thanks
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 05, 2007 6:38 pm
Reply with quote

LeeWebb wrote:
I'm sorry William, can you explain a bit more, that means nothing to me as is.
Good, now you can see how we feel when your requirement seems to morph from
Quote:
These jcls (200 or so) are filled with several different date parameters formatted like this 310107010107 etc etc. These dates need to be changed to reflect the new calendar month/tax period.
to
Quote:
What the user wants to do is edit the jcl and merely change a period date parm at the top, save it and submit it. Whilst submitting, the jcl will be intercepted by the REXX program and the appropriate dates will then be changed throughout the jcl
icon_confused.gif
Just what are you trying to accomplish?
What tools do you have in your environment?
Back to top
View user's profile Send private message
LeeWebb

New User


Joined: 19 Jan 2007
Posts: 11
Location: southampton, uk

PostPosted: Mon Mar 05, 2007 6:52 pm
Reply with quote

I'm sorry I was so vague william. I'm a newbie here and I was just trying to get some help, so please be nice.

As I stated above, I am not really a programmer per se, merely a keen operator. Initially, I was confused as to which version of Rexx has been used in the examples given. I seem to be using a much older version. I've since established that I am using Rexx370 4.02 according to RexxVer. Anyway, I am using vm/esa 2.7.3 and editing with xedit under CMS.

Mission: My payroll manager has to update several hundred jcl's each month to reflect the new tax period. The new period means changes to several different formats of parms within the jcl, such as 010307 or 01032007 and 01/03/07 etc etc. These parms appear throughout the jcl and not on the same line every time. ie some of these jcl's are 200 lines some are 900.

I imagined I would use variables for the parms such as ddmmyy for 010307 etc so I would need the program to update the parms, submit the jcl and then change them back again to the variable names.

Does this make any more sense William?

p.s. I know how to get all the date info, it's just a case of figuring out the best way to update/write it to the jcl.

Thanks for your time.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 05, 2007 7:49 pm
Reply with quote

Why change them if you can leave them dynamic?
What's wrong with just putting them in a lib and including them?
Why the need to batch exec when you might be able to REXX against the JCL lib and change all in one execution?

Besides, I don't know REXX, heck, I can hardly spell it..... icon_wink.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Mar 05, 2007 9:46 pm
Reply with quote

Hello,

Does your site have VOLLIE?

If it does, you should be able to write "voice procs" to do what you need.

If not, you might might consider ICCF or VM/Xedit.

It has been a long time since i worked in a VM/VSE environment, but i believe you can do what you need without REXX if that would help.
Back to top
View user's profile Send private message
LeeWebb

New User


Joined: 19 Jan 2007
Posts: 11
Location: southampton, uk

PostPosted: Mon Mar 05, 2007 10:35 pm
Reply with quote

William Thompson wrote:
Why change them if you can leave them dynamic?
What's wrong with just putting them in a lib and including them?
Why the need to batch exec when you might be able to REXX against the JCL lib and change all in one execution?

Besides, I don't know REXX, heck, I can hardly spell it..... icon_wink.gif


I'm gonna sound dumb here but..what?

Leave them dynamic? Cos they need to be updated and it takes the user ages.

Putting them in a lib? Explain how I would do that please.
Back to top
View user's profile Send private message
LeeWebb

New User


Joined: 19 Jan 2007
Posts: 11
Location: southampton, uk

PostPosted: Mon Mar 05, 2007 10:37 pm
Reply with quote

dick scherrer wrote:
Hello,

Does your site have VOLLIE?

If it does, you should be able to write "voice procs" to do what you need.

If not, you might might consider ICCF or VM/Xedit.

It has been a long time since i worked in a VM/VSE environment, but i believe you can do what you need without REXX if that would help.


VOLLIE? Never heard of it.

Never used ICCF but I think we have it. I use VM/Xedit. You can see examples of the jcl above. Any clues as to how you think I can do it Dick?

Thanks for your time.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Mar 05, 2007 11:14 pm
Reply with quote

You're welcome icon_smile.gif

CA-VOLLIE is the VSE product that does similar things to CA-ROSCOE in the MVS environment. Both are editors with a built-in programming language. If it was in use in your shop, i suspect you'd be aware of it.

If you talk with your system programmer(s), they should be able to show you some examples of things you can do w/ ICCF and/or Xedit to automate your requirement.

Sorry not to be much help, but it has been quite a while and i did things like this using Vollie.

Good Luck and keep us posted on how it goes icon_smile.gif
Back to top
View user's profile Send private message
LeeWebb

New User


Joined: 19 Jan 2007
Posts: 11
Location: southampton, uk

PostPosted: Tue Mar 06, 2007 7:19 pm
Reply with quote

Hi Dick,

Apparently, we don't use ICCF anymore. We use Xedit under CMS under VM/ESA 2.7.3

I use Rexx, written in Xedit. My system programmers are far too busy to help me with this. That's why it was given to me as a Rexx project as I've done some stuff in Rexx before. But, I feel that there must be an easier way to do this, as has been implied on this forum but not with any real examples.

Do you get the gist of what I'm trying to do?

Thanks again,

Lee
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Mar 16, 2007 6:05 pm
Reply with quote

How many date variations are there ?

Without knowing your set up there my initial suggestion would be to have a few datasets / PDS members with the dates in, and change the JCL's to reference these DSN's / PDS's instead of having the date cards instream.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Mar 17, 2007 4:14 am
Reply with quote

Hi Expat,

This task is on a VM/VSE mainframe, not MVS.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Mar 17, 2007 11:33 pm
Reply with quote

Hi Dick,

I can only recall CMS from my dark and distant experiences of VM. Very dark experiences I may add.

Sure that we used datasets or files to do something similar
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sun Mar 18, 2007 1:23 am
Reply with quote

Hi Expat,

Yup, my experience was distant as well. As i recall this sort of thing was done in xedit or REXX. It has just been so long that i do not recall the actual code used. Over time we learn more (hopefully), but things learned and not used tend to fade away icon_smile.gif

Hi Lee,

Yes, i do get the gist of what you are working on. I just cannot recall how we did that in detail. I do believe that REXX inside xedit is a good way to proceed.

There are some "date" samples here:http://www.texasrock.com/examples.shtml

Good Luck and i'll keep trying to remember and/or see if i've still got any of it filed away somewhere.
Back to top
View user's profile Send private message
Ditchital

New User


Joined: 24 Aug 2022
Posts: 1
Location: Ireland

PostPosted: Wed Aug 24, 2022 3:20 pm
Reply with quote

Hi everyone, great to see you all responding to this query, however, when posting JCL examples bear in mind we are talking about VSE and VSE JCL and not an MVS environment. Rexx itself has a very powerful built-in date function.
If you are generating JCLs for VSE under CMS, you could possibly generate include members via CMS rexx and let the submit dynamically bring them into the JCL jobstream, if my memory serves me right!! there are possibly quite a few alternatives, but without knowing exactly how you have things set up, it is difficult to come up with the most appropriate one.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1245
Location: Bamberg, Germany

PostPosted: Wed Aug 24, 2022 5:37 pm
Reply with quote

Thank you so much for resurrecting a 15 year old topic. Please, start a new thread if necessary, makes more sense.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top