I'm working on a project where I have an external file with dates in a numeric format (like: 20,210,807) rather than in date format. I need to get them into a report formatted in MM/DD/YYYY. I have a data structure started but I'm at a stalemate on what I need to do next. I know I need to bring the ODATE field into my date structure but I'm having a mental roadblock on how to accomplish that. I am using Free Format instead of Fixed. The code is below.
Dcl-ds PrintLine ExtName('CSORDPL3':*all); // Declared data structure using logical file
DORDNBR ExtFld('ORDNBR'); // Order number from logical file
DCUSTNO ExtFld('CUSTNO'); // Customer number from logical file
DCFNAME ExtFld('CFNAME'); // First name from logical file
DCLNAME ExtFld('CLNAME'); // Last name from logical file
DCPHONE ExtFld('CPHONE'); // Phone number from logical file
DORDTOT ExtFld('ORDTOT'); // Order total from logical file
DODATE ExtFld('ODATE'); // Order date from logical file
End-Ds;
Dcl-ds Datefield; // Data structure for Date field to reformat numerical
MM Zoned(2:0);
DD Zoned(2:0);
YY Zoned(4:0);
END-DS;
'''