View previous topic :: View next topic
|
Author |
Message |
saubhik
New User
Joined: 21 Sep 2007 Posts: 35 Location: kolkata
|
|
|
|
Can anyone tell me Examine and Inspect Equivalent in PL1. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
quickly said, see in reference manual
SEARCH SEARCHFR TRANSLATE ...
What a pleasure to read manual ! |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
What a pleasure to read manual !
|
Okay, sarcasm on a Monday ... or you've got a really, really, really, really different interpretation of "pleasure" than I do. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Okay ! You also can learn in a modern education class listening to a marvellous teacher.
|
|
Back to top |
|
|
saubhik
New User
Joined: 21 Sep 2007 Posts: 35 Location: kolkata
|
|
|
|
I will be glad if someone can explain me by giving some examples. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
Can you give more details on your requirements?
I guess you are a specific need. If not, like I said, read manual always help. |
|
Back to top |
|
|
saubhik
New User
Joined: 21 Sep 2007 Posts: 35 Location: kolkata
|
|
|
|
I have a string containing character * and & and i want to remove this character by space or something.It is possible in cobol..but how is it possible in PL1. |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
You can use TRANSLATE
Quote: |
TRANSLATE ( x, y z )
x Character expression to be searched for possible translation of its characters.
y Character expression containing the translation values of characters.
z Character expression containing the characters that are to be translated. If z is omitted, it defaults to collate().
TRANSLATE operates on each character of x as follows:
If a character in x is found in z, the character in y that corresponds to that in z is copied to the result; otherwise, the character in x is copied
directly to the result. If z contains duplicates, the leftmost occurrence is used.
y is padded with blanks, or truncated, on the right to match the length of z.
Any arithmetic or bit arguments are converted to character. TRANSLATE does not support GRAPHIC or WIDECHAR data.
|
Code: |
ZONA = TRANSLATE(ZONO,' ',','); |
or code within a loop
DO I = 1 To ... UNTIL ( .... );
code...
END; |
|
Back to top |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
Code: |
DCL X CHAR(LENGTH(SOURCE))
X=TRANSLATE(SOURCE,'*&',' ') |
|
|
Back to top |
|
|
|