Try this: PROC 0 CONTROL ASIS ISREDIT MACRO ISREDIT CAPS OFF ISREDIT CHANGE "LOWER" "lower" word all ISREDIT RESET EXIT CODE(0)
On Wed, 17 Sep 2025 19:08:49 +0000, Schmitt, Michael <[email protected]> wrote: >There's something more subtle going on. And, the original example works for me: > >/* REXX */ >address ISREDIT > "MACRO" > CAPS OFF > CHANGE 'AAA' 'Aaa' ALL > exit > >If I execute it on itself I get: > >/* REXX */ >address ISREDIT > "MACRO" > CAPS OFF > CHANGE 'Aaa' 'Aaa' ALL > exit > >which is as expected. > >Yes, t is treating CAPS, OFF, CHANGE, and ALL as variables, so they have >their own uppercase value. But 'AAA' and 'Aaa" are literals, not variables. So >the command to Edit should be: > > CHANGE AAA Aaa ALL > >And Edit preserves entered case on the "to" string of a change command; it is >same as CHANGE AAA c'Aaa' ALL. > >So why didn't it work for the original poster? > >Note: I'm on z/OS 2.5. > >-----Original Message----- >From: IBM Mainframe Discussion List <[email protected]> On Behalf Of >Phil Smith III >Sent: Wednesday, September 17, 2025 12:43 PM >To: [email protected] >Subject: Re: Edit macro CHANGE not preseriving case > >Assuming your code is Rexx, what you're missing is that your double quotes are >being consumed by Rexx. What you're passing on the CHANGE is: > >(variable) ISREDIT >(space) >(variable) CHANGE >(space) >(literal) LOWER >(space) >(literal) lower >(space) >(variable) WORD >(space) >(variable) ALL > >Now, none of those variables have (presumably) been set, so their values are >the uppercase versions of the variable name. Thus what ISPF sees is: >ISREDIT CHANGE LOWER LOWER WORD ALL > >In other words, your quotes aren't getting to ISPF. Hence the quotes in Chip's >version: >"ISREDIT CHANGE 'LOWER' 'lower' word all" > >That makes the ENTIRE command a literal to Rexx, so it gets passed as is >(minus the single quotes), and ISPF sees what you want it to see. > >Make sense? This is basic Rexx stuff but gets confusing with ISPF in the mix >because of the quotes thing. My usual rule of thumb is to use single quotes >for Rexx literals, so I can use the double quotes inside for ISPF. You could >also double the quotes, but that gets super-fugly and even more confusing: >ISREDIT CHANGE """LOWER""" """lower""" word all > >That will mean ISPF sees: >(variable) ISREDIT >(space) >(variable) CHANGE >(space) >(literal) " >(literal) LOWER >(literal) " >(space) >(literal) " >(literal) lower >(literal) " >(space) >(variable) WORD >(space) >(variable) ALL > >In Rexx, it's a very good idea to ALWAYS know what's a literal and what's a >variable and to quote all literals. It not only avoids problems but is also >more efficient. > >(The "problems" part comes when you have that line as you wrote it working, >and then someone assigns variable LOWER to some value and all hell breaks >loose!) > >-----Original Message----- >From: IBM Mainframe Discussion List <[email protected]> On Behalf Of >Steely.Mark >Sent: Wednesday, September 17, 2025 1:07 PM >To: [email protected] >Subject: Re: Edit macro CHANGE not preseriving case > >I have the same issue - this is the code I use: > >ISREDIT MACRO >ISREDIT CAPS OFF >ISREDIT CHANGE "LOWER" "lower" word all >ISREDIT RESET >EXIT CODE(0) > >I did test the REXX version below and that did work - is there a way to get >this version to work ? > >Thank You > > > >-----Original Message----- >From: IBM Mainframe Discussion List <[email protected]> On Behalf Of >Phil Smith III >Sent: Wednesday, September 17, 2025 11:57 AM >To: [email protected] >Subject: Re: Edit macro CHANGE not preseriving case > > ! > ACAUTION! EXTERNAL SENDER! STOP, ASSESS, AND VERIFY Do you know this person? Were you expecting this email? If not, report it using the Report Phishing Button! > >Thank you! As a long-time XEDIT maven I'd been looking for such a book, for >some reason never found it before. 488pp, that'll take a while to digest... > >-----Original Message----- >From: IBM Mainframe Discussion List <[email protected]> On Behalf Of >Grantham, Chip >Sent: Wednesday, September 17, 2025 12:42 PM >To: [email protected] >Subject: Re: Edit macro CHANGE not preseriving case > >Googlz z/OS 3.1 ISPF Edit and Edit Macros > >-----Original Message----- >From: IBM Mainframe Discussion List <[email protected]> On Behalf Of >Phil Smith III >Sent: Wednesday, September 17, 2025 11:37 AM >To: [email protected] >Subject: Re: Edit macro CHANGE not preseriving case > >What does >'Macro ()' >do? Pointer to doc would be ereat if you have it! > >-----Original Message----- >From: IBM Mainframe Discussion List <[email protected]> On Behalf Of >Grantham, Chip >Sent: Wednesday, September 17, 2025 12:32 PM >To: [email protected] >Subject: Re: Edit macro CHANGE not preseriving case > >Try tsis: > /* REXX */ > address isredit > 'Macro ()' > 'CAPS OFF' > 'CHANGE "AAA" "Aaa"' all > Exit > >-----Original Messa-e----- >From: IBM Mainframe Discussion List <[email protected]> On Behalf Of >ITschak Mugzach >Sent: Wednesday, September 17, 2025 11:25 AM >To: [email protected] >Subject: Edit macro CHANGE not preseriving case > >I wrote a simple edit macro to change the case of a text. but it is still >keeping the old case and not folding to lower case. for example: > >/* Rexx */ >Address ISREDIT > CAPS OFF > CHANGE 'AAA' 'Aaa' ALL > >What am I doing wrong? > >ITschak Mugzach >*|** IronSphere Platform* *|* *Information Security Continuous Monitoring for >z/OS, x/Linux & IBM I **| z/VM coming soon * > >---------------------------------------------------------------------- >For IBM-MAIN subscribe / signoff / archive access instructions, send email to >[email protected] with the message: INFO IBM-MAIN > >---------------------------------------------------------------------- >For IBM-MAIN subscribe / signoff / archive access instructions, send email to >[email protected] with the message: INFO IBM-MAIN > >---------------------------------------------------------------------- >For IBM-MAIN subscribe / signoff / archive access instructions, send email to >[email protected] with the message: INFO IBM-MAIN > >---------------------------------------------------------------------- >For IBM-MAIN subscribe / signoff / archive access instructions, send email to >[email protected] with the message: INFO IBM-MAIN > >---------------------------------------------------------------------- >For IBM-MAIN subscribe / signoff / archive access instructions, send email to >[email protected] with the message: INFO IBM-MAIN > >---------------------------------------------------------------------- >For IBM-MAIN subscribe / signoff / archive access instructions, send email to >[email protected] with the message: INFO IBM-MAIN > >---------------------------------------------------------------------- >For IBM-MAIN subscribe / signoff / archive access instructions, >send email to [email protected] with the message: INFO IBM-MAIN > > > >---------------------------------------------------------------------- >For IBM-MAIN subscribe / signoff / archive access instructions, >send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
