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

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!

1 ACCEPTED SOLUTION

Accepted Solutions
DBailey
Lapis Lazuli | Level 10

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

2 REPLIES 2
LinusH
Tourmaline | Level 20

Pls take a look at the INTNX function.

Data never sleeps
DBailey
Lapis Lazuli | Level 10

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;

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 770 views
  • 3 likes
  • 3 in conversation