Compare total amount of records with a record in a file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Compare total amount of records with a record in a file

Postby Puffe » Fri Aug 31, 2012 1:35 pm

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
Puffe
 
Posts: 21
Joined: Mon May 02, 2011 1:41 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Fri Aug 31, 2012 1:43 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby skolusu » Fri Aug 31, 2012 9:02 pm

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?
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

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

Postby Puffe » Mon Sep 03, 2012 11:02 am

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
Puffe
 
Posts: 21
Joined: Mon May 02, 2011 1:41 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Mon Sep 03, 2012 11:28 am

Did you forget to past someting?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post