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

If the difference between b.HRA_Unreachable_Date AND TODAY is < 15 then i want to categorize it as "1-15".

But the statemenet i wrote does not work.

b.HRA_Unreachable_Date  is numeric (Date integer from Jan 1, 1960).

Error:

ERROR: Function INTCK requires a numeric expression as argument 2.

ERROR: Function INTCK requires a numeric expression as argument 3.

ERROR: The following columns were not found in the contributing tables: null

 

 

proc sql;

create table timeframes as

select distinct a.medicaid_id

, b.min_transfer_Dt

, b.HRA_Unreachable_Date

 , case when intck('day', "b.HRA_Unreachable_Date", "today()") < "15" then "1-15"

else null end as timeframe

 

from HSD.tbl_unreachables as b inner join HSD.Final_attempts as a on b.medicaid_id= a.medicaid_id

;

quit;
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

First try this
intck('day', b.HRA_Unreachable_Date, today()) < 15

 

You were not comparing the varible but the text of the name b.HRA etc, also the result of INTNX is numeric so do not compare to a text value "15".

 

If you still get messages about incompatible types it may mean that your HRA_Unreachable_date variable is not a SAS numeric date value but is character. You should go back further in your process and insure the date variable is a SAS date valued numeric.

View solution in original post

2 REPLIES 2
ballardw
Super User

First try this
intck('day', b.HRA_Unreachable_Date, today()) < 15

 

You were not comparing the varible but the text of the name b.HRA etc, also the result of INTNX is numeric so do not compare to a text value "15".

 

If you still get messages about incompatible types it may mean that your HRA_Unreachable_date variable is not a SAS numeric date value but is character. You should go back further in your process and insure the date variable is a SAS date valued numeric.

ashwini2
Fluorite | Level 6

That worked! 🙂

Thanks so much for the quick reply.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1920 views
  • 1 like
  • 2 in conversation