The part I was missing (And didn't know existed) was WORD
The hardest part in being a newbie, is not knowing what tools exists,
when you try to translate thought patterns from other langs.
So - Thank you.
and -code- in case anyone else stumbles upon here.
Used this to parse the "SUPERC.LIST" output to words
Code: Select all
/* Rexx -1----+----2----+----3----+----4----+----5----+----6----+----7*/
SAY "---- LINE TO STEM ----"
/* Set file vars */
DD_NAME = "Prefix.SUPERC.LIST"
/* Alloc file */
Address tso
"ALLOC F(INDD) DA("DD_NAME") SHR REUSE"
SAY " - Alloc RC = ["rc"]"
/* Read file to stem*/
"EXECIO * DISKR INDD (STEM REC. FINIS"
Say " - Read RC = ["rc"]"
/* Release file */
"FREE F(INDD)"
Say " - Free RC = ["rc"]"
/* Parse stem */
DO i=1 to REC.0 /* REC.0 holds arr len */
PARSE VAR REC.i STR
wordCount = WORDS(STR)
SAY "Line ["i","wordCount"] = "STR
DO j=0 to wordCount
loc = j+1 /* word count starts at 1 */
SAY "Line ["i","j"] = " WORD(STR,loc)
END
END
/* End prog */
Say " - Gen RC = ["rc"]"
SAY "---- EXIT ----"
EXIT