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

COPY REPLACE is not working


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

New User


Joined: 16 Apr 2007
Posts: 41
Location: Bangalore

PostPosted: Thu Nov 13, 2008 8:51 am
Reply with quote

Hi friends,

I have a problem in COPY REPLACING statement in my COBOL program where in the string is not getting replaced.

COPY ADF406 REPLACING ==XXXX== BY ==IS01==.


Tha elements in copybook ADF406 are like this:

05 XXXX-GL-NO.

10 XXXX-GL-NO-E

10 XXXX-GL-NO-SYMBOL

05 XXXX-M-CODE


During compilation, The XXXX is not getting replaced by IS01
Can someone please tell me what is the problem?
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 Nov 13, 2008 9:29 am
Reply with quote

Hello,

What does happen? If you post what the compiler shows for this statement and any warnings at the end of the compile it will help.

You might also use the forum SEARCH in the COBOL part of the forum and look at several similar topics.
Back to top
View user's profile Send private message
k.junaid83

New User


Joined: 19 Apr 2006
Posts: 22
Location: bangalore

PostPosted: Thu Nov 13, 2008 10:48 am
Reply with quote

You would require to change your orignal copy book variables.
For the replacing command to work you would need to prefix and postfix the word u want to replace by :.So your orignal copybook will look like.


05 :XXXX:-GL-NO.

10 :XXXX:-GL-NO-E

10 :XXXX:-GL-NO-SYMBOL

05 :XXXX:-M-CODE


Now your copy statement will be as follows

COPY ADF406 REPLACING ==:XXXX:== BY ==IS01==.

Also refer ibmmainframes.com/viewtopic.php?p=121344&highlight=#121344
Back to top
View user's profile Send private message
dineshsjce
Currently Banned

New User


Joined: 16 Apr 2007
Posts: 41
Location: Bangalore

PostPosted: Thu Nov 13, 2008 9:52 pm
Reply with quote

Thanks junaid83,
It was very helpful and worked.
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
Search our Forums:

Back to Top