Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need a clarification on Edit Macro Code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Need a clarification on Edit Macro Code
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: 8620
Location: Back in jolly old England

PostPosted: Mon Jan 19, 2009 8:49 pm    Post subject:
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: 6970
Location: porcelain throne

PostPosted: Mon Jan 19, 2009 9:14 pm    Post subject:
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

Senior Member


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

PostPosted: Mon Jan 19, 2009 10:19 pm    Post subject: Reply to: Need a clarification on Edit Macro Code
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    Post subject:
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

Senior Member


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

PostPosted: Tue Jan 20, 2009 2:05 am    Post subject: Reply to: Need a clarification on Edit Macro Code
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    Post subject: Re: Reply to: Need a clarification on Edit Macro Code
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IBEGENER RETURN CODE 12 anilkumar922 All Other Mainframe Topics 5 Wed Dec 13, 2017 11:41 am
No new posts Finding the plan when code compiled u... Ahemad DB2 1 Fri Dec 01, 2017 6:38 pm
No new posts Strange Code amitc23 COBOL Programming 6 Tue Nov 28, 2017 11:25 am
This topic is locked: you cannot edit posts or make replies. ISREDIT Macro is not returning back t... nico_neoz CLIST & REXX 21 Sat Nov 18, 2017 7:40 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us