Hi Everyone,
The below table is my portion of data set, What i want to do is to translate these sql codes to sas but it is quite diffcult to me.
can anyone help me with this. thanks a lot!!! My Data is char form
Julianday(SUBSTR(PTF.Premium_To_Date,1,4) || '-' || SUBSTR(PTF.Premium_To_Date,5,2) || '-01') - Julianday(SUBSTR(PTF.Premium_From_Date,1,4) || '-' || SUBSTR(PTF.Premium_From_Date,5,2) || '-01') > 180
Premium Premium
FromDate ToDate
20130101 | 20130131 |
20130101 | 20130131 |
20130101 | 20130131 |
20130101 | 20130131 |
20130101 | 20130131 |
20130101 | 20130131 |
20130101 | 20130131 |
20130101 | 20130131 |
20130101 | 20130131 |
Could you try below code, if you consider you have a dataset as have and you want to generate dataset want
data want;
set have;
Julianday(SUBSTR(Premium_To_Date,1,4) || '-' || SUBSTR(Premium_To_Date,5,2) || '-01') - Julianday(SUBSTR(Premium_From_Date,1,4) || '-' || SUBSTR(Premium_From_Date,5,2) || '-01') > 180;
run;
i am using studio version and there is no JULIANDAY Function, thx
Please post data in a usable form and show what you expect as result.
Steps to solve the problem
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.