View previous topic :: View next topic
|
Author |
Message |
sashi
New User
Joined: 14 Sep 2005 Posts: 54 Location: Chennai
|
|
|
|
Hi,
I have a Input filed with PIC X(50)
in that I may get data as follows
05 WS-VAR-A PIC X(50)
05 WS-OTHER-NAME PIC X(50)
WS-VAR-A = ANDREW*FLINTOFF
WS-OTHER-NAME = SACHIN
and finally at the end WS-VAR-A should have ANDREW*SACHIN
WS-VAR-A = ANDREW*SACHIN
I have tryed with INSPECT and REPLACE but its not working
l;ike
INSPECT WS-VAR-A REPLACING BY WS-OTHER-NAME BY AFTER C-ST
where C-ST defined as '*'
Can anyone explain ??? |
|
Back to top |
|
|
Ranjithkumar
New User
Joined: 10 Sep 2008 Posts: 93 Location: India
|
|
|
|
Do you need solution for your requirement or explanation for why your method dint worked? |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
Plse look at string/unstring with count & pointer options |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I have tryed with INSPECT and REPLACE but its not working
l;ike
INSPECT WS-VAR-A REPLACING BY WS-OTHER-NAME BY AFTER C-ST |
What you wanted is clear, but there is no reason to assume the compiler will generate the desired code. . .
When trying something new, it is best to review the material in the manual before coding/testing. To help with this, there is an "IBM Manuals" link at the top of the page. At the top of the list are manuals for various COBOL compilers.
If you read something n the manual that is not clear, post what you found and your doubt. Someone will be able to clarify. |
|
Back to top |
|
|
div
New User
Joined: 01 Jul 2007 Posts: 1 Location: bangalore
|
|
|
|
INSPECT WS-VAR-A REPLACING CHARACTERS BY WS-OTHER-NAME AFTER C-ST
AFTER INITIAL '*' |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Yup, you've "been here" for a while, but this is your first post
When posting a "solution" it is best to provide more than something cryptic. . .
It is surely not clear as to why there are 2 "after"s. . .
Showing code can be helpful, but providing a bit of an explanation would be even more helpful. |
|
Back to top |
|
|
|