I need to process some data which is generated on UNIX. The data is
in tab separated format. That is, each element is separated by a tab
(x'05' in EBCDIC). What I'm doing is similar to:
tab='05'x
/* assume data is in non-stem variable data */
/* I will put each value in data.n where n starts at 1 */
data.0=0
i=0
do while length(data) > 0
i=i+1
parse var data value (tab) data
data.i=value
data.0=i
end
OK, I can tighten it up a bit by using "data.i" in the parse instead of the
temporary variable "value". And I don't need to assign i to data.0 on
each iteration; I could do it after the "end" of the loop. But I do this just
in case a less knowledgeable person needs to modify the code. I,
personally, consider it easier to understand this way. But I could be
wrong, of course.
What I am hoping for is a "better" or "more understandable" algorithm.
No, I can't
translate the tabs to blanks, or likely do any other type of
translate. The values
may legitimately have blanks as part of the value. Or even other
characters except for tabs.
--
This is a test of the Emergency Broadcast System. If this had been an
actual emergency, do you really think we'd stick around to tell you?
Maranatha! <><
John McKown
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to
LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX