| View previous topic :: View next topic |
| Author |
Message |
sankar narayanan Beginner
Joined: 16 Oct 2007 Posts: 29 Topics: 12
|
Posted: Wed Jun 18, 2008 5:05 am Post subject: copy command |
|
|
Hi All,
Im using the below statement in one of my programs and Im getting the below error. Please help me to rectify this error.
Statement:
COPY ZRCXML51 REPLACING
THE-FIELD-TAG BY CUST-PHONE6-TAG
THE-FIXED-STRING BY PHONE-NUMBER(6) OF EXTRACT-RECORD.
Error:
THE "COPY" STATEMENT WAS INVALID. EXPECTED "BY", BUT FOUND "EXTRACT-RECORD". THE STATEMENT WAS DISCARDED. |
|
| Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Jun 18, 2008 5:10 am Post subject: |
|
|
| Quote: |
THE-FIXED-STRING BY PHONE-NUMBER(6) OF EXTRACT-RECORD
|
what are you trying to do with this clause? _________________ Dick Brenholtz
American living in Varel, Germany |
|
| Back to top |
|
 |
sankar narayanan Beginner
Joined: 16 Oct 2007 Posts: 29 Topics: 12
|
Posted: Wed Jun 18, 2008 5:38 am Post subject: |
|
|
the FIXED-STRING field is in the ZRCXML51 and im replacing it by PHONE-NUMBER(6) of the extract-record copybook. the phone number is like below in the copybook
15 TELEPHONE-NUMBER-DATA.
20 PHONE-NUMBER-DATA OCCURS 6 TIMES.
25 PHONE-TYPE-CODE PIC X.
25 PHONE-AVAILABILITY-CODE
PIC X.
25 PHONE-NUMBER.
30 PHONE-AREA-CODE PIC X(3).
30 PHONE-PREFIX PIC X(3).
30 PHONE-SUFFIX PIC X(4).
30 PHONE-EXTENSION PIC X(7) |
|
| Back to top |
|
 |
CraigG Intermediate
Joined: 02 May 2007 Posts: 202 Topics: 0 Location: Viginia, USA
|
Posted: Wed Jun 18, 2008 7:20 am Post subject: |
|
|
| I think you have a misunderstanding of copy replacing, this is just a compile time change of field names it doesn't have anything to do with the data. |
|
| Back to top |
|
 |
sankar narayanan Beginner
Joined: 16 Oct 2007 Posts: 29 Topics: 12
|
Posted: Wed Jun 18, 2008 7:45 am Post subject: |
|
|
| yes i too agree on that but then why im getting an error when the statement is correct. please help me on this. |
|
| Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Jun 18, 2008 7:48 am Post subject: |
|
|
The statement is NOT correct - you have phone-numbers(6) followed by OF. OF is not part of the syntax of the COPY directive. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
| Back to top |
|
 |
sankar narayanan Beginner
Joined: 16 Oct 2007 Posts: 29 Topics: 12
|
Posted: Wed Jun 18, 2008 8:08 am Post subject: |
|
|
Agreed Nic but what happens here is that there is also an existing code present as below and it is working fine without getting caught while compiling
COPY ZRCXML56 REPLACING
THE-FIELD-TAG BY CUST-DOB-DATE-TAG
THE-INTEGER-VALUE BY CUST-DOB-DATE OF EXTRACT-RECORD. |
|
| Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Jun 18, 2008 8:12 am Post subject: |
|
|
It is probably the (6) that is putting it off - I do not know if you can supply table dimensions in a REPLACING clause. Try just the PHONE-NUMBER. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
| Back to top |
|
 |
|
|
|