>>A recent note asked how, in REXX, to parse a record in this format:
>>"word1 word2.word3 word4:word5.word6 word7 hh.mm.ss"
>
>I admit, I did something similar myself in the compact solution I tendered,
and for which I was admonished for needless complexity.
I absolutely liked your solution,
On Sun, 26 Feb 2017 14:41:14 -0600, William W. Collier wrote:
>A recent note asked how, in REXX, to parse a record in this format:
>"word1 word2.word3 word4:word5.word6 word7 hh.mm.ss"
>...
> A friend, Harry Elder (hik...@gmail.com), offers this solution:
>input = "word1 word2.word3
A recent note asked how, in REXX, to parse a record in this format:
"word1 word2.word3 word4:word5.word6 word7 hh.mm.ss"
into these variables.
var1 = "word1"
var2 = "word2.word3"
var3 = "word4:word5.word6"
var4 = "word7"
var5 = "hh"
var6 = "mm"
var7 = "ss"
A friend, Harry Elder
In article Peter wrote:
> This is some Friday fun with parsing with REXX. First I was baffled with
> the result, now I understand. So *no* I will not join the TSO/REXX list
> ;-)
> I've got a data set to process with REXX. The records are of format:
>
> "word1
On Fri, 24 Feb 2017 11:33:48 -0700, Sri h Kolusu wrote:
>>>The following performs the operation with a single PARSE:
>
>It can be done without the value SPACE
>
>STR = "WORD1 WORD2.WORD3 WORD4:WORD5.WORD6 WORD7 HH.MM.SS"
>PARSE VAR STR VAR1 ' ' VAR2 ' ' VAR3 ' ' VAR4 ' ' VAR5 '.' VAR6 '.' VAR7
lt;000433f07816-dmarc-requ...@listserv.ua.edu>
To: IBM-MAIN@LISTSERV.UA.EDU
Date: 02/24/2017 11:08 AM
Subject: Re: Friday fun with REXX and PARSE
Sent by:IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU>
On Fri, 24 Feb 2017 06:53:54 -0500, Tony Thigpen
On Fri, 24 Feb 2017 06:53:54 -0500, Tony Thigpen wrote:
>Steve has it right. Literals take precedent. So it works like this:
>
>Step 1) split as Temp1 '.' Temp2 '.' Temp3
>...
>Step 2) split the "temps" based on the parsing between literals:
>...
>
The following performs the operation
Peter,
Same here haven't seen this strangeness in rexx "the wonder horse"...usung
rexx since 1984.
Scott
On Fri, Feb 24, 2017 at 7:50 AM Peter Hunkeler wrote:
>
>
> >Steve has it right. Literals take precedent. So it works like this:
>
>
>
>
>
> Yep. This is it. Literals split
>Steve has it right. Literals take precedent. So it works like this:
Yep. This is it. Literals split the source into multiple sources, then PARSE
applies "parsing into words" on the individual source parts.
I'm just astonished I have never before stumbled across this in my 33+ years
with a
>Peter needs to slightly, but easily modify his PARSE to get the correct
>results. Just watch your ':' and '.'... ;-)
Nope, carefully read the manual. Throw away what you think is how PARSE works.
--
Peter Hunkeler
--
For
>have a look into the data in hex format. there are probably non printable
>characters there between word 2 and 3, causing this parsing.
Wrong guess.
--
Peter Hunkeler
--
For IBM-MAIN subscribe / signoff / archive access
Steve has it right. Literals take precedent. So it works like this:
Step 1) split as Temp1 '.' Temp2 '.' Temp3
so: Temp1 = word1 word2
Temp2 = word3 word4:word5
Temp3 = word6 word7 hh.mm.ss
Step 2) split the "temps" based on the parsing between literals:
so: Parse Temp1 with var1 var2
ntended recipient, is prohibited. If you are not the intended recipient,
please inform the sender and delete all copies.
-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf
Of Peter Hunkeler
Sent: Friday, February 24, 2017 4:33 AM
To: IBM-MAIN@
Looks to me your literal delimiter took precedent over space delimiters.
In other words, PARSE looked for "." first, and found "word3 word4:word5"
between the specified literals.
On Fri, Feb 24, 2017 at 3:32 AM, Peter Hunkeler wrote:
> This is some Friday fun with parsing with
Itschak Mugzach wrote:
>have a look into the data in hex format. there are probably non printable
>characters there between word 2 and 3, causing this parsing.
No, I got the same results like Peter. No strange characters involved.
Peter needs to slightly, but easily modify his PARSE to get
Peter,
have a look into the data in hex format. there are probably non printable
characters there between word 2 and 3, causing this parsing.
ITschak
On Fri, Feb 24, 2017 at 11:32 AM, Peter Hunkeler wrote:
> This is some Friday fun with parsing with REXX. First I was baffled
This is some Friday fun with parsing with REXX. First I was baffled with the
result, now I understand. So *no* I will not join the TSO/REXX list ;-)
I've got a data set to process with REXX. The records are of format:
"word1 word2.word3 word4:word5.word6 word7 hh.mm.ss"
What I need is each
17 matches
Mail list logo