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
 

 

Changing job card using rexx

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

New User


Joined: 17 Jun 2012
Posts: 20
Location: INDIA

PostPosted: Sat Aug 04, 2012 11:12 pm    Post subject: Changing job card using rexx
Reply with quote

My requirement is to removie NOTIFY=&SYSUID on all the members in a pds.

In some jobs the NOTIFY parameter is like

//jobanme xxxx,MSGCLASS=A,REGION=99M,
// NOTIFY=&SYSUID

in the above case we can actually delete the line
// NOTIFY=&SYSUID

But then my JOBCARD changes as
//jobanme xxxx,MSGCLASS=A,REGION=99M,

here after REION=99M parameter a comma is there which should also be deleted.

In some other jobs
//jobanme xxxx,MSGCLASS=A,NOTIFY=&SYSUID,REGION=99M

In this case we can use ISREDIT macro by specifying
C All 'NOTIFY=&SYSUID,' ''

Like this there several permutations for different JOBCARDS so ultimately i have to remove NOTIFY=&SYSUID parameter from all them members in a PDS.


My Second requirement is

I have to chnage a value like

SET CNTL=&X to SET CNTL=&P

but the values of X can change like there are several values for X in above example like X can be A,B,C,D or M1 OR M2 .... so irrespective of that X value i need to change it to P
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Aug 05, 2012 12:10 am    Post subject:
Reply with quote

i would do a find on sysuid,
determine line number - call it sysln
then do a find for '//*' in 1 between lines 1 and sysln
if found:
write a report saying this member too hard
exit and process the next pds member.
if not found:
su** all the lines from 1 to sysin into a stem.
then build a continuous line from the stem contents (omitting col 72-80 and 1 and 2)
remove ',NOTIFY=&SYSUID'
rebuild the lines into the stem
replace the lines 1 thru sysin.

Second requirement is easier.

in a loop (if there can be more than 1 "SET CNTL" in a member)
find 'SET CNTL'
su** the line data into a variable
find the position of SET CNTL (pray that there are no SET CNTL with two or more spaces between SET and CNTL)
replace the SET ... with what you want in your variable
use your variable to replace the line in the member.

by the way 'suc*' is being used to replace s u c k
because some second rate webpage coder decided that
it was a bad fucking word.
Back to top
View user's profile Send private message
southee

New User


Joined: 17 Jun 2012
Posts: 20
Location: INDIA

PostPosted: Sun Aug 05, 2012 12:53 am    Post subject:
Reply with quote

Hi,

Could you please explain below

once i do a find command on SYSUID i will take that line into a SYSLN

then on that line how would i do a find on first two lines?
is there a way to read letter by letter in that line i.e. SYSLN line....??

I didnt understand this part could you please code or guide me to any post where this is done.

Thank you for your reply.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Aug 05, 2012 1:39 am    Post subject:
Reply with quote

sysln is just a name i gave to the variable that would receive the input
of the EDIT Macro Command and assignment statement: CURSOR -
the line where the FIND command found the target.

knowing the line number of the statement allows you to Set or Query a line from the dataset using the LINE command

Though there are newer versions of the ISPF EDIT and EDIT Macros Manual
this will suffice for what you wish to accomplish.
have a good read.

As you code your macro, when you encounter problems,
open a thread and someone will be able to help you.
as you are debugging your Edit Macro, remember to use the REXX TRACE command in your script.
I personally use the ?R option.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sun Aug 05, 2012 2:25 am    Post subject:
Reply with quote

Possibly not a good thought, however, would not just changing "NOTIFY=&SYSUID" to "NOTIFY=" suffice instead of removing it completely?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Aug 05, 2012 2:43 am    Post subject:
Reply with quote

will NOTIFY=
generate a JCL error?

as a side note:

at many sites that I have worked at,
(that are not overrun with the uneducated idiots
always whining about performance and disc utilization,
even though they have not bothered to learn
that hardware is cheaper of that and software maintenance)
all JOB and EXEC statement parameters are always one (1) to a line.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sun Aug 05, 2012 12:01 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
will NOTIFY=
generate a JCL error?
That was the very first thought, however, with z/OS 01.11.00, JES2 - both of this worked, no JCL error. I've not verified with manuals much though:
Code:
//JOBNAME JOB (@),'SORT',             
//        CLASS=0,TIME=(,30),NOTIFY=
and
Code:
//JOBNAME JOB (@),'SORT',             
//        NOTIFY=,CLASS=0,TIME=(,30)
Back to top
View user's profile Send private message
southee

New User


Joined: 17 Jun 2012
Posts: 20
Location: INDIA

PostPosted: Sun Aug 05, 2012 12:39 pm    Post subject:
Reply with quote

Anuj Dhawan wrote:
dbzTHEdinosauer wrote:
will NOTIFY=
generate a JCL error?
That was the very first thought, however, with z/OS 01.11.00, JES2 - both of this worked, no JCL error. I've not verified with manuals much though:
Code:
//JOBNAME JOB (@),'SORT',             
//        CLASS=0,TIME=(,30),NOTIFY=
and
Code:
//JOBNAME JOB (@),'SORT',             
//        NOTIFY=,CLASS=0,TIME=(,30)


Anuj Thank you.

But According to the Clients requirement (These changes are maded to the JOB cards during the Production install) The NOTIFY=&SYSUID parameter whole Including NOTIFY= should be removed so i was working the way DBZ suggested.

Your idea works fine if my requirement would have been to dummy &sysuid parameter. But there are some standards that need to be followed when installing in production so that time my job card should not have Notify parameter itself.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Aug 05, 2012 1:49 pm    Post subject:
Reply with quote

thx for the feedback, Anuj

Southee,

if you were to do a 3.12 of the pds's searching for NOTIFY=
and another for CNTL

you could visualize what your logic would have to be to make the necessary modification.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sun Aug 05, 2012 5:43 pm    Post subject: Reply to: Changing job card using rexx
Reply with quote

see here for a jcl parser example ( working )

http://www.ibmmainframes.com/viewtopic.php?t=32494&highlight=jcl+parser

rebuilding the job card with just the needed parameters should be trivial
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 175
Location: UK

PostPosted: Mon Aug 06, 2012 1:58 pm    Post subject:
Reply with quote

Do you have any tools that "understand" JCL such as Job/Scan?

If so, they should do what you want quite easily.
Back to top
View user's profile Send private message
southee

New User


Joined: 17 Jun 2012
Posts: 20
Location: INDIA

PostPosted: Tue Aug 07, 2012 5:30 pm    Post subject:
Reply with quote

David Robinson wrote:
Do you have any tools that "understand" JCL such as Job/Scan?

If so, they should do what you want quite easily.


We have JJ scan or JJ for knowing the Syntax errors in the JCL. But how would JJ or JJSCAN help my requirement??
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 175
Location: UK

PostPosted: Tue Aug 07, 2012 5:51 pm    Post subject: Reply to: Changing job card using rexx
Reply with quote

I'm not familiar with JJ or JJSCAN, but if it has the same functionality as Job/Scan then you can also use it to change JCL as well as check it.

Because it understands the syntax of JCL statements, it will maintain their integrity when doing changes. So, for example, if you remove a particular statement, and this statement is the last statement, then it knows that the previous statement has to have it's comma removed, even if that is on a previous line.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Tue Aug 07, 2012 9:39 pm    Post subject: Reply to: Changing job card using rexx
Reply with quote

You need handle multiple cases. Write an editor macro that:

If comma precedes it, there are other parameters on the same line and you only need to make the change
CHANGE ',NOTIFY=&SYSUID' '' ALL

For the second case with comma following, there are other parameters on the same line and you only need to make the change:
CHANGE 'NOTIFY=&SYSUID,' '' ALL


For the third case, it is guaranteed that there is only one parameter on the line and you need to worry about the continuation:
1. FIND 'NOTIFY=&SYSUID'
2. CHANGE ',' ' ' PREV
3. FIND 'NOTIFY=&SYSUID'
4. DELETE .ZCSR
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Wed Aug 08, 2012 4:01 am    Post subject: Reply to: Changing job card using rexx
Reply with quote

Quote:
For the second case with comma following, there are other parameters on the same line and you only need to make the change:
CHANGE 'NOTIFY=&SYSUID,' '' ALL


Maybe that was not the right assumption. You probably also need to handle the case where it is the only parameter on the line, but there are more on the next line. You should delete the line.
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


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