I have a cobol program that takes in a huge file (with records in the order of millions) and it splits it into multiple files. It also adds header and trailer while doing the same. But this process is time consuming. In order to reduce the time I feel that we can achieve the same using DFSORT. Following is the requirement for the same:
1) Split the file ->I guess we can use STARTREC/ENDREC since this split factor is always consistent
2) Count -> We can achieve using COUNT function in the TRAILER
3) Hash total -> The hash total of a particular numeric field should be printed. We can achieve this using SUM
4) Date -> The current date should be printed.
I am not sure as to how we can get all these together
If the split factor is 2 then the output should be
Thanks a lot Skolusu, I changed the datatype of the field that we are trying to do a sum to PD instead of ZD and gave the length as 150,5 instead of 150,9. The job went fine.
Thanks once again for your timely help.
I just have one question
Will the count field and SUM field always start and end @ a particular column or will it vary. Example Will it always start @ 10th position and have a fixed length?
If not can we make it like that so that I can refer to the trailer with a copybook.
Thanks for your prompt reply. yes I hadnt mentioned about the COMP-3 field. I went through the positions and modified it accordingly to suit the copybook that i have. Also i changed the mask not to supress the leading zeros.