BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jen123
Fluorite | Level 6

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;

1 ACCEPTED SOLUTION

Accepted Solutions
robby_beum
Quartz | Level 8

I'm thinking you might have some missing or partial dates in the "decisions_jul_aug" table.

View solution in original post

2 REPLIES 2
robby_beum
Quartz | Level 8

I'm thinking you might have some missing or partial dates in the "decisions_jul_aug" table.

jen123
Fluorite | Level 6

Thanks Robby - I checked my data and that is the case.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 5623 views
  • 0 likes
  • 2 in conversation