I recently created a .csv with dates. Here is an example of the command.
CPYTOIMPF FROMFILE(MYLIB/DATEFILE) TOSTMF(‘//Apps/DateFile.csv’) MBROPT(*REPLACE) STMFCODPAG(*PCASCII) RCDDLM(*CRLF)
In NoteBook, the dates looked just fine (*ISO). When I opened it in Excel, they were converted to *USA format.
Also, if the file already exists, just use the code page of the existing file. The copy command will convert it for you.
CPYTOIMPF FROMFILE(MYLIB/MYFILE) TOSTMF(‘//Apps/MyFile.csv’) MBROPT(*REPLACE) STMFCODPAG(*STMF) RCDDLM(*CRLF)