View previous topic :: View next topic
|
Author |
Message |
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Hi,
I have to merge two files having the first twenty bytes of data same.
My requirement is to select the first 40 bytes of data from first file and merge it with the second file. I used the below sort card.
Code: |
JOINKEYS FILE=F1,FIELDS=(1,20,A)
JOINKEYS FILE=F2,FIELDS=(1,20,A)
JOIN PAIRED,F2
REFORMAT FIELDS=(F1:1,40,F2:41,2108)
SORT FIELDS=COPY
OUTREC FIELDS=(1,40,41,2108) |
But when i run with this sort card am getting JOIN syntax error. But i am unable to find what is the error. Can you please help me with what is wrong with the above sort card? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
it would help to provide us with the error (cut & paste) from the sysout.
and why are you using an OUTREC FIELDS parm?
that is what hte REFORMAT parm accomplishes. |
|
Back to top |
|
|
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
I removed the OUTREC statement after realising it. But am getting error at JOIN statement with error code WER268A. Am sorry i will not able to give the mainframe screen shot as am unable to access it. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What column are your control cards starting in. If column 1, try 2 or later. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Also post which product and release level you have installed |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
I usually use FILES in JOINKEYs syntax not FILE; I can't test this, at this moment, however, with the given info, please give a try to this:
Quote: |
JOINKEYS FILES=F1,FIELDS=(1,20,A)
JOINKEYS FILES=F2,FIELDS=(1,20,A) |
|
|
Back to top |
|
|
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Thanks to all... After removing the JOIN PAIRED, F2 statement my sort card worked fine. However my requirement is to join only paired records. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
However my requirement is to join only paired records |
Yes. You got it right. AFAIK "JOIN,PAIRED" does not exist. If you need only paired records, you just need to omit the JOIN statement itself. |
|
Back to top |
|
|
prasanth_thavva
New User
Joined: 28 Jul 2005 Posts: 86 Location: Chennai
|
|
|
|
Mushreys,
Yes arun is correct, the default is JOIN PAIRED you need not declare/code this. PAIRED means matching records will be pulled based on KEYS. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
the default is JOIN PAIRED you need not declare/code this |
Prasanth,
The "JOIN PAIRED" does not even exist. It is not like it is the default and you need not code it.
If you code it, you will end up in a syntax error. As I said earlier, if you need only matching records,
you just need to omit the JOIN statement. |
|
Back to top |
|
|
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Hey Thanks Arun and Prasanth for your help... |
|
Back to top |
|
|
|