Assume there is a table having customer data which includes CUST_NUMBER,NUMBER_OF_BULBS(Millions of records).
Now to calculate the fee for each customer based on number of bulbs,I have two options in my mind
1. To take the unload of data to a file then by using COBOL file handing methods, read the file and Calculate the fee for each customer
2. In COBOL by using SQL query calculate the fee for each customer
Out of two given options which one is better and why?