I checked all the versions you provided.
I will use the first solution (PHV's solution).
I see I was not far from the solution myself. Mistake I made was adding 1 to the UNSTRING POINTER. I didn't know that it gets updated automaticaly.
If I remove
move 2 to ws-pointer
from my code it...
First, thank you all. I will check all these possibilites tomorrow (because of a time difference). I will post my results tomorrow.
Again, thank you all.
Saso
Thanks for your answer.
Well, I tried UNSTRING with a POINTER. But this does not do what I want to do.
I want to UNSTRING variable number of tokens from a string.
$set ans85
identification division.
program-id. abcd.
working-storage section.
01 strtmp pic...
Hi all,
how can I perform an UNSTRING in a loop?
For example:
I have a varible WS-MY-STRING PIC X(100) value "AB/C/D/EFGH/I"-
WS-TMP is my destination variable (PIC X(100)).
I would like to have a loop to extract a different part of the string:
1. first time I would get "AB" into a WS-TMP...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.