BookmarkSubscribeRSS Feed
David_Billa
Rhodochrosite | Level 12

Could you please help me understand the meaning of the expression below?

 

REPORTING_DATE <= CASHFLOW_DT  >= ACCOUNT_DT
3 REPLIES 3
ChrisNZ
Tourmaline | Level 20

It's the same as

REPORTING_DATE <= CASHFLOW_DT and CASHFLOW_DT >= ACCOUNT_DT

 

Tom
Super User Tom
Super User

@David_Billa wrote:

Could you please help me understand the meaning of the expression below?

 

REPORTING_DATE <= CASHFLOW_DT  >= ACCOUNT_DT

Use it in a WHERE clause and SAS will show you in the LOG how it is interpreted.

1906  data test2;
1907    set test;
1908    where REPORTING_DATE <= CASHFLOW_DT  >= ACCOUNT_DT ;
1909  run;

NOTE: There were 1 observations read from the data set WORK.TEST.
      WHERE (REPORTING_DATE<=CASHFLOW_DT) and (CASHFLOW_DT>=ACCOUNT_DT);

It is a little unusual to see this construct used when the inequalities point in different directions.  Another way to get the same would be something like:

max(REPORTING_DATE,ACCOUNT_DT) <= CASHFLOW_DT 

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!

How to Concatenate Values

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.

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
  • 3 replies
  • 332 views
  • 3 likes
  • 4 in conversation