View previous topic :: View next topic |
Author |
Message |
madisand Beginner
Joined: 29 Aug 2005 Posts: 19 Topics: 7
|
Posted: Wed Dec 28, 2005 12:07 pm Post subject: unstring |
|
|
Hi all,
I have a problem with unstring
input data
mvsforums
mvs forums
mvs forums com
mvs forums com new
i Want an output like this
mvsforums
mforums
mforums com
mforums com new
I need the the first byte of the first portion of the string & all the data following the first delimter only. Can any one help me |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Dec 29, 2005 6:09 am Post subject: |
|
|
madisand,
Your output pattern is not consistent.
ex:
input = mvsforums
output = mvsforums
Technically the output should only be M as you need to pick the first byte of the string before a space.
try this code
Code: |
01 W-INP-STR PIC X(50).
01 W-OUT-STR.
05 W-STR1 PIC X(01).
05 W-STR2 PIC X(49).
MOVE 'mvs forums com new' TO W-INP-STR
INSPECT W-INP-STR REPLACING FIRST ' ' BY ')'
UNSTRING W-INP-STR DELIMITED BY ')'
INTO W-STR1, W-STR2
DISPLAY W-OUT-STR
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|