Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COPY REPLACE is not working

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: COPY REPLACE is not working
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

Site Director


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

PostPosted: Thu Nov 13, 2008 9:29 am    Post subject:
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    Post subject:
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 http://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    Post subject: Reply to: COPY REPLACE is not working
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 5 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us