Hello;
I am trying to export data/report from sas to redcap and I am getting this error below. I tried to change my date to yymmdd10. but, Am still having a problem on understanding what the issues is.
proc print data=stemp Noobs;
format start yymmdd10.;
run;
"error":"\"2-2c\",\"start\",\"11\/01\/2010 \",\"Invalid date format. (NOTE: Dates must be imported here only in Y-M-D H:M[:S] format, regardless of the specific date format designated for this field.) \"\n\"2-2j\",\"start\",\"10\/01\/2010 \",\"Invalid date format. (NOTE: Dates must be imported here only in Y-M-D H:M[:S] format, regardless of the specific date format designated for this field.)
I don't know if a format exits that appends fake-time information to a date. Most likely you will have to convert the date into a sas datetime before exporting it. You could use the function dhms.
That does not look like an error from SAS. Not sure what REDCAP is but the error seems to be saying that you need to give it datetime strings in YMD HMS order, even if your values do not have any time component. People normally just use zeros for the time of day parts in that case.
You are just showing a PROC PRINT statement. That will just write the data to a text file (or if you are using ODS some other file type like EXCEL, RTF, etc). What format does Redcap want the data?
SAS stores dates as the number of days since 1960 and datetime values as the number of seconds since 1960. Your SAS code is assuming you have SAS date values so that the YYMMDD format can by used with it. If your actual SAS variable has datetime values then you will not want to use the YYMMDD format as they value will be way too large. There are 24*60*60 seconds in a day.
what is the Language Element for YMD HMS order
I don't know if a format exits that appends fake-time information to a date. Most likely you will have to convert the date into a sas datetime before exporting it. You could use the function dhms.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.