Select specific field in AS400



Hi all,
Below screenshot is from IBM as400 screen.
What i want to do is, to check ATS column and find the one that is not null and put “1” in the XX column for the corresponding row and press enter.
I tried substring, for each and get text activity but i couldn’t insert “1” to the correct row. I always end up with “1” on the first row of the XX column. I think I’m failing to check the ATS column for non-null values.

Can anyone help me with this issue?
Thanks in advance.

my process screenshot;