I m new to SAS. I am using SAS University Studio. I want to use INTCK and INTNX unction for given Dataset.
I have imported following data-set datetime in MYLIB library.
proc import datafile ="/folders/myfolders/testdata/datetime.xlsx"
out=mylib.datetime dbms=xlsx replace;
getnames=yes;
run;
There is dataset on which i want to perform INTCK function.
Thank you.
You have not supplied any information for us to be able to help you. Post your test data in the form of a datastep using the code window [ its the {i} above post are and following this post if needed:
Then show from this test data what you want to see out, and what the logic is. Just saying I want to use XYZ function doesn't tell us anything, how do you want to use it, to get what?
Also note posting pictures of data does not help, we need to see the structure of the data to determine things, is that actually a SAS numeric datetime variable for instance? Intck/nx need nuermic SAS datetime variables to work with.
Basically you now need to use a data step program such as:
data want;
set have;
newvar = intck('interval',variable1,variable2); /* since you only have 1 datetime variable this is likely not what you want*/
othernewvar = intnx('interval', variable, incrementnumber);
run;
You can look up the syntax for INTX see what values are valid for interval. There are many options so do not expect a complete listing here. If you have a datetime variable and want to increment by day, week, month preface the interval with DT such as 'dtday' 'dtmonth'
More specific questions will yield better targeted responses.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.