View previous topic :: View next topic
|
Author |
Message |
prabhu.kumar
New User
Joined: 05 May 2008 Posts: 2 Location: India,Bangalore
|
|
|
|
Hi,
Iam creating a edit macro tool to convert production JCL into test region JCL
My requirement is :-
If line contains any of the below
1. ".TAPED04.GXXXXXX" where XXXXXX is any numeric value
2. "VOL=SER=XXXXXX" where XXXXXX is any alphanumeric value for Ex:DSSC01
To be
1. ".ST"
2. "VOL=SER=TESTTI"
My Code:-
/*REXX*/
ADDRESS ISREDIT; MACRO
C ALL P'.TAPED05.G=======' '.ST'
C ALL P'VOL=SER=======' 'VOL=SER=TESTTI'
EXIT 0
Problem:- Using the above code the changes are not reflecting and it doesn't throw any error as well. Please let me know how to go about it. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I usually have SAVE as the last command before I exit a macro |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
it doesn't throw any error as well
|
why would it throw an error, you are not checking for any..
C ALL P'.TAPED05.G=======' '.ST'
C ALL P'VOL=SER=======' 'VOL=SER=TESTTI'
add this after each change all:
CHGRC = RC
IF chgRC<>0 THEN
DO
SAY 'CHG ALL TAPED return: ' chgrc
end
If you are not receiving RC = 0, then you are having no-hits, which means your change mask is incorrect, or there is nothing to change.
If this is an EDIT IMACRO (initial macro) - invoked via EDIT session call syntax, as expat says, add a SAVE at the end. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
I would enclose the whole thing in double quotes:
Code: |
"C ALL P'.TAPED05.G=======' '.ST'"
"C ALL P'VOL=SER=======' 'VOL=SER=TESTTI' " |
Reason: both rexx language and macro syntax use the quote characters. Rexx will resolve all of the parts of the line that it can before passing it to the editor macro processing. You do not want rexx to process the quotes.
Without the wrapping quotes, the rexx processor will look for variables for C and ALL and P. If it does not find any, it will use their name as the value. Lastly, it will concatenate the P with the constant of 'VOL=SER===' to create a string of "PVOL=SER===", which is not what you want to do. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
I am surprised you're not getting errors on both of your CHANGE commands. Why is there a P before your first single quote? P is generally used for changing a character type not a character as in:
Change all lower case to upper case. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Those change commands have valid picture clauses... but rexx is removing the quote before sending it to the editor, as explained in my previous post. |
|
Back to top |
|
|
prabhu.kumar
New User
Joined: 05 May 2008 Posts: 2 Location: India,Bangalore
|
|
|
|
Pedro wrote: |
I would enclose the whole thing in double quotes:
Code: |
"C ALL P'.TAPED05.G=======' '.ST'"
"C ALL P'VOL=SER=======' 'VOL=SER=TESTTI' " |
Reason: both rexx language and macro syntax use the quote characters. Rexx will resolve all of the parts of the line that it can before passing it to the editor macro processing. You do not want rexx to process the quotes.
Without the wrapping quotes, the rexx processor will look for variables for C and ALL and P. If it does not find any, it will use their name as the value. Lastly, it will concatenate the P with the constant of 'VOL=SER===' to create a string of "PVOL=SER===", which is not what you want to do. |
I tried using double quotes and it is working fine now, thanks for your time and for the solution |
|
Back to top |
|
|
|