Page 1 of 1

Compare total amount of records with a record in a file

PostPosted: Fri Aug 31, 2012 1:35 pm
by Puffe
Hi,

I've a FB file with lrecl=10 that contains four records.
02 AAAAAAA
01 BBBBBBB
03 0000004
02 CCCCCCC

Record with value '03' in position 1 says how many records there are in the file (the amount 4 you'll find position 4-10).
I want to compare the sum of total records in the file with the record '03's amount (position 4-10).
How do I accomplish this ?
If the result doesn't match I want to create a record in a new file.

Best regards,

Micke

Re: Compare total amount of records with a record in a file

PostPosted: Fri Aug 31, 2012 1:43 pm
by BillyBoyo
Can you please post the ICE201I message from a sort step so we can see your DFSORT level?

WHEN=GROUP you'll need. Maybe JOINKEYS. IFTRAIL perhaps. So we need to know the level of the product that you have.

Re: Compare total amount of records with a record in a file

PostPosted: Fri Aug 31, 2012 9:02 pm
by skolusu
Puffe,

It is not clear as to what you are trying to accomplish. Do you have multiple records with '03' in the first 2 bytes? I see that your input is not sorted on the first 2 bytes. Do you need to retain that order? or can the input be sorted so that the '03' records are at the bottom?

As bill mentioned can you show us the ICE201I message?

Re: Compare total amount of records with a record in a file

PostPosted: Mon Sep 03, 2012 11:02 am
by Puffe
Here it comes ICE201I H

I only have one '03' and the file is not sorted.
In the case above the result would be that total amount of records is the same as '03's amount but if it's not I'd like a record or why not both '03's in a file

Micke

Re: Compare total amount of records with a record in a file

PostPosted: Mon Sep 03, 2012 11:28 am
by BillyBoyo
Did you forget to past someting?