Search code examples
cobolgnucobol

How to Select and display latest date (openCobol)


Im new to Cobol.

A column of Date need to identify the latest date to be display.

8/9/2004

2/7/2016

24/04/1995

27/09/2016

And it able to identify 27/09/2016 as the latest date


Solution

  • I found my Answer at last.

    • Compare date: if Billdate (latest date), move to report date

         IF WSAA-BillDate > WSAA-ReportDate
             MOVE WSAA-BillDate to WSAA-ReportDate
         END-IF