Ed.
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
Regards,
Herman Stocker
Ed.
- --
The sender believes that this E-mail and any attachments were free of any
virus, worm, Trojan horse, and/or malicious code when sent. This message and
its attachments could have been infected during transmission. By reading the
message and opening any attachments, the recipient accepts full
responsibility for taking protective and remedial action about viruses and
other defects. The sender's employer is not liable for any loss or damage
arising in any way from this message or its attachments.
Assuming these are words separated by spaces, you can use:
NUMWORDS = WORDS(line)
The TSO/E Rexx Language Reference is the one you want, on the TSO/E
shelf in the z/OS library.
HTH
Peter
This message and any attachments are intended only for the use of the addressee and
may contain information that is privileged and confidential. If the reader of the
message is not the intended recipient or an authorized representative of the
intended recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this communication in
error, please notify us immediately by e-mail and delete the message and any
attachments from your system.
PARSE VAR Line One Two Three TheRest
IF TheRest = "" THEN
<there were no more than three words in the line>
ELSE
<there were more than three words in the line>
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf
Of Ed Benoit
Sent: Friday, October 30, 2009 3:30 PM
To: TSO-...@VM.MARIST.EDU
Subject: REXX Parse question
FINAL_VALUE = WORD(LINE,3+(WORDS(LINE)=4))
- Rick
>>> Walter Pachl <pa...@CHELLO.AT> 10/30/2009 12:36 PM >>>
Martin
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of
I used to know two guys who bet cups of coffee on who could get the most work done with a single statement (not in REXX, but similar). It was fun to watch these guys at the blackboard. (Then they'd bet on the poker hands on the paper cups).
- Rick
>>> Martin Cox <Marti...@AOL.COM> 11/2/2009 9:50 AM >>>
Or, if that really is what is required, to put it more simply:
FINAL_VALUE = WORD(WORDS(LINE))
Martin
-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of
Rick Woods
Sent: 02 November 2009 14:01
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] REXX Parse question
Because if the line has 4 words, you want the fourth one. Otherwise, you
want the third one.
Do it all in one statement:
I love both of these.
I neither know nor care whether they are better or not.
They are REXXish, Ricks a bit fiendishly so.
When can I enroll in your next REXX class
Thank you.
F_V = REVERSE(WORD(REVERSE(LINE),1))
Is my one liner.
Martin, I think
FINAL_VALUE = WORD(WORDS(LINE))
seems to have a small problem. Is
FINAL_VALUE = WORD(LINE, WORDS(LINE))
what you had in mind
Still we may have all gone off on a tangent.
Did he say that he was after only the last word?
David.Speake
David....@bcbssc.com
(803)-264-8003
(803)-288-2227 X48003
(800)-288-2227 X48003
After all, REXX = King!
- Rick
>>> David S Speake <David....@BCBSSC.COM> 11/3/2009 3:07 PM >>>