Desktop productivity for business analysts and programmers

Datapart and Timepart

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 94
Accepted Solution

Datapart and Timepart

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;


Accepted Solutions
Solution
‎08-31-2012 03:35 PM
Contributor
Posts: 70

Re: Datapart and Timepart

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

View solution in original post


All Replies
Solution
‎08-31-2012 03:35 PM
Contributor
Posts: 70

Re: Datapart and Timepart

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

Frequent Contributor
Posts: 94

Re: Datapart and Timepart

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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