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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am


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