|
View previous topic :: View next topic
|
| Author |
Message |
Mounika Nemani
New User
Joined: 25 May 2018 Posts: 5 Location: India
|
|
|
|
Hi,
I am trying to compare two files using a key and write paired records into the output file.
I am getting difference in the output file count everytime I change the reformat clause.
I have a month and year in file 1 (ex: 201805) and some transactions done everyday with the timestamp in file 2. I am matching both the files to get all the transactions done on this month of the year. but I am getting different output counts with change in reformat clause.
case1:
Input:
file 1: 1 record
file 2: 500000 records
sortcard:
| Code: |
SORT FIELDS=COPY
JOINKEYS FILES=F1,
FIELDS=(1,6,A)
JOINKEYS FILES=F2,
FIELDS=(15,6,A)
REFORMAT FIELDS=(F2:1,125)
|
output: 408579 records.
case2:
input:
file 1: 1 record
file 2: 500000 records
sortcard:
| Code: |
SORT FIELDS=COPY
JOINKEYS FILES=F1,
FIELDS=(1,6,A)
JOINKEYS FILES=F2,
FIELDS=(15,6,A)
REFORMAT FIELDS=(F2:1,125,F2:1,14,F2:15,12,F2:40,3,F2:32,5,F2:49,3) |
output: 898946 records
It would be of great help if someone can explain why there is huge difference in the counts and how the reformat clause exactly works.
Thanks in Advance |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
Are you sure, you are running with the same inputs on both cases?
AFAIK REFORMAT should not change the output record counts. It would just select which fields to pass to the output from the JOINed record. Can you post the SYSOUTs from both the runs? |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2288 Location: USA
|
|
|
|
Before asking for help from the forum (and not giving detailed essential information!!!), try to do carefully the following steps.
Re-run your test with minimal size of the second file. Not 50,000 but 5-10 records. Print or view carefully ALL input files, and ALL output files, for BOTH of your cases.
If there is still difference in output count, then find out yourself: which records exactly are different, and what may cause that behavior?
* * *
The information you presented GIVES NO CHANCE FOR ANYONE TO BE ABLE TO HELP YOU doing YOUR OWN job instead of YOURSELF. In short terms your question looks like this:
| Quote: |
| I do everything right, but my result is wrong. Where is my error? |
Good luck. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|