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
2. second time in a loop would return "C" in a WS-TMP.
then: "D", "EFGH" and finally "I"
Number of delimiters ("/") varies of course, length of each part between a delimiter varies, too.
I prefer an ANSI 85 solution, I use Microsoft Cobol 5.0 (DOS version), made by MicroFocus.
Is it possible to do this with an UNSTRING command or should I use a PERFORM?
Thanks for your help.
Saso
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
2. second time in a loop would return "C" in a WS-TMP.
then: "D", "EFGH" and finally "I"
Number of delimiters ("/") varies of course, length of each part between a delimiter varies, too.
I prefer an ANSI 85 solution, I use Microsoft Cobol 5.0 (DOS version), made by MicroFocus.
Is it possible to do this with an UNSTRING command or should I use a PERFORM?
Thanks for your help.
Saso