I am not sure if stringTokenizor
http://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_ClassStringTokenizer.html is the best here. It is designed for cases where the delimiter is constant between fields such as the case with CSV or Informix unload files.
So if you had "," as the delimiter, then you would have something like ...
Define g_temp CHAR(1000),
Array g_arr OF RECORD
r_code char(3),
r_desc char(100),
r_date date
END RECORD
DEFINE tok base.StringTokenizer
DEFINE idx INTEGER
Main
Let g_temp = "ABC,TESTING,10/MAY/2016,ZXY,LOOK AT THIS,31/AUG/2016,REG,NICE ONE,04/NOV/2016"
LET tok = base.StringTokenizer.create(g_temp,",")
LET idx = 0
WHILE tok.hasMoreTokens()
LET idx = idx + 1
LET g_arr[idx].r_code = tok.nextToken()
LET g_arr[idx].r_desc = tok.nextToken()
LET g_arr[idx].r_date = tok.nextToken()
WHILE
End Main
If the delimiter between each field was different as in your example, I'd be using base.String methods
http://4js.com/online_documentation/fjs-fgl-manual-html/#c_fgl_datatypes_STRING_methods.htmlDefine g_temp STRING,
Array g_arr OF RECORD
r_code char(3),
r_desc char(100),
r_date date
END RECORD
DEFINE idx INTEGER
DEFINE pos1a, pos2,pos3,pos1b INTEGER
Main
Let g_temp = "<<<<1<<ABC<<<<2<<TESTING<<<<3<<10/MAY/2016<<<<1<<ZXY<<<<2<<LOOK AT THIS<<<<3<<31/AUG/2016<<<<1<<REG<<<<2<<NICE ONE<<<<3<<04/NOV/2016"
LET idx = 0
WHILE TRUE
LET pos1a = g_temp.getIndexOf("<<<<1<<",1)
LET pos2 = g_temp.getIndexOf("<<<<2<<",pos1)
LET pos3 = g_temp.getIndexOf("<<<<3<<",pos2)
LET pos1b = g_temp.getIndexOf("<<<<1<<",pos3)
IF pos1b = 0 THEN -- End of file
LET pos1b = g_temp.getLength()+1
END IF
LET idx = idx + 1
LET g_arr[idx].r_code = g_temp.subString(pos1a+7,pos2-1)
LET g_arr[idx].r_desc = g_temp.subString(pos2+7,pos3-1)
LET g_arr[idx].r_date = g_temp.subString(pos3+7,pos1b-1)
LET g_temp = g_temp.subString(pos1b, g_temp.getLength())
IF g_temp.getLength() = 0 THEN
EXIT WHILE
END IF
END WHILE
End Main
... you will need to add some additional code to handle cases where pos1,pos2,pos3 are zero, (and you should double check my maths) but the important thing is for you to see the base.String methods getIndexOf and subString.
Reuben