I greatly appreciate any and all patience. I am not sure I will be able to formulate my exact question the first time, but I will try.
I am trying to import a .csv file from another department's automated process (they have an automated extract that outputs the data to a .csv format).
Visually looking at the "DATE" field when opening the .csv file displays "01-SEP" (as an example), but clicking on an individual cell, I can see that the value for this particular cell is actually "2023-09-01". When trying to import via data step, I get only the displayed value of "01-SEP". I would like the year as well.
Here is what I tried:
DATA WORK.import_file;
INFILE "Import_Path\Import_file.csv" DELIMITER = ',' MISSOVER DSD LRECL=32767 FIRSTOBS=2;
LENGTH ASSIGNMENT_ID 8.;
INFORMAT ASSIGNMENT_ID 15.;
FORMAT ASSIGNMENT_ID 15.;
LENGTH DATE 8.;
INFORMAT DATE YYMMDD10.;
FORMAT DATE YYMMDD10.;
INPUT ASSIGNMENT_ID:15. DATE:ANYDTDTE.;
RUN;
However, the year part of the date does not import correctly.
For instance, the "2023-09-01" csv cell imports as "2001-09-01". Here the year is incorrect.
And the "2023-08-31" csv cell imports as "2031-08-01". Here the year and day are incorrect.
In general, I like the "2023-08-31" format, but obviously need the date to be correct.
Thank you in advance for any and all advice.
... View more