View previous topic :: View next topic
|
Author |
Message |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Hi,All
I want to perform matching on keys but the problem is keys in both the datasets are of different data type.
Input file 1
U1 2 1 P
Input file 2
U2 1 2 A
How to do conversion before matching? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
It would help if you gave some usefull information.
As this is posted in the CA products forum, are we to assume that your site uses CA-SORT.
What is the RECFM & LRECL of both files.
What are the key positions and lengths for both files.
What format are the keys to be compared.
What happens if (a) Keys match or (b) keys mismatch |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
RECFM is FB
LRECL of both the datasets are different Infile1 is 80 & other is 120
The position of key is different in both the files
Infile 1
U1 2 1 P
P1 3 10 A
Infile2
U2 1 2 A
P2 5 10 A
The key to be matched is U1+P1 from Infile1 & U2+P2 from Infile 2.
I wrote
JOB INPUT (INFILE1 KEY ( U1 P1) + INFILE2 KEY (U2 P2) )
Job errored on the above line giving the error message that both the keys are not of same format |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Appears to be an Easytrieve question. . .
Quote: |
giving the error message that both the keys are not of same format |
Yes, they are not the same.
You can either reformat the smaller volume file to use the attributes of the other or jou can replace the JOB INPUT specified with a JOB INPUT NULL and write your own matching code. |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Can u plz chk the below snippet. Will it work
JOB INPUT NULL
WS-U = U1
IF (( WS-U = U2 ) and ( P1 = P2 ))
PUT OUTFILE
END-IF
Thanks
Rahul Gupta |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Most likely not. . . At least not completely. . .
There is nowhere the data is "gotten" from the files. There is no compare to see if the files are "high", "low" or equal.
At the top of the cobol forum is a "Sticky" of working code to do what i believe you want to do. You would need to incorporate that logic into the Easytrieve code. |
|
Back to top |
|
|
|