1,955 pts.
 CPYFRMIMPF command Query
I am trying to import a CSV data into a physical file. There is a column for date in the CSV file of length 8 and Type numeric. It has value 11012013. File1 has the date field declared as (8,0). After the import, the date appears as 11,012,013. I don't want these commas. Why it is happening like this? My command is like this CPYFRMIMPF FROMSTMF(&FROMPATH) TOFILE(QTEMP/File1) + MBROPT(*REPLACE) RCDDLM(*LF) STRDLM('"') + STRESCCHR(*NONE) FROMRCD(2) + RPLNULLVAL(*FLDDFT)

Software/Hardware used:
ASKED: January 8, 2013  6:03 AM
UPDATED: January 8, 2013  12:44 PM

Answer Wiki:
Last Wiki Answer Submitted:  Be the first to answer this question.
All Answer Wiki Contributors:  Be the first to answer this question. Michael Tidmarsh   11,400 pts. , RamvishakRamesh   1,955 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

There is a column for date in the CSV file of length 8 and Type numeric.
 
Is it clear to you that even though the column is for date, it is not a “DATE”?
 
After the import, the date appears as 11,012,013. I dont want these commas. Why it is happening like this?
 
It happens like that because it is not a date. It’s just a numeric value; and numeric values are commonly presented with separators. The separators are inserted by whatever you’re using to view the value. The commas are not stored in the value. They only show up because your display file or your report format or whatever you’re using is inserting the commas.
 
If you would use an actual DATE field to store dates instead of trying to use a numeric column, the problem wouldn’t appear. But you might not have a choice in that.
 
If you don’t want commas, use a different edit code to present the value. I can’t tell you how, because you haven’t said what you are using to view the value.
 
Tom

 108,135 pts.

 

Are you using RUNQRY to view the incoming data?  It often displays numeric data with extraneous commas – it’s just default formatting.As Tom noted, the (8,0) numeric field is not a DATE field so don’t expect to see the contents laid out as if it was.

 5,670 pts.