RPG %SPLIT now handles blank sub-strings [email protected] (Simon Hutchinson)

​When it was introduced in IBM i 7.4 I thought the Split built in function, BiF, would be useful way to break apart a string into pieces. The one frustration I had with it was when two separators were next to one another %SPLIT would not regard it as an empty, or null, sub-string.
Let me jump straight into my RPG program to demonstrate how this works. Let me start with all the definitions, etc.

01 **free
02 dcl-s String varchar(100) inz(‘RED,,BLUE,,GREEN,,,BLACK’) ;
03 dcl-s Piece char(10) ;
04 dcl-s Array char(10) dim(*auto:999) ;

Read more » Read More 

Verified by MonsterInsights