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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.