IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Input file keys are of different data type


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Sun Jul 12, 2009 8:16 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8798
Location: Welsh Wales

PostPosted: Sun Jul 12, 2009 11:34 pm
Reply with quote

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
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Mon Jul 13, 2009 12:54 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Jul 13, 2009 1:06 am
Reply with quote

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
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Mon Jul 13, 2009 1:10 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Jul 13, 2009 1:38 am
Reply with quote

Hello,

Quote:
Will it work
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
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts IGYPG3178-I when compiling a pgm read... COBOL Programming 6
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts DFSORT Join Keys Controlcard DFSORT/ICETOOL 4
Search our Forums:


Back to Top