|
View previous topic :: View next topic
|
| Author |
Message |
a69356
New User
Joined: 01 Dec 2006 Posts: 21 Location: Gurgaon
|
|
|
|
Hi All,
There are two files let say A and B.
File A
field 1 Field 2
12345 XYZ
FILE B
field 1 Field 2
12345 ABC
I need to get an output file which have matching Field 1 and then need to add a character field X(02) whose constant value is CD.
I am doing it through Joinkeys which will match the records and put them in the third file.
| Code: |
JOINKEYS FILE=F1,FIELDS=(1,5,A)
JOINKEYS FILE=F2,FIELDS=(1,5,A)
REFORMAT FIELDS=(F1:1,5,6:2C'CD')
SORT FIELDS=COPY |
But I am getting an error message
| Code: |
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1
JOINKEYS FILE=F1,FIELDS=(1,5,A)
JOINKEYS FILE=F2,FIELDS=(1,5,A)
REFORMAT FIELDS=(F1:1,5,6:2C'CD')
$
ICE007A 1 SYNTAX ERROR
SORT FIELDS=COPY
ICE751I 0 C5-K51706 C6-K51706 C7-K54602 C8-K51706 E7-K51706
ICE052I 3 END OF DFSORT |
I am not able to figure it out. Any help will be highly appreciated.
Thanks, |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you post a few more sample input records and the output youwant from those input records using the Code Tag.
Show what should happen when there is a match, when there is not a match, and when (if possible) duplicates.
Mention the dsorg and lrecl of the files. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
a69356,
You cannot use 6:2C'CD' in the REFORMAT statement. The syntax for REFORMAT is F1:p,m to include fields from file F1 and/or F2:p,m to include fields from F2. However, once you've used REFORMAT to create the joined record, you can use INREC, OUTREC or OUTFIL to further format it, e.g.
| Code: |
...
REFORMAT FIELDS=(F1:1,5)
OUTREC BUILD=(1,5,6:2C'CD')
|
For complete details on the syntax for JOINKEYS, JOIN and REFORMAT, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174 |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|