View previous topic :: View next topic |
Author |
Message |
mfuser Banned
Joined: 01 Mar 2005 Posts: 105 Topics: 58
|
Posted: Wed Jul 12, 2006 1:08 pm Post subject: Inspect Equivalent in PLI |
|
|
Members,
I would like to know what would be the equivalent of the statement in Cobol to PLI:
Code: |
INSPECT WS-VARIABLE REPLACING ALL 'A' BY 'Z'
|
Can any body help me out in this problem ? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12385 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
Grant Beginner
Joined: 02 Dec 2002 Posts: 45 Topics: 1 Location: Sydney, NSW, Australia
|
Posted: Thu Jul 13, 2006 8:27 pm Post subject: |
|
|
Use the TRANSLATE builtin function
Code: |
DCL WS_VARIABLE CHAR(24) INIT('AXZZ1234HKJHJHEUUIAA ');
WS_VARIABLE = TRANSLATE(WS_VARIABLE,'Z','A');
PUT SKIP DATA(WS_VARIABLE);
RESULT:
WS_VARIABLE='ZXZZ1234HKJHJHEUUIZZ ';
|
|
|
Back to top |
|
 |
|
|