On 14-Jun-2017 17:11 -0600, Booth Martin wrote:
I need to locate all the words over 8 characters in a file of 90
columns by 1500 rows.
Is that 90 columns [of a SQL TABLE, as in 90 "fields"] of a database
file, or was the intent to describe the scenario as having a
90-character record length; i.e. one varying or fixed-length column with
a maximum of 90-characters?
By "locate", does that imply a concatenation of each "word"
qualifying for the search will be the row output, for each row for which
such a "word" is present, or, that the original row/column from the file
is the output when the condition is met whereas any rows without a
9+_character_word would be omitted. Or perhaps original column values
presented for qualifying search, and the NULL value for any column for
which no qualifying "word" is located?
What I have figured out is real Rube Goldberg. RPG or SQL? Or? What
makes sense to you?
Note: REXX has a WORD function; would the effects of that function be
compatible with the definition of "words" used in the OP? Then there is
additionally, a WORDS function, to obtain a count to know how many to
process against which to perform the LENGTH function.
Regardless of answers to any prior questions, I would probably
implement the feature as a UDF if the feature will be invoked across
more than the one file, irrespective the underlying language(s), and
invoke with SQL; e.g.:
select locate_words_over_eight_chars(column_name)
, ...
from the_file_of_90_columns
where /* optionally use the UDF to include/exclude rows;
e.g. udf(col)<>'', or perhaps udf(col) is not null */
If the process/feature is specific to the one or similar files, and
the REXX capabilities match the requirements for "words", then I would
probably just write the code in REXX SQL; i.e. use SQL coded in REXX to
obtain the data as REXX strings with FETCH, and use the REXX string
functions to parse those strings.