Page 1 of 1
Compare two account numbers
Posted:
Wed Aug 12, 2009 10:26 pm
by Naveen@Uppi
Hi All,
Is it possible to compare account number in two files and if the account number in the two files are equal, move the account number and few fields of file1 to the output file.
File1 : Record format FB and record lenght 400 Account number start: 43 lenght 20 alpha numeric. the account number is only 10 digit with initial spaces ex SSSSSSSSSSSZ121236547, S is spaces and Z- zero
File 2: Record format FB and record lenght 28656 Account number start: 13 lenght 10 numeric, The account number is 9 digit for ex S123456789 where S is space
Please suggest if this is possible through the Sort utility.
Thanks and regards,
Naveen N
Re: Compare two account numbers
Posted:
Wed Aug 12, 2009 10:48 pm
by Frank Yaeger
Yes, it is possible. Take a look at the methods described in the "Create files with matching and non-matching records" Smart DFSORT Trick at:
http://www.ibm.com/support/docview.wss? ... g3T7000094 If you need more specific help, please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Re: Compare two account numbers
Posted:
Fri Aug 14, 2009 10:57 am
by Naveen@Uppi
Thanks Frank.
I was able to code JCl and JCl ran file.
Thanks and Regards,
Naveen N
Re: Compare two account numbers
Posted:
Fri Sep 11, 2009 3:18 pm
by MARTIN
Hi Naveen,
Could you please post your code.
I too have a similar requirement.
I need to compare two files to create an output file with mismatching fields.
Assume Emp No is the key field.
Output file should contain the key field and mismatching fields.
File1
Emp No Name IBU Proj Code
45832 Yogananda IHLD CISEDS
65123 Rajesh BCMD BOFA
116216 Rohan EUSD BCHN
File2
Emp No Name IBU Proj Code
45832 Yogananda IHLD CISEDS
65123 Rajesh BCMD BOFA
116216 Rohan EUSD SDFV
Output
116216 BCHN SDFV.
This is just a sample.
I will be given with 2 input files and their copybook layout.
The files can be FB or VB.
If it is FB i need to convert it to vb.
For LRECL max. record length should be assumed.
Assume key position is at starting.
It has to just pick up the non-matching fields and display it.
I wouldnt be knowing the positions of the non-matching fields.
Could you please help me on the same.
Thanks,
Marina.
Re: Compare two account numbers
Posted:
Sat Sep 12, 2009 12:26 am
by dick scherrer
Hello,
Do not post the same topic in multiple forums. . .
Thank you.