- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
This code has worked for me in the past, but not today. Can you please help suggesting what I'm doing wrong? The output dataset is blank because intck function isn't working properly.
My code:
data wow;
set check;
if intck('day',letter_date,today())>50 then output; //here letter_date is a column in check- it's a yyyymmdd date with a format of num8.
run;
Logs:
NOTE: Invalid argument to function INTCK('day',20150727,21746) at line 730 column 6.
Appreciate the help!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Looks like you have to convert letter date to an actual date value first like this
data wow;
set check;
if intck('day',input(put(letter_date, 8. -l), yymmdd8.),today())>50 then output;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@AJ_Brien wrote:
Hello,
This code has worked for me in the past, but not today. Can you please help suggesting what I'm doing wrong? The output dataset is blank because intck function isn't working properly.
My code:
data wow; set check; if intck('day',letter_date,today())>50 then output; //here letter_date is a column in check- it's a yyyymmdd date with a format of num8. run;
Logs:
NOTE: Invalid argument to function INTCK('day',20150727,21746) at line 730 column 6.
Appreciate the help!
It would help if you show us the actual LOG file rather than the code (all of it, not just the error message). And then there will be no inconsistencies between the code in the log and the code you present, as I suspect here.
I am guessing, but it seems as if your variable letter_date is not an actual SAS date value, it is some integer that looks like a date to humans but does not look like a date to SAS. So, INTCK works only with SAS date values, such as '01JUN2019'd, or integers representing days from Jan 1, 1960.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
A numeric value of 6,588,970 is 31 Dec 19,999. So 20,150,727 would be about year 60,000.
SAS date values only go to 31 Dec 20000 generally.
If this code worked previously then the values were different in range. 27Jul2015 would have a numeric non-date formatted value of 20296.
https://communities.sas.com/t5/SAS-Communities-Library/Working-with-Dates-and-Times-in-SAS-Tutorial/... has a PDF with much information about dates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Looks like you have to convert letter date to an actual date value first like this
data wow;
set check;
if intck('day',input(put(letter_date, 8. -l), yymmdd8.),today())>50 then output;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content