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: 8797
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: 19244
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: 19244
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
Search our Forums:

Back to Top