IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Inspect and replacing....


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sashi

New User


Joined: 14 Sep 2005
Posts: 54
Location: Chennai

PostPosted: Thu Apr 15, 2010 7:50 pm
Reply with quote

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
View user's profile Send private message
Ranjithkumar

New User


Joined: 10 Sep 2008
Posts: 93
Location: India

PostPosted: Thu Apr 15, 2010 9:32 pm
Reply with quote

Do you need solution for your requirement or explanation for why your method dint worked?
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Apr 15, 2010 10:05 pm
Reply with quote

Hi !

Plse look at string/unstring with count & pointer options
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 15, 2010 10:14 pm
Reply with quote

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
View user's profile Send private message
div

New User


Joined: 01 Jul 2007
Posts: 1
Location: bangalore

PostPosted: Wed Apr 21, 2010 1:09 pm
Reply with quote

INSPECT WS-VAR-A REPLACING CHARACTERS BY WS-OTHER-NAME AFTER C-ST


AFTER INITIAL '*'
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Apr 21, 2010 7:49 pm
Reply with quote

Hello and welcome to the forum,

Yup, you've "been here" for a while, but this is your first post icon_smile.gif

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Finding record and replacing with val... DFSORT/ICETOOL 3
No new posts Replacing character string in file th... JCL & VSAM 9
No new posts Replacing PDSMAN with PDSFAST JCL & VSAM 10
No new posts JCL for replacing code in Cobol JCL & VSAM 7
Search our Forums:

Back to Top