Well, I'm not a COBOL programmer -- this century, anyway -- but logic is logic, and there are a myriad of (OK, several
) people on this board who can help with COBOL-specific details.
The table, I presume, is DB2. It should have on it a column identifying the data date -- depending on the processing done elsewhere, it might be an "add date" or "last updated date". There may also be a "logical delete" indicator -- perhaps a simple flag, perhaps a timestamp -- indicating the row is to be ignored in normal processing.
The data date column should ideally have a data type of TIMESTAMP or DATE -- but since DBAs and analysts are not always ideally competent, it may have a type of CHAR(n), INTEGER, or even, Kamisama forbid, DECIMAL(p,q). What do your specifications and/or research show the data type to be?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day