Below are two similar programs I have for my project. Even program gets the date (MM/DD/YYYY), time and sasdate from different import tables. Program 1 works with no issues. However, program 2, SAS EG gives me this message:
NOTE: Invalid (or missing) arguments to the DATEPART function have caused the function to return a missing value.
NOTE: Invalid (or missing) arguments to the TIMEPART function have caused the function to return a missing value.
NOTE: Invalid (or missing) arguments to the DATEPART function have caused the function to return a missing value.
Any advice?
*********************
1)
proc sql;
create table appl_import_sasdate as
SELECT APPLICATION_ID,
C_RPT_APP_IMP_DT,
/* import_dt */
(datepart(C_RPT_APP_IMP_DT)) FORMAT=MMDDYY10. LABEL="import_dt" AS import_dt,
/* import_time */
(timepart(C_RPT_APP_IMP_DT)) FORMAT=time8. LABEL="import_time" AS import_time,
APP_RCVD_DATE,
/* receive_dt */
(datepart(APP_RCVD_DATE)) FORMAT=MMDDYY10. LABEL="receive_dt" AS receive_dt,
/* import_sasdate */
(datepart(C_RPT_APP_IMP_DT)) LABEL="import_sasdate" AS import_sasdate ,
C_SYSTEM_DCSN_IND
FROM applications_jul_aug
;
QUIT;
********************
2).
proc sql;
create table appl_dcsn_sasdate as
SELECT APPLICATION_ID,
C_DECISION_NM,
DCSN_USER_NM,
DECDECISION,
DECTIME,
DECPOS,
C_RPT_DCSN_DT,
/* dcsn_dt */
(datepart(C_RPT_DCSN_DT)) FORMAT=MMDDYY10. LABEL="dcsn_dt" AS dcsn_dt,
/* dcsn_time */
(timepart(C_RPT_DCSN_DT)) FORMAT=time8. LABEL="dcsn_time" AS dcsn_time,
/* dcsn_sasdate */
(datepart(C_RPT_DCSN_DT)) LABEL="dcsn_sasdate" AS dcsn_sasdate,
DCSN_PREV_Q_NM,
DCSN_CURR_Q_NM,
DCSN_MAX_PRTY_RL_INFO
FROM decisions_jul_aug
;
QUIT;
I'm thinking you might have some missing or partial dates in the "decisions_jul_aug" table.
I'm thinking you might have some missing or partial dates in the "decisions_jul_aug" table.
Thanks Robby - I checked my data and that is the case.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.