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

Need a clarification on Edit Macro Code


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prabhu.kumar

New User


Joined: 05 May 2008
Posts: 2
Location: India,Bangalore

PostPosted: Mon Jan 19, 2009 8:10 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Jan 19, 2009 8:49 pm
Reply with quote

I usually have SAVE as the last command before I exit a macro
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Jan 19, 2009 9:14 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Jan 19, 2009 10:19 pm
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Jan 19, 2009 10:51 pm
Reply with quote

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:
Code:
C P'<' P'>' ALL

Change all lower case to upper case.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Jan 20, 2009 2:05 am
Reply with quote

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
View user's profile Send private message
prabhu.kumar

New User


Joined: 05 May 2008
Posts: 2
Location: India,Bangalore

PostPosted: Tue Jan 20, 2009 10:14 am
Reply with quote

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
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
Search our Forums:

Back to Top