Help using Base SAS procedures

End of Month Dates

Accepted Solution Solved
Reply
Contributor
Posts: 35
Accepted Solution

End of Month Dates

Hi Guys,

I have currently have 2 sets of data:

SET A has dates that are at the end of every month

SET B has dates that MAY NOT be at the end of every month

I am trying to use this code to isolate a new set of data:

PROC SQL NOPRINT;

CREATE TABLE ABSENT_IO_LIST

AS SELECT * FROM CRSPCOMMON_LIST

EXCEPT

SELECT * FROM PRESENT_IO_LIST;

However the differential dates are forbidding me to do so. It is crucial that I retain the dates in SET A for later purposes. So I was hoping that there is a code that automatically moves the dates in SET B to the end of the month, thereby allowing me to use my code above as well as to retain the dates in SET A. (Any other solutions would be greatly appreciated too!)

Thanks a lot guys! It is much appreciated!


Accepted Solutions
Solution
‎02-13-2013 09:54 AM
Super Contributor
Posts: 578

Re: End of Month Dates

proc sql;

create table want as

select

     t1.*

from

     crspcommon_list t1

     left outer join present_io_list t2

          on

               t1.dateval = intnx('month',t2.dateval,0,'end')

               /*and any other match keys*/

where

     t2.dateval is null;

quit;

View solution in original post


All Replies
Esteemed Advisor
Posts: 5,155

Re: End of Month Dates

Pls take a look at the INTNX function.

Data never sleeps
Solution
‎02-13-2013 09:54 AM
Super Contributor
Posts: 578

Re: End of Month Dates

proc sql;

create table want as

select

     t1.*

from

     crspcommon_list t1

     left outer join present_io_list t2

          on

               t1.dateval = intnx('month',t2.dateval,0,'end')

               /*and any other match keys*/

where

     t2.dateval is null;

quit;

☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 97 views
  • 3 likes
  • 3 in conversation