07-10-2015 02:19 PM
After a proc import I would like to format the date to monname3. format, when I do this it either returns a blank or the correct date format and moves the data in the columns over to the right.
07-10-2015 03:29 PM
You have a datetime variable, so you need a datetime format. I'm not sure, but you can try dtmonname3. OR you cna create a new variable using the datepart function and apply the monname3 format to it.
format new_var monname3.;
07-10-2015 05:23 PM
You say informat instead of format this time, they are two different things. Can you clarify your issue some more? Ideally, a proc contents before, the code you tried and proc contents after.
07-10-2015 05:31 PM
Hi Reeza, my apologies for the confusion. I did a proc import and the back code generated an informat anydttm40. that I hoped to modify to the monname3. format. Whether I try to modify this in a subsequent data step or just redo the import as a data step/infile, I can't seem to get the date to read in the format I need. If it does, it pushes all the data in my columns one column to the right and sets several data values in the misaligned columns to missing.
07-10-2015 05:18 PM
One of my pet peeves is the tendency for many programs treat all dates as datetime variables. They are not the same. One of the reasons I don't use proc import in general is I can read files and specify an informat that only reads the date part of these erroneously constructed dates.