07-13-2016 09:29 AM
I have a dataset with a character date field (Source_Date Char(35)) with data in this format, "mmddyy" (no slashes) . I want to:
1. Add a new date field, "Source_Date_dte mmddyy8."
2. Update the new Source_Date_dte field with the date value from the Source_Date.
For Example: New field value
Here is my code attempt:
format Source_Date_dte mmddyy8.;
This code produces a new field Source_Date_dte Character 15 with format $MDDYY10 and no data populated in the new field.
07-13-2016 11:06 AM
Your statement would always create a numeric variable (even if you need to adjust it according to Reeza's suggestion, the same applies). If you are getting a character variable as the result, it is because SOURCE_DATE_DTE already exists (as a character variable) within the incoming data set ALL_MONTH_LOANS_DETAIL. It should be dropped from the input.