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
 

 

Finding a string containing "&" in an edit mac

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
Josh Keller

New User


Joined: 08 Oct 2007
Posts: 36
Location: Columbia, SC

PostPosted: Tue Jun 24, 2008 8:18 pm    Post subject: Finding a string containing "&" in an edit mac
Reply with quote

I'm writting an edit macro in rexx to replace several strings in JCL. When the macro attempts to find a JCL symbolic &CYCID for example, it's interpreting the string as a embedded pattern, so the string is not found.


Question: How can the edit macro change a string if it contains a "&" ?

Example:
STR = "&CYCID"
"ISREDIT FIND '"STR"' NEXT"

This expample returns an error reporting that STR is null.




My backup plan is to scan through the JCL and use the POS command to find the strings in question. But this has got me thinking if there is a way to do it using the ISREDIT commands.

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

dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jun 24, 2008 8:52 pm    Post subject:
Reply with quote

dealing with &, I usually start my macro by changing all & to :.

, if I know that there will be no colons <:>. or some other char.

changing to an x'??' means that you can not use the 1st char unless it is a printable.

if I am only looking for one char, then I will use the x'??' format (for example x'ff').

in your case you are looking for &?????, so make it icon_confused.gif???? or #?????, by a CHG ALL '&'' ':'. Then at the end of your macro, change all : to &.
Back to top
View user's profile Send private message
Josh Keller

New User


Joined: 08 Oct 2007
Posts: 36
Location: Columbia, SC

PostPosted: Tue Jun 24, 2008 9:33 pm    Post subject: Reply to: Finding a string containing "&" in a
Reply with quote

I didn't think about hex... so your post gave me an idea.

I used the C2X function and converted my strings to hex, then did a FIND X"'"HEXSTR"'" It worked like a champ.


Thanks,

Josh
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 Amount field is getting corrupted whe... thesumitk SYNCSORT 5 Tue Oct 18, 2016 8:20 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm


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