Q
Manage Learn to apply best practices and optimize your operations.

Converting and dumping data

I have to convert some data and dump to a flat file so it can be read in to another system. All is well except for the date. It is being held in the file as 19,980,302. I need to convert to a normal date structure to mmddyyyy. Is this possible within query?
In 'Define Result Fields', use the following to create a field (DATE1 here) that you will later select in 'Select and Sequence Fields'. The field here containing yyyymmdd is called DCUPDT:

 
Field       Expression                       
DATE1       substr(digits(dcupdt),5,2) ||     
            substr(digits(dcupdt),7,2) ||     
            substr(digits(dcupdt),1,4)       

Note that DATE1 is a CHARACTER field, and will be defined as 8A in the output file.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

Dig Deeper on Data backup, storage and retrieval on iSeries

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close