Code:
h dftactgrp(*no) actgrp(*caller) option(*srcstmt) h bnddir('QC2LE') d counter s 3s 0 d displayme s 20 d isodate s d inz d n12 s 12s 0 d pointer s * d reply s 1 d response s 4096a d rundte s 6s 0 d token S 160A varying d DS dstrtok PR * ExtProc('strtok') d string * value options(*string) d delim * Value Options(*string) /free response = 'tree,dog,bird,,cow,horse,flower'; response = %scanrpl(',,' : ', ,' : response); reset counter; pointer = strtok(response: ','); dow (pointer <> *null); counter+=1; token = %trim(%str(pointer)); pointer = strtok(*null: ','); displayme = %trim(token); dsply displayme reply; enddo; *inlr = *on;
Comment