DFSORT FINDREP



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

DFSORT FINDREP

Postby johnwp53 » Wed Nov 02, 2011 12:03 am

Hi,
I'm executing the following to change loan numbers within a record.
A loan number can occur multiple times within a record and can be unsigned comp-3 and/or character.
The input file is VB 8192 and contains thousands of different record types.
The positions of the loan number/s within the records depends on the record type.
The FINDREP option below is simple and works OK but takes a long time to execute.
A couple of questions:
If the size of a record is say only 200 bytes, does the FINDREP stop at 200 bytes or continue to byte 8192?
Does each record get processed multiple times? i.e., in my case 4000 times.

OPTION COPY
INREC FINDREP=(INOUT=(C'0000000969907',C'0004000017999',
X'0000000969907F',X'0004000017999F',
C'0000000973130',C'0004000018007',
X'0000000973130F',X'0004000018007F',
C'0000000986943',C'0004000018018',
X'0000000986943F',X'0004000018018F',
...
... Repeated for a total of two thousand loan numbers
...
C'0000020840138',C'0004000044743',
X'0000020840138F',X'0004000044743F',
C'0000020842571',C'0004000044765',
X'0000020842571F',X'0004000044765F',
C'0000020850731',C'0004000044776',
X'0000020850731F',X'0004000044776F'))
johnwp53
 
Posts: 4
Joined: Tue Nov 01, 2011 11:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT FINDREP

 

Re: DFSORT FINDREP

Postby Frank Yaeger » Wed Nov 02, 2011 1:38 am

The input file is VB 8192 and contains thousands of different record types.

If the size of a record is say only 200 bytes, does the FINDREP stop at 200 bytes or continue to byte 8192?


It stops at the end of the record. It uses the RDW length to determine the length of the record.

Does each record get processed multiple times? i.e., in my case 4000 times.


Each record is only processed once but that processing consists of looking for each of your 4000 values at each position in your record.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: DFSORT FINDREP

Postby johnwp53 » Wed Nov 02, 2011 2:37 am

Thanks for the quick reply Frank.
One more question:
If a match is found and replaced say with the 100th value are the remaining 3900 values skipped and processing within the record continued following the byte after the replaced value?
johnwp53
 
Posts: 4
Joined: Tue Nov 01, 2011 11:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT FINDREP

Postby BillyBoyo » Wed Nov 02, 2011 4:53 am

Do the records you are updating have at least one loan number in a fixed position? This would allow you to use your loan numbers as a "key" into the file and only do your FINDREP for those which exist within the FINDREP condition.

Maybe (you'd have to check on the limits) you could generate a whole bunch of ifs and only do do specific findreps if the condition is met.

If you are sorting the file anyway, you could also consider a Cobol "exit" and do it there, using SEARCH ALL against a table you loaded, and then a move to however many fields you need to.

I have no idea how many records you have on your file. Say you have 100,000. You are doing 4,000 * 200 (approximately, I assume the find stops when current position plus length "overlaps" the record), or about 800,000 tests per record, in my pretend example that would be 80,000,000,000 tests on the file. Even for "stopping early" when a hit is found, that would not save much.

You also have to be a little careful about changing something which isn't a loan number (say an amount).

However you do it, you should produce some "audit trail", ie before/after of records which change. The number of records changed, for instance, you should be able to predict - and reconcile any differences in counts (typos? loans redeemed/cancelled/whatever since list appeared).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: DFSORT FINDREP

Postby Frank Yaeger » Wed Nov 02, 2011 4:55 am

If a match is found and replaced say with the 100th value are the remaining 3900 values skipped and processing within the record continued following the byte after the replaced value?


Yes.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post