For unique value of Field-1, if the value of field-2 = 2, count the unique values of field-3 and field-4 (ignoring 0).
111 2 1
222 3 2
My last call was to create a Cobol code with a logic that, with every read, fill an array for field-3 and field-4 with unique record and when field-1 changes, get the array size. But since my input file has millions of records, doing a search for each record doesn't seems to be a good idea. I just hope if there is something in JCL which could be more suitable.
Let me know if I had missed any important information. Your suggestion could be very helpful. Thanks.
Thank you so much for your valuable time. As suggested by you I would opt to use Cobol.
I would be using 2 arrays for storing unique values of field-3 and field-4 for every particular value of field-1. At every change in field-1, write the array count in output file and initialize the array. For this the code would need to search array for every record to check if it there in array or not and update array if it is new entry. Probably doing a search for millions of input record into array which could have length of around a million would take time. So was just looking for any better options. With your suggestion I am no more confused now. Thanks
The test JCL provided by you would be of great help. Thanks again.