Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
I have a field in a customer master that contains both City and state. I want to move state to another field. My thought process is to load the address into an array, read from the last postion untill I find the first no blank field, read one more then I have the state. here is the code
D ds
D address 30 dim(1)
D cycyst 30 overlay(Address)
x = 30;
dou address(x)<> ' ';
x = x-1;
enddo;
x = x-1;
field6 = %subst(Cucyst:x:2);
I am getting a subscript out of range on the second pass (when x=29)
any ideas ?
thanks