View previous topic :: View next topic
|
Author |
Message |
dineshsjce Currently Banned New User
Joined: 16 Apr 2007 Posts: 41 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
k.junaid83
New User
Joined: 19 Apr 2006 Posts: 22 Location: bangalore
|
|
|
|
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 |
|
|
dineshsjce Currently Banned New User
Joined: 16 Apr 2007 Posts: 41 Location: Bangalore
|
|
|
|
Thanks junaid83,
It was very helpful and worked. |
|
Back to top |
|
|
|