View previous topic :: View next topic
|
Author |
Message |
Daphne
New User
Joined: 28 Aug 2006 Posts: 27 Location: NY, US
|
|
|
|
Hi all,
I have this copy book which has two different prefixes. How do I replace each prefix with a different string.
This is the copy book.
05 :A03:-POS1.
10 :A03:-PRODUCT PIC X(3).
10 :A03:-CLIENT PIC X(3).
05 :A05:-POS1 REDEFINES :A03:-POS1.
10 :A05:-PRODUCT PIC X(3).
10 :A05:-CLIENT PIC X(3).
Now in cobol I replaced them as below
COPY copybook REPLACING ==:A03:== BY ==NEW==,
==:A05:== BY ==OLD==.
Now this gives me error.
Can someone tell me what's wrong and how exactly I should do this?
Thanks in advance,
Daphne |
|
Back to top |
|
|
MFRASHEED
Active User
Joined: 14 Jun 2005 Posts: 186 Location: USA
|
|
|
|
What error message are you getting?
Looks nothing wrong with COPY statement you have it should work if there is a preceding 01 level before copybook declaration. |
|
Back to top |
|
|
Daphne
New User
Joined: 28 Aug 2006 Posts: 27 Location: NY, US
|
|
|
|
Hi,
Thanks for the reply.
I am getting the following error message.
IGYDS1089-S "REPLACING" was invalid.
Yes I have the 01 level before copy.
Thanks,
Daphne |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Daphne,
worked file for me. What compiler version are you using?
Code: |
01 DATA-RECORD-1.
COPY TESTCB1 REPLACING ==:A03:== BY ==NEW==,
==:A05:== BY ==OLD==.
05 NEW-POS1.
10 NEW-PRODUCT PIC X(3).
10 NEW-CLIENT PIC X(3).
05 OLD-POS1 REDEFINES NEW-POS1.
10 OLD-PRODUCT PIC X(3).
10 OLD-CLIENT PIC X(3).
|
Dave |
|
Back to top |
|
|
Daphne
New User
Joined: 28 Aug 2006 Posts: 27 Location: NY, US
|
|
|
|
Hi,
Fault was mine. I had missed a blank there. It is working fine now.
Thank you guys for your time.
Daphne |
|
Back to top |
|
|
|