Discussion:
REXX Syntax ISPF Edit Macro ?
(too old to reply)
Dyck, Lionel B. , TRA
2017-04-12 12:51:40 UTC
Permalink
Raw Message
Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10)
Information and Technology, IT Operations and Services


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Höglund Lars
2017-04-12 12:54:57 UTC
Permalink
Raw Message
Special macro? why not "HI"?

-----Ursprungligt meddelande-----
Från: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] För Dyck, Lionel B. (TRA)
Skickat: den 12 april 2017 14:53
Till: TSO-***@VM.MARIST.EDU
Ämne: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and Technology, IT Operations and Services


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Beech-Garwood, Jeffrey E
2017-04-12 12:56:44 UTC
Permalink
Raw Message
Hi Lionel,

I don't know of an edit macro that does that - but you do know that ISPF has a highlight option. Just type HI on the command line for a member, Choose 'language 1', 'coloring 3' and a '/' for all the options.

I think the highlighting for REXX is one of the best things in ISPF :)

Cheers,

Jeff

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 7:52 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and Technology, IT Operations and Services


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX


U.S. BANCORP made the following annotations
---------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.

---------------------------------------------------------------------

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Richards, Robert B.
2017-04-12 12:58:02 UTC
Permalink
Raw Message
Sounds like an enhancement request for the HILITE command. :-)

X ALL
Find DO all
Find END all
Find SELECT all
Find WHEN all
Find OTHWERWISE all

Work from the center out and you will find the culprit.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 8:52 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and Technology, IT Operations and Services


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
BUCKLEY Pete
2017-04-12 13:07:58 UTC
Permalink
Raw Message
HILITE appears to already work with Select/End as well as Do/End.
Otherwise isn't really relevant, since it effectively starts an implicit Do/End section which is terminated by the End for Select.

Pete BUCKLEY
AXA TECH

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Richards, Robert B.
Sent: 12 April 2017 13:59
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Sounds like an enhancement request for the HILITE command. :-)

X ALL
Find DO all
Find END all
Find SELECT all
Find WHEN all
Find OTHWERWISE all

Work from the center out and you will find the culprit.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 8:52 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and Technology, IT Operations and Services


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

This email originates from AXA Technology Services UK Limited (reg. no. 1854856) which has its registered office at 5 Old Broad Street, London EC2N 1AD, England.

This message and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. If you have received this in error, you should not disseminate or copy this email. Please notify the sender immediately and delete this email from your system.

Please also note that any opinions presented in this email are solely those of the author and do not necessarily represent those of The AXA UK Plc Group.

Email transmission cannot be guaranteed to be secure, or error free as information could be intercepted, corrupted, lost, destroyed, late in arriving or incomplete as a result of the transmission process. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission.

Finally, the recipient should check this email and any attachments for viruses. The AXA UK Plc Group accept no liability for any damage caused by any virus transmitted by this email.

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Dyck, Lionel B. , TRA
2017-04-12 13:12:47 UTC
Permalink
Raw Message
Thanks - I thought I'd seen something awhile back that would do it but this works.

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10)
Information and Technology, IT Operations and Services

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Richards, Robert B.
Sent: Wednesday, April 12, 2017 7:59 AM
To: TSO-***@VM.MARIST.EDU
Subject: [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Sounds like an enhancement request for the HILITE command. :-)

X ALL
Find DO all
Find END all
Find SELECT all
Find WHEN all
Find OTHWERWISE all

Work from the center out and you will find the culprit.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 8:52 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and Technology, IT Operations and Services


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Lizette Koehler
2017-04-12 13:19:50 UTC
Permalink
Raw Message
Did you try HILITE on the command line and select REXX for the hilite.
Then use 3 and / in the other two fields.

May work

Lizette
Post by Beech-Garwood, Jeffrey E
-----Original Message-----
Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 6:13 AM
Subject: Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Thanks - I thought I'd seen something awhile back that would do it but this works.
--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and Technology,
IT Operations and Services
-----Original Message-----
Richards, Robert B.
Sent: Wednesday, April 12, 2017 7:59 AM
Subject: [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Sounds like an enhancement request for the HILITE command. :-)
X ALL
Find DO all
Find END all
Find SELECT all
Find WHEN all
Find OTHWERWISE all
Work from the center out and you will find the culprit.
-----Original Message-----
Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 8:52 AM
Subject: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Is there a rexx edit macro that will highlight do/end select/otherwise/end
groupings to help identify when a missing or extra end is coded?
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Don Hoben
2017-04-12 13:16:06 UTC
Permalink
Raw Message
While in edit mode type hilite on the command line.
Hit Enter
Choose either "Automatic" or "REXX"
Choose Coloring option 3
Select Parentheses matching


Don Hoben
502-654-7446

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Richards, Robert B.
Sent: Wednesday, April 12, 2017 8:59 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Sounds like an enhancement request for the HILITE command. :-)

X ALL
Find DO all
Find END all
Find SELECT all
Find WHEN all
Find OTHWERWISE all

Work from the center out and you will find the culprit.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of
Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 8:52 AM
To: TSO-***@VM.MARIST.EDU
Subject: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Is there a rexx edit macro that will highlight do/end select/otherwise/end
groupings to help identify when a missing or extra end is coded?

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and
Technology, IT Operations and Services


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email
to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email
to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Paul Gilmartin
2017-04-12 13:55:11 UTC
Permalink
Raw Message
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?
It's useful to label your ENDs. Sometimes I use an otherwise otiose
control variable to do this:

do Loop42 = 1 for 1
/* ... */
end Loop42

At execution, the interpreter will report extra ENDs. Alas, no error
is reported when the group is skipped by IF. I got this fixed by PTF
for CMS Rexx long ago; the defect remains for TSO Rexx.

(This also facilitates ITERATE and LEAVE.)

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Dyck, Lionel B. , TRA
2017-04-12 13:58:38 UTC
Permalink
Raw Message
I like - thank you

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10)
Information and Technology, IT Operations and Services



-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Wednesday, April 12, 2017 8:56 AM
To: TSO-***@VM.MARIST.EDU
Subject: [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?
It's useful to label your ENDs. Sometimes I use an otherwise otiose control variable to do this:

do Loop42 = 1 for 1
/* ... */
end Loop42

At execution, the interpreter will report extra ENDs. Alas, no error is reported when the group is skipped by IF. I got this fixed by PTF for CMS Rexx long ago; the defect remains for TSO Rexx.

(This also facilitates ITERATE and LEAVE.)

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Richards, Robert B.
2017-04-12 14:16:49 UTC
Permalink
Raw Message
Lionel,

Just for fun I tried my suggestion (with HILITE on) against your 10K+ lines of REXX in XMITIP. I fully understand now how you can lose an "end". :-)

Also, "DO" statements on OTHERWISE lines required me to issue the SHOW on the line number to see it. Not sure why, but it was the other part of a color coded END that matched the END's color.

The color coding provided by HILITE did seem to be sufficient, but I did not go through the entire EXEC!!!

Bob


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 9:59 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

I like - thank you

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and Technology, IT Operations and Services



-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Wednesday, April 12, 2017 8:56 AM
To: TSO-***@VM.MARIST.EDU
Subject: [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?
It's useful to label your ENDs. Sometimes I use an otherwise otiose control variable to do this:

do Loop42 = 1 for 1
/* ... */
end Loop42

At execution, the interpreter will report extra ENDs. Alas, no error is reported when the group is skipped by IF. I got this fixed by PTF for CMS Rexx long ago; the defect remains for TSO Rexx.

(This also facilitates ITERATE and LEAVE.)

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Dyck, Lionel B. , TRA
2017-04-12 14:23:34 UTC
Permalink
Raw Message
Smile - Yes - I used hilite and it does work. I'm working on another and hilite is laborious and I was hoping for something cleaner :-)


--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10)
Information and Technology, IT Operations and Services

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Richards, Robert B.
Sent: Wednesday, April 12, 2017 9:18 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Lionel,

Just for fun I tried my suggestion (with HILITE on) against your 10K+ lines of REXX in XMITIP. I fully understand now how you can lose an "end". :-)

Also, "DO" statements on OTHERWISE lines required me to issue the SHOW on the line number to see it. Not sure why, but it was the other part of a color coded END that matched the END's color.

The color coding provided by HILITE did seem to be sufficient, but I did not go through the entire EXEC!!!

Bob


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 9:59 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

I like - thank you

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and Technology, IT Operations and Services



-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Wednesday, April 12, 2017 8:56 AM
To: TSO-***@VM.MARIST.EDU
Subject: [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?
It's useful to label your ENDs. Sometimes I use an otherwise otiose control variable to do this:

do Loop42 = 1 for 1
/* ... */
end Loop42

At execution, the interpreter will report extra ENDs. Alas, no error is reported when the group is skipped by IF. I got this fixed by PTF for CMS Rexx long ago; the defect remains for TSO Rexx.

(This also facilitates ITERATE and LEAVE.)

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Nims,Alva John , Al
2017-04-12 14:37:12 UTC
Permalink
Raw Message
Is there something in one of the CBTTAPE.org files? My "One Bit memory with Parity" brain thought there was, but I could be very wrong.

Al Nims
University of Florida

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 10:24 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Smile - Yes - I used hilite and it does work. I'm working on another and hilite is laborious and I was hoping for something cleaner :-)


--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and Technology, IT Operations and Services

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Richards, Robert B.
Sent: Wednesday, April 12, 2017 9:18 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Lionel,

Just for fun I tried my suggestion (with HILITE on) against your 10K+ lines of REXX in XMITIP. I fully understand now how you can lose an "end". :-)

Also, "DO" statements on OTHERWISE lines required me to issue the SHOW on the line number to see it. Not sure why, but it was the other part of a color coded END that matched the END's color.

The color coding provided by HILITE did seem to be sufficient, but I did not go through the entire EXEC!!!

Bob


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 9:59 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

I like - thank you

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and Technology, IT Operations and Services



-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Wednesday, April 12, 2017 8:56 AM
To: TSO-***@VM.MARIST.EDU
Subject: [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?
It's useful to label your ENDs. Sometimes I use an otherwise otiose control variable to do this:

do Loop42 = 1 for 1
/* ... */
end Loop42

At execution, the interpreter will report extra ENDs. Alas, no error is reported when the group is skipped by IF. I got this fixed by PTF for CMS Rexx long ago; the defect remains for TSO Rexx.

(This also facilitates ITERATE and LEAVE.)

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Andreas Fischer
2017-04-12 14:49:10 UTC
Permalink
Raw Message
well i use a self written ISPF edit macro that does some checking of my
own rexx execs, heavily depending on the way i do my coding.

among other stuff, i check the starting position of a new instruction,
assuming that within any kind of do group the starting position is moved
to the right. if they starting position doesn't match the calculated
position, i insert a msgline. basically i did that check for getting a
better visibility in my execs, but indirectly it's a check for missing
ends as well.

if you do the same i your execs - move the starting position consequentely
within a do group - then checking the starting position of a new
instruction might be a technique that will help you to find missing end
instructions. other you are able to count the start of do groups and the
number of end instructions and issue a message when you get different
values, but except for select when cases, i doubt there's an easy way to
find out where the end instruction is missing exactly.

regards,
andi
Datum: 12.04.2017 16:25
Betreff: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF
Edit Macro ?
Smile - Yes - I used hilite and it does work. I'm working on
another and hilite is laborious and I was hoping for something cleaner
:-)
--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10)
Information and Technology, IT Operations and Services
-----Original Message-----
Behalf Of Richards, Robert B.
Sent: Wednesday, April 12, 2017 9:18 AM
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Lionel,
Just for fun I tried my suggestion (with HILITE on) against your 10K
+ lines of REXX in XMITIP. I fully understand now how you can lose
an "end". :-)
Also, "DO" statements on OTHERWISE lines required me to issue the
SHOW on the line number to see it. Not sure why, but it was the
other part of a color coded END that matched the END's color.
The color coding provided by HILITE did seem to be sufficient, but I
did not go through the entire EXEC!!!
Bob
-----Original Message-----
Behalf Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 9:59 AM
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
I like - thank you
--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and
Technology, IT Operations and Services
-----Original Message-----
Sent: Wednesday, April 12, 2017 8:56 AM
Subject: [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end select/
otherwise/end groupings to help identify when a missing or extra endis
coded?
It's useful to label your ENDs. Sometimes I use an otherwise otiose
do Loop42 = 1 for 1
/* ... */
end Loop42
At execution, the interpreter will report extra ENDs. Alas, no
error is reported when the group is skipped by IF. I got this fixed
by PTF for CMS Rexx long ago; the defect remains for TSO Rexx.
(This also facilitates ITERATE and LEAVE.)
-- gil
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Dyck, Lionel B. , TRA
2017-04-12 14:52:46 UTC
Permalink
Raw Message
I found $DO in FILE 166 of the CBTTape. It's a great start for what I was thinking of.

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10)
Information and Technology, IT Operations and Services

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
stonethom
2017-04-12 15:54:29 UTC
Permalink
Raw Message
Hilite always worked pretty well for me, but when stuck trace s was always helpful.



Sent from my Sprint Samsung Galaxy S® 6.
-------- Original message --------From: "Dyck, Lionel B. (TRA)" <***@VA.GOV> Date: 4/12/17 09:24 (GMT-06:00) To: TSO-***@VM.MARIST.EDU Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Smile - Yes - I used hilite and it does work.  I'm working on another and hilite is laborious and I was hoping for something cleaner :-)


--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10)
Information and Technology, IT Operations and Services

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Richards, Robert B.
Sent: Wednesday, April 12, 2017 9:18 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Lionel,

Just for fun I tried my suggestion (with HILITE on) against your 10K+ lines of REXX in XMITIP. I fully understand now how you can lose an "end".  :-)

Also, "DO" statements on OTHERWISE lines required me to issue the SHOW on the line number to see it. Not sure why, but it was the other part of a color coded END that matched the END's color.

The color coding provided by HILITE did seem to be sufficient, but I did not go through the entire EXEC!!!

Bob 


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 9:59 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

I like - thank you

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and Technology, IT Operations and Services



-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Wednesday, April 12, 2017 8:56 AM
To: TSO-***@VM.MARIST.EDU
Subject: [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end select/otherwise/end groupings to help identify when a missing or extra end is coded?
 
It's useful to label your ENDs.  Sometimes I use an otherwise otiose control variable to do this:

do Loop42 = 1 for 1
    /* ... */
end Loop42

At execution, the interpreter will report extra ENDs.  Alas, no error is reported when the group is skipped by IF.  I got this fixed by PTF for CMS Rexx long ago; the defect remains for TSO Rexx.

(This also facilitates ITERATE and LEAVE.)

-- gil

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Hobart Spitz
2017-04-13 14:02:25 UTC
Permalink
Raw Message
Did you consider the REXX compiler? Even if I'm not using the object code,
it can help.

I once wrote an edit macro that would run the compiler, and insert any
error messages as NOTE lines into the edit session. It was a big time
saver. No need to match up the error message with the source line. It
would also add after each assignment NOTE lines with info from the XREF
section so I could see where each variable was used (if at all!!). There
are probably other integrations between the compiler and the editor that
are possible.
Post by stonethom
Hilite always worked pretty well for me, but when stuck trace s was always helpful.
Sent from my Sprint Samsung Galaxy S® 6.
-------- Original message --------From: "Dyck, Lionel B. (TRA)" <
REXX Syntax ISPF Edit Macro ?
Smile - Yes - I used hilite and it does work. I'm working on another and
hilite is laborious and I was hoping for something cleaner :-)
--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10)
Information and Technology, IT Operations and Services
-----Original Message-----
Of Richards, Robert B.
Sent: Wednesday, April 12, 2017 9:18 AM
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Lionel,
Just for fun I tried my suggestion (with HILITE on) against your 10K+
lines of REXX in XMITIP. I fully understand now how you can lose an "end".
:-)
Also, "DO" statements on OTHERWISE lines required me to issue the SHOW on
the line number to see it. Not sure why, but it was the other part of a
color coded END that matched the END's color.
The color coding provided by HILITE did seem to be sufficient, but I did
not go through the entire EXEC!!!
Bob
-----Original Message-----
Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 9:59 AM
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
I like - thank you
--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and
Technology, IT Operations and Services
-----Original Message-----
Sent: Wednesday, April 12, 2017 8:56 AM
Subject: [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end
select/otherwise/end groupings to help identify when a missing or extra end
is coded?
It's useful to label your ENDs. Sometimes I use an otherwise otiose
do Loop42 = 1 for 1
/* ... */
end Loop42
At execution, the interpreter will report extra ENDs. Alas, no error is
reported when the group is skipped by IF. I got this fixed by PTF for CMS
Rexx long ago; the defect remains for TSO Rexx.
(This also facilitates ITERATE and LEAVE.)
-- gil
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
--
OREXXMan

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Dyck, Lionel B. , TRA
2017-04-13 14:09:23 UTC
Permalink
Raw Message
The compiler would be ideal but we don't have it :(

Nor do we have Pipes :(

Thanks

--------------------------------------------------------------------------
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10)
Information and Technology, IT Operations and Services

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-***@VM.MARIST.EDU] On Behalf Of Hobart Spitz
Sent: Thursday, April 13, 2017 9:03 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?

Did you consider the REXX compiler? Even if I'm not using the object code, it can help.

I once wrote an edit macro that would run the compiler, and insert any error messages as NOTE lines into the edit session. It was a big time saver. No need to match up the error message with the source line. It would also add after each assignment NOTE lines with info from the XREF section so I could see where each variable was used (if at all!!). There are probably other integrations between the compiler and the editor that are possible.
Post by stonethom
Hilite always worked pretty well for me, but when stuck trace s was always helpful.
Sent from my Sprint Samsung Galaxy S® 6.
-------- Original message --------From: "Dyck, Lionel B. (TRA)" <
[TSO-REXX] REXX Syntax ISPF Edit Macro ?
Smile - Yes - I used hilite and it does work. I'm working on another
and hilite is laborious and I was hoping for something cleaner :-)
----------------------------------------------------------------------
----
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and
Technology, IT Operations and Services
-----Original Message-----
Behalf Of Richards, Robert B.
Sent: Wednesday, April 12, 2017 9:18 AM
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Lionel,
Just for fun I tried my suggestion (with HILITE on) against your 10K+
lines of REXX in XMITIP. I fully understand now how you can lose an "end".
:-)
Also, "DO" statements on OTHERWISE lines required me to issue the SHOW
on the line number to see it. Not sure why, but it was the other part
of a color coded END that matched the END's color.
The color coding provided by HILITE did seem to be sufficient, but I
did not go through the entire EXEC!!!
Bob
-----Original Message-----
Behalf Of Dyck, Lionel B. (TRA)
Sent: Wednesday, April 12, 2017 9:59 AM
Subject: Re: [TSO-REXX] [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
I like - thank you
----------------------------------------------------------------------
----
Lionel B. Dyck
Mainframe Systems Programmer - TRA
Enterprise Operations (Station 200) (005OP6.3.10) Information and
Technology, IT Operations and Services
-----Original Message-----
Sent: Wednesday, April 12, 2017 8:56 AM
Subject: [EXTERNAL] Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end
select/otherwise/end groupings to help identify when a missing or
extra end is coded?
It's useful to label your ENDs. Sometimes I use an otherwise otiose
do Loop42 = 1 for 1
/* ... */
end Loop42
At execution, the interpreter will report extra ENDs. Alas, no error
is reported when the group is skipped by IF. I got this fixed by PTF
for CMS Rexx long ago; the defect remains for TSO Rexx.
(This also facilitates ITERATE and LEAVE.)
-- gil
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send
--
OREXXMan

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions, send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Phil Smith III
2017-04-14 14:54:22 UTC
Permalink
Raw Message
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end select/otherwise/end
groupings to help identify when a missing or extra end is coded?
On VM we have REXXFORM XEDIT, which nicely indents, marks missing ENDs, etc.
It's pretty smart; you can confuse it with enough bad quotes and/or partial
comments, but it does detect those, just isn't always obvious where the
error is.

If someone wanted to update it to work in ISPF, that'd be way cool...

...phsiii

/*********************************************************************
*
* ROUTINE: REXXFORM
*
* PURPOSE: Structure/indent REXX execs
*
* AUTHOR: Robert Fowles, 02/04/84
* (based on original exec by Jeffery Almoney)
* Pennsylvania State University
* Center for Academic Computing
* 107 Computer Building
* University Park, PA 16802
* 814 865-4774
* SHARE Installation code: PSU
* Bitnet: ***@PSUVM
* Internet: ***@PSUVM.PSU.EDU
*
* REVISIONS:
* 11/20/90 RBF Include changes made in 07/25/85 by Denis J. Audet,
* Computing Centre, Univ of Ottawa: refine
* detection of comments and quotes across split
* lines, prevent truncation. Make changes based on
* ideas from ***@WATDCS.
* 11/20/90 RBF Change syntax to allow: reformatting of selected
* parts of file; left margin for all lines. Move
* Help info to Help File.
* 12/16/90 RBF Change name to REXXFORM (old name REXFORM).
* 03/17/91 RBF Add more syntax checking.
* 06/04/99 PHS Fix continuation detection after end-of-line comment;
* try to adjust end-of-line comments to make lines fit;
* mark unfittable lines via SET SELECT.
* 06/15/02 PHS Fix lines starting with literal ending in ":"
*********************************************************************/
arg a
if a='?' then call Help
signal on syntax
'COMMAND PRESERVE'
'COMMAND SET MACRO OFF'; 'COMMAND SET SYNONYM OFF';
'SET ZONE 1 *'; 'SET LINEND OFF'; 'SET IMAGE OFF';
'SET RANGE :0 *'; 'SET DISPLAY 0 *'; 'SET CASE M I'; 'SET AUTO OFF';
'EXTRACT /LINE/SIZE/TRUNC/SELECT'
startl = line.1
cj=0; ci=0;
call ScanOpts
com=0; dqu=0; squ=0; indent=0; cont=0; unbal=''; lines=0;
ds=''; /* Line-number stack for DO's and SELECT's. */
es=''; /* Line-number stack for END's. */
do i=startl to endl-1
'+1'
if rc>0 then leave
lines=lines+1
'EXTRACT/CURLINE/'; line=curline.3;
line = strip(line,'T')
sline=strip(line,'L')
if sline=' ' then iterate i
w1=' 'translate(word(sline,1))
parse var w1 w1 "'"
parse var w1 w1 '"'
lw=translate(word(line,words(sline)))
j = Lscan(sline)
if j>0 then lastdo=i
else if j<0 then indent=indent+j
if indent<0 then indent=1
if dqu > 0 | squ > 0 then do
if dqu = 2 then dqu = 0
if squ = 2 then squ = 0
iterate
end
else do
if com>0 then do
if cj then repline= sline
else if ci then repline=,
substr(' ',1,lm+(indent)*in) || sline
else repline= line
if com>1 then com=0
end
else
if (substr(w1,length(w1),1)=':' | word(line,2)=':') &,
index(w1, "'") = 0
then repline=substr(' ',1,max(0,lm+(indent-1)*in))||sline
else
repline= substr(' ',1,lm+cont+indent*in)||sline
if length(repline) > trunc.1 then /* It won't fit ... */
if right(line, 2) == '*/' then do /* Try to fix it */
xyzzy = length(repline) - length(line) /* Get l'overflow */
plugh = index(repline, copies(' ', xyzzy)' /* ') /* Cmt? */
if plugh > 0 then /* Got comment start & end, fix it */
repline = delstr(repline, plugh, xyzzy) /* Delete blanks */
end

if length(repline) > trunc.1 then do /* It still won't fit */
'EMSG *** Unable to indent',
' line:'i' within current XEDIT truncation setting ***'
'SET SELECT' select.2+1 /* Mark it so user can find it */
end
else if repline == line then nop
else 'REPLACE' repline
if com == -1 then com = 1
else if dqu == -1 then dqu = 1
else if squ == -1 then squ = 1
else if substr(lw,length(lw))=',' then cont=2
else cont=0
end
if j>0 then indent=indent+j
end
':'startl 'RESTORE'
if es<>'' then 'COMMAND EMSG Unbalanced "END"s at lines: 'es
if ds<>'' then do
nds=''
do i=1 to words(ds)
nds=word(ds,i) nds
end
'COMMAND EMSG Unbalanced "DO"s or "SELECT"s at lines: ' nds
end
if com>0 then 'COMMAND EMSG Unbalanced comment'
if squ+dqu>0 then 'COMMAND EMSG Unbalanced string constant'
'COMMAND MSG' lines 'lines restructured from' startl 'to' endl-1
s=select.2 /* Remember old max selection level */
'COMMAND EXTRACT /DISPLAY/SELECT' /* Get possible new level */
if s=select.2 then exit 0 /* Nope, no change, we're done */
'COMMAND MSG Un-indentable lines marked with selection level' ,
select.2
'COMMAND MSG Issue SET DISPLAY' select.2 'to view'
'COMMAND SET DISPLAY' display.1 select.2 /* Make sure all visible */
exit 0
ScanOpts:
i=pos('(',a)
if i>0 then if pos('(',a,i+1)>0
then call Errstop 'Left parentheses not allowed in targets'
parse var a a '(' opts
if a='' then a='* 4 3'
call ParseTarget
parse var t lm in r
if lm='' then lm=4
if in='' then in=3
if datatype(lm,'W')=0 | datatype(in,'W')=0 then call Errstop,
'Left margin and Indent values must be whole numbers'
if lm<0 | in<0 then call Errstop,
'Left margin and Indent values cannot be negative'
if r<>'' then call Errstop 'Incorrect arguments'
if lm+in>trunc.1 then call Errstop,
'Left margin plus Indent value cannot exceed the TRUNC setting'
if lm=0 then call Errstop 'Left margin value must be greater than 0'
if lm>trunc.1
then call Errstop 'Left margin can''t exceed TRUNC setting'
lm=lm-1
do i=1 to words(opts)
s=word(opts,i)
select
when s='CJ' then cj=1
when s='CI' then ci=1
otherwise call ErrStop 'Incorrect arguments'
end
end
'LOCATE' target
'EXTRACT/LINE/'
endl = line.1
':'startl 'UP1'
return
ParseTarget:
target=''
push a
'PARSE 1 T'
if rc<>0 then call Errstop 'Incorrect target'
pull .
pull t1 t2
interpret 'parse var a' t1 'target' t1+t2 't'
return
Lscan: Procedure expose com dqu squ i ds es lw
arg s
Select
when com=1 then do
k= pos('*/',s)
if k>0 then do
s= substr(s,k+2)
com=2
end
else return 0
end
when dqu=1 then do
k= pos('"',s)
if k>0 then do
s= substr(s,k+1)
dqu=2
end
else return 0
end
when squ=1 then do
k= pos("'",s)
if k>0 then do
s= substr(s,k+1)
squ=2
end
else return 0
end
otherwise nop
End
qu = 0
do until s2 = '' | s = ' '
ls = 1+length(s)
kcom = pos('/*',s)
if kcom=0 then kcom=ls
kdqu = pos('"',s)
if kdqu=0 then kdqu=ls
ksqu = pos("'",s)
if ksqu=0 then ksqu=ls
select
when kcom<kdqu & kcom<ksqu then do
if pos('*/',s,kcom+2) = 0 then do
com = com-1
parse var s s '/*'
s2 = ''
end
else do
parse var s s1 '/*' s2 '*/' s3
s2 = '*'
s=s1 s3
/* The following is to fix continuation detection when the line ends
in a comment.
*/
if s <> '' then /* If we have anything ... */
lw=translate(word(s,words(s))) /* ...reset lastword */
end
iterate
end
when ksqu<kdqu then do
qu = 1
if pos("'",s,ksqu+1) = 0 then do
squ = squ-1
parse var s s "'"
s2 = ''
end
else do
parse var s s1 "'" s2 "'" s3
s2 = '*'
s=s1 s2 s3
end
iterate
end
when kdqu<ksqu then do
qu = 1
if pos('"',s,kdqu+1) = 0 then do
dqu = dqu-1
parse var s s '"'
s2 = ''
end
else do
parse var s s1 '"' s2 '"' s3
s2 = '*'
s=s1 s2 s3
end
iterate
end
otherwise s2 = ''
end
end
if s = '' then do
if qu=0 & com<1 & dqu=squ then com = com + 2
return 0
end
k = 0
s=translate(s,' ',';')
do j=1 to words(s)
w=word(s,j)
select
when w='DO' | w='SELECT' then do
k=k+1; ds=i ds;
end
when w='END' then do
k=k-1;
if ds='' then es=es i
ds=delword(ds,1,1);
end
otherwise nop
end
end
return k
Errstop:
parse arg m
'SET MSGM ON'
'EMSG' m
'RESTORE'
exit 16
Help:
call Saydo
/*
REXXFORM <target left-margin indent> <( <CJ> <CI> >
Defaults: target=*, left-margin=4, indent=3.
For more information, use HELP REXXFORM.
*/
call Sayend
exit 0
Saydo: L1=sigl+2; return;
Sayend: Procedure Expose L1 sigl
L2=sigl-2
do i=L1 to L2
'MSG' sourceline(i)
end
return
Syntax:
rr = rc
'EMSG REXXFORM LINE:' sigl sourceline(sigl)
'EMSG +++' errortext(rr)
'EMSG >>> error at file line 'i
'RESTORE'
exit 16

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
richard rozentals
2017-04-14 16:29:46 UTC
Permalink
Raw Message
Hi,
The simplest way is to use the HILITE command. If you enter HILTE at the command line it will give you the options.If you want to add this to a edit macro you can change the ISPF profile adding the hilite options.
Richard


From: Phil Smith III <***@AKPHS.COM>
To: TSO-***@VM.MARIST.EDU
Sent: Friday, April 14, 2017 10:56 AM
Subject: Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end select/otherwise/end
groupings to help identify when a missing or extra end is coded?
On VM we have REXXFORM XEDIT, which nicely indents, marks missing ENDs, etc.
It's pretty smart; you can confuse it with enough bad quotes and/or partial
comments, but it does detect those, just isn't always obvious where the
error is.

If someone wanted to update it to work in ISPF, that'd be way cool...

...phsiii

/*********************************************************************
*
*  ROUTINE:      REXXFORM
*
*  PURPOSE:      Structure/indent REXX execs
*
*  AUTHOR:      Robert Fowles, 02/04/84
*                (based on original exec by Jeffery Almoney)
*                Pennsylvania State University
*                Center for Academic Computing
*                107 Computer Building
*                University Park, PA  16802
*                814 865-4774
*                SHARE Installation code: PSU
*                Bitnet: ***@PSUVM
*                Internet: ***@PSUVM.PSU.EDU
*
*  REVISIONS:
*    11/20/90 RBF Include changes made in 07/25/85 by Denis J. Audet,
*                Computing Centre, Univ of Ottawa: refine
*                detection of comments and quotes across split
*                lines, prevent truncation.  Make changes based on
*                ideas from ***@WATDCS.
*    11/20/90 RBF Change syntax to allow: reformatting of selected
*                parts of file; left margin for all lines.  Move
*                Help info to Help File.
*    12/16/90 RBF Change name to REXXFORM (old name REXFORM).
*    03/17/91 RBF Add more syntax checking.
*    06/04/99 PHS Fix continuation detection after end-of-line comment;
*                try to adjust end-of-line comments to make lines fit;
*                mark unfittable lines via SET SELECT.
*    06/15/02 PHS Fix lines starting with literal ending in ":"
*********************************************************************/
  arg a
  if a='?' then call Help
  signal on syntax
  'COMMAND PRESERVE'
  'COMMAND SET MACRO OFF'; 'COMMAND SET SYNONYM OFF';
  'SET ZONE 1 *'; 'SET LINEND OFF'; 'SET IMAGE OFF';
  'SET RANGE :0 *'; 'SET DISPLAY 0 *'; 'SET CASE M I'; 'SET AUTO OFF';
  'EXTRACT /LINE/SIZE/TRUNC/SELECT'
  startl = line.1
  cj=0; ci=0;
  call ScanOpts
  com=0; dqu=0; squ=0; indent=0; cont=0; unbal=''; lines=0;
  ds='';  /* Line-number stack for DO's and SELECT's.              */
  es='';  /* Line-number stack for END's.                          */
  do i=startl to endl-1
      '+1'
      if rc>0 then leave
      lines=lines+1
      'EXTRACT/CURLINE/'; line=curline.3;
      line = strip(line,'T')
      sline=strip(line,'L')
      if sline=' ' then iterate i
      w1=' 'translate(word(sline,1))
      parse var w1 w1 "'"
      parse var w1 w1 '"'
      lw=translate(word(line,words(sline)))
      j = Lscan(sline)
      if j>0 then lastdo=i
      else if j<0 then indent=indent+j
      if indent<0 then indent=1
      if dqu > 0 | squ > 0 then do
        if dqu = 2 then dqu = 0
        if squ = 2 then squ = 0
        iterate
      end
      else do
        if com>0 then do
            if cj then repline= sline
            else if ci then repline=,
              substr(' ',1,lm+(indent)*in) || sline
            else repline= line
            if com>1 then com=0
        end
        else
        if (substr(w1,length(w1),1)=':' | word(line,2)=':') &,
          index(w1, "'") = 0
        then repline=substr(' ',1,max(0,lm+(indent-1)*in))||sline
        else
        repline= substr(' ',1,lm+cont+indent*in)||sline
        if length(repline) > trunc.1 then      /* It won't fit ... */
        if right(line, 2) == '*/' then do          /* Try to fix it */
            xyzzy = length(repline) - length(line) /* Get l'overflow */
            plugh = index(repline, copies(' ', xyzzy)' /* ') /* Cmt? */
            if plugh > 0 then    /* Got comment start & end, fix it */
            repline = delstr(repline, plugh, xyzzy) /* Delete blanks */
        end

        if length(repline) > trunc.1 then do  /* It still won't fit */
          'EMSG *** Unable to indent',
            ' line:'i' within current XEDIT truncation setting ***'
            'SET SELECT' select.2+1  /* Mark it so user can find it */
        end
        else if repline == line then nop
        else 'REPLACE' repline
        if com == -1 then com = 1
        else if dqu == -1 then dqu = 1
        else if squ == -1 then squ = 1
        else if substr(lw,length(lw))=',' then cont=2
        else cont=0
      end
      if j>0 then indent=indent+j
  end
  ':'startl 'RESTORE'
  if es<>'' then 'COMMAND EMSG Unbalanced "END"s at lines: 'es
  if ds<>'' then do
      nds=''
      do i=1 to words(ds)
        nds=word(ds,i) nds
      end
      'COMMAND EMSG Unbalanced "DO"s or "SELECT"s at lines: ' nds
  end
  if com>0 then 'COMMAND EMSG Unbalanced comment'
  if squ+dqu>0 then 'COMMAND EMSG Unbalanced string constant'
  'COMMAND MSG' lines 'lines restructured from' startl 'to' endl-1
  s=select.2                    /* Remember old max selection level */
  'COMMAND EXTRACT /DISPLAY/SELECT'      /* Get possible new level */
  if s=select.2 then exit 0          /* Nope, no change, we're done */
  'COMMAND MSG Un-indentable lines marked with selection level' ,
    select.2
    'COMMAND MSG Issue SET DISPLAY' select.2 'to view'
  'COMMAND SET DISPLAY' display.1 select.2 /* Make sure all visible */
  exit 0
ScanOpts:
  i=pos('(',a)
  if i>0 then if pos('(',a,i+1)>0
  then call Errstop 'Left parentheses not allowed in targets'
  parse var a a '(' opts
  if a='' then a='* 4 3'
  call ParseTarget
  parse var t lm in r
  if lm='' then lm=4
  if in='' then in=3
  if datatype(lm,'W')=0 | datatype(in,'W')=0 then call Errstop,
    'Left margin and Indent values must be whole numbers'
  if lm<0 | in<0 then call Errstop,
    'Left margin and Indent values cannot be negative'
  if r<>'' then call Errstop 'Incorrect arguments'
  if lm+in>trunc.1 then call Errstop,
    'Left margin plus Indent value cannot exceed the TRUNC setting'
  if lm=0 then call Errstop 'Left margin value must be greater than 0'
  if lm>trunc.1
  then call Errstop 'Left margin can''t exceed TRUNC setting'
  lm=lm-1
  do i=1 to words(opts)
      s=word(opts,i)
      select
        when s='CJ' then cj=1
        when s='CI' then ci=1
        otherwise call ErrStop 'Incorrect arguments'
      end
  end
  'LOCATE' target
  'EXTRACT/LINE/'
  endl = line.1
  ':'startl 'UP1'
  return
ParseTarget:
  target=''
  push a
  'PARSE 1 T'
  if rc<>0 then call Errstop 'Incorrect target'
  pull .
  pull t1 t2
  interpret 'parse var a' t1 'target' t1+t2 't'
  return
Lscan: Procedure expose com dqu squ i ds es lw
  arg s
  Select
      when com=1 then do
        k= pos('*/',s)
        if k>0 then do
            s= substr(s,k+2)
            com=2
        end
        else return 0
      end
      when dqu=1 then do
        k= pos('"',s)
        if k>0 then do
            s= substr(s,k+1)
            dqu=2
        end
        else return 0
      end
      when squ=1 then do
        k= pos("'",s)
        if k>0 then do
            s= substr(s,k+1)
            squ=2
        end
        else return 0
      end
      otherwise nop
  End
  qu = 0
  do until s2 = '' | s = ' '
      ls = 1+length(s)
      kcom = pos('/*',s)
      if kcom=0 then kcom=ls
      kdqu = pos('"',s)
      if kdqu=0 then kdqu=ls
      ksqu = pos("'",s)
      if ksqu=0 then ksqu=ls
      select
        when kcom<kdqu & kcom<ksqu then do
            if pos('*/',s,kcom+2) = 0 then do
              com = com-1
              parse var s s '/*'
              s2 = ''
            end
            else do
              parse var s s1 '/*' s2 '*/' s3
              s2 = '*'
              s=s1 s3
/* The following is to fix continuation detection when the line ends
  in a comment.
*/
              if s <> '' then            /* If we have anything ... */
              lw=translate(word(s,words(s)))  /* ...reset lastword */
            end
            iterate
        end
        when ksqu<kdqu then do
            qu = 1
            if pos("'",s,ksqu+1) = 0 then do
              squ = squ-1
              parse var s s "'"
              s2 = ''
            end
            else do
              parse var s s1 "'" s2 "'" s3
              s2 = '*'
              s=s1 s2 s3
            end
            iterate
        end
        when kdqu<ksqu then do
            qu = 1
            if pos('"',s,kdqu+1) = 0 then do
              dqu = dqu-1
              parse var s s '"'
              s2 = ''
            end
            else do
              parse var s s1 '"' s2 '"' s3
              s2 = '*'
              s=s1 s2 s3
            end
            iterate
        end
        otherwise s2 = ''
      end
  end
  if s = '' then do
      if qu=0 & com<1 & dqu=squ then com = com + 2
      return 0
  end
  k = 0
  s=translate(s,' ',';')
  do j=1 to words(s)
      w=word(s,j)
      select
        when w='DO' | w='SELECT' then do
            k=k+1; ds=i ds;
        end
        when w='END' then do
            k=k-1;
            if ds='' then es=es i
            ds=delword(ds,1,1);
        end
        otherwise nop
      end
  end
  return k
Errstop:
  parse arg m
  'SET MSGM ON'
  'EMSG' m
  'RESTORE'
  exit 16
Help:
  call Saydo
/*
REXXFORM <target left-margin indent>  <( <CJ> <CI> >
Defaults: target=*, left-margin=4, indent=3.
For more information, use HELP REXXFORM.
*/
  call Sayend
  exit 0
Saydo:  L1=sigl+2; return;
Sayend: Procedure Expose L1 sigl
  L2=sigl-2
  do i=L1 to L2
      'MSG' sourceline(i)
  end
  return
Syntax:
  rr = rc
  'EMSG REXXFORM LINE:' sigl sourceline(sigl)
  'EMSG +++' errortext(rr)
  'EMSG >>> error at file line 'i
  'RESTORE'
  exit 16

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX




----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Mickey Bee
2017-04-14 18:16:33 UTC
Permalink
Raw Message
Under ISPF, when in edit, type HI REXX on the command line, and choose your
options.

Mickey


-----Original Message-----
From: Phil Smith III
Sent: Friday, April 14, 2017 10:55 AM
To: TSO-***@VM.MARIST.EDU
Subject: Re: [TSO-REXX] REXX Syntax ISPF Edit Macro ?
Post by Dyck, Lionel B. , TRA
Is there a rexx edit macro that will highlight do/end select/otherwise/end
groupings to help identify when a missing or extra end is coded?
On VM we have REXXFORM XEDIT, which nicely indents, marks missing ENDs, etc.
It's pretty smart; you can confuse it with enough bad quotes and/or partial
comments, but it does detect those, just isn't always obvious where the
error is.

If someone wanted to update it to work in ISPF, that'd be way cool...

...phsiii

/*********************************************************************
*
* ROUTINE: REXXFORM
*
* PURPOSE: Structure/indent REXX execs
*
* AUTHOR: Robert Fowles, 02/04/84
* (based on original exec by Jeffery Almoney)
* Pennsylvania State University
* Center for Academic Computing
* 107 Computer Building
* University Park, PA 16802
* 814 865-4774
* SHARE Installation code: PSU
* Bitnet: ***@PSUVM
* Internet: ***@PSUVM.PSU.EDU
*
* REVISIONS:
* 11/20/90 RBF Include changes made in 07/25/85 by Denis J. Audet,
* Computing Centre, Univ of Ottawa: refine
* detection of comments and quotes across split
* lines, prevent truncation. Make changes based on
* ideas from ***@WATDCS.
* 11/20/90 RBF Change syntax to allow: reformatting of selected
* parts of file; left margin for all lines. Move
* Help info to Help File.
* 12/16/90 RBF Change name to REXXFORM (old name REXFORM).
* 03/17/91 RBF Add more syntax checking.
* 06/04/99 PHS Fix continuation detection after end-of-line comment;
* try to adjust end-of-line comments to make lines fit;
* mark unfittable lines via SET SELECT.
* 06/15/02 PHS Fix lines starting with literal ending in ":"
*********************************************************************/
arg a
if a='?' then call Help
signal on syntax
'COMMAND PRESERVE'
'COMMAND SET MACRO OFF'; 'COMMAND SET SYNONYM OFF';
'SET ZONE 1 *'; 'SET LINEND OFF'; 'SET IMAGE OFF';
'SET RANGE :0 *'; 'SET DISPLAY 0 *'; 'SET CASE M I'; 'SET AUTO OFF';
'EXTRACT /LINE/SIZE/TRUNC/SELECT'
startl = line.1
cj=0; ci=0;
call ScanOpts
com=0; dqu=0; squ=0; indent=0; cont=0; unbal=''; lines=0;
ds=''; /* Line-number stack for DO's and SELECT's. */
es=''; /* Line-number stack for END's. */
do i=startl to endl-1
'+1'
if rc>0 then leave
lines=lines+1
'EXTRACT/CURLINE/'; line=curline.3;
line = strip(line,'T')
sline=strip(line,'L')
if sline=' ' then iterate i
w1=' 'translate(word(sline,1))
parse var w1 w1 "'"
parse var w1 w1 '"'
lw=translate(word(line,words(sline)))
j = Lscan(sline)
if j>0 then lastdo=i
else if j<0 then indent=indent+j
if indent<0 then indent=1
if dqu > 0 | squ > 0 then do
if dqu = 2 then dqu = 0
if squ = 2 then squ = 0
iterate
end
else do
if com>0 then do
if cj then repline= sline
else if ci then repline=,
substr(' ',1,lm+(indent)*in) || sline
else repline= line
if com>1 then com=0
end
else
if (substr(w1,length(w1),1)=':' | word(line,2)=':') &,
index(w1, "'") = 0
then repline=substr(' ',1,max(0,lm+(indent-1)*in))||sline
else
repline= substr(' ',1,lm+cont+indent*in)||sline
if length(repline) > trunc.1 then /* It won't fit ... */
if right(line, 2) == '*/' then do /* Try to fix it */
xyzzy = length(repline) - length(line) /* Get l'overflow */
plugh = index(repline, copies(' ', xyzzy)' /* ') /* Cmt? */
if plugh > 0 then /* Got comment start & end, fix it */
repline = delstr(repline, plugh, xyzzy) /* Delete blanks */
end

if length(repline) > trunc.1 then do /* It still won't fit */
'EMSG *** Unable to indent',
' line:'i' within current XEDIT truncation setting ***'
'SET SELECT' select.2+1 /* Mark it so user can find it */
end
else if repline == line then nop
else 'REPLACE' repline
if com == -1 then com = 1
else if dqu == -1 then dqu = 1
else if squ == -1 then squ = 1
else if substr(lw,length(lw))=',' then cont=2
else cont=0
end
if j>0 then indent=indent+j
end
':'startl 'RESTORE'
if es<>'' then 'COMMAND EMSG Unbalanced "END"s at lines: 'es
if ds<>'' then do
nds=''
do i=1 to words(ds)
nds=word(ds,i) nds
end
'COMMAND EMSG Unbalanced "DO"s or "SELECT"s at lines: ' nds
end
if com>0 then 'COMMAND EMSG Unbalanced comment'
if squ+dqu>0 then 'COMMAND EMSG Unbalanced string constant'
'COMMAND MSG' lines 'lines restructured from' startl 'to' endl-1
s=select.2 /* Remember old max selection level */
'COMMAND EXTRACT /DISPLAY/SELECT' /* Get possible new level */
if s=select.2 then exit 0 /* Nope, no change, we're done */
'COMMAND MSG Un-indentable lines marked with selection level' ,
select.2
'COMMAND MSG Issue SET DISPLAY' select.2 'to view'
'COMMAND SET DISPLAY' display.1 select.2 /* Make sure all visible */
exit 0
ScanOpts:
i=pos('(',a)
if i>0 then if pos('(',a,i+1)>0
then call Errstop 'Left parentheses not allowed in targets'
parse var a a '(' opts
if a='' then a='* 4 3'
call ParseTarget
parse var t lm in r
if lm='' then lm=4
if in='' then in=3
if datatype(lm,'W')=0 | datatype(in,'W')=0 then call Errstop,
'Left margin and Indent values must be whole numbers'
if lm<0 | in<0 then call Errstop,
'Left margin and Indent values cannot be negative'
if r<>'' then call Errstop 'Incorrect arguments'
if lm+in>trunc.1 then call Errstop,
'Left margin plus Indent value cannot exceed the TRUNC setting'
if lm=0 then call Errstop 'Left margin value must be greater than 0'
if lm>trunc.1
then call Errstop 'Left margin can''t exceed TRUNC setting'
lm=lm-1
do i=1 to words(opts)
s=word(opts,i)
select
when s='CJ' then cj=1
when s='CI' then ci=1
otherwise call ErrStop 'Incorrect arguments'
end
end
'LOCATE' target
'EXTRACT/LINE/'
endl = line.1
':'startl 'UP1'
return
ParseTarget:
target=''
push a
'PARSE 1 T'
if rc<>0 then call Errstop 'Incorrect target'
pull .
pull t1 t2
interpret 'parse var a' t1 'target' t1+t2 't'
return
Lscan: Procedure expose com dqu squ i ds es lw
arg s
Select
when com=1 then do
k= pos('*/',s)
if k>0 then do
s= substr(s,k+2)
com=2
end
else return 0
end
when dqu=1 then do
k= pos('"',s)
if k>0 then do
s= substr(s,k+1)
dqu=2
end
else return 0
end
when squ=1 then do
k= pos("'",s)
if k>0 then do
s= substr(s,k+1)
squ=2
end
else return 0
end
otherwise nop
End
qu = 0
do until s2 = '' | s = ' '
ls = 1+length(s)
kcom = pos('/*',s)
if kcom=0 then kcom=ls
kdqu = pos('"',s)
if kdqu=0 then kdqu=ls
ksqu = pos("'",s)
if ksqu=0 then ksqu=ls
select
when kcom<kdqu & kcom<ksqu then do
if pos('*/',s,kcom+2) = 0 then do
com = com-1
parse var s s '/*'
s2 = ''
end
else do
parse var s s1 '/*' s2 '*/' s3
s2 = '*'
s=s1 s3
/* The following is to fix continuation detection when the line ends
in a comment.
*/
if s <> '' then /* If we have anything ... */
lw=translate(word(s,words(s))) /* ...reset lastword */
end
iterate
end
when ksqu<kdqu then do
qu = 1
if pos("'",s,ksqu+1) = 0 then do
squ = squ-1
parse var s s "'"
s2 = ''
end
else do
parse var s s1 "'" s2 "'" s3
s2 = '*'
s=s1 s2 s3
end
iterate
end
when kdqu<ksqu then do
qu = 1
if pos('"',s,kdqu+1) = 0 then do
dqu = dqu-1
parse var s s '"'
s2 = ''
end
else do
parse var s s1 '"' s2 '"' s3
s2 = '*'
s=s1 s2 s3
end
iterate
end
otherwise s2 = ''
end
end
if s = '' then do
if qu=0 & com<1 & dqu=squ then com = com + 2
return 0
end
k = 0
s=translate(s,' ',';')
do j=1 to words(s)
w=word(s,j)
select
when w='DO' | w='SELECT' then do
k=k+1; ds=i ds;
end
when w='END' then do
k=k-1;
if ds='' then es=es i
ds=delword(ds,1,1);
end
otherwise nop
end
end
return k
Errstop:
parse arg m
'SET MSGM ON'
'EMSG' m
'RESTORE'
exit 16
Help:
call Saydo
/*
REXXFORM <target left-margin indent> <( <CJ> <CI> >
Defaults: target=*, left-margin=4, indent=3.
For more information, use HELP REXXFORM.
*/
call Sayend
exit 0
Saydo: L1=sigl+2; return;
Sayend: Procedure Expose L1 sigl
L2=sigl-2
do i=L1 to L2
'MSG' sourceline(i)
end
return
Syntax:
rr = rc
'EMSG REXXFORM LINE:' sigl sourceline(sigl)
'EMSG +++' errortext(rr)
'EMSG >>> error at file line 'i
'RESTORE'
exit 16

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to ***@VM.MARIST.EDU with the message: INFO TSO-REXX
Loading...