BookmarkSubscribeRSS Feed
nikhilbajaj
Calcite | Level 5

Hi all,

I am getting a weired output while using the 'except all' command. I have (A join B) as source and C as target.

(A join B) has same number of records as in C

if I do a 'except all' between C and (A join B) I get no records

but when I do 'except all' between (A join B) and C I get 37 records. And these records are actually not seen in (A join B).

Can anybody take me out of this problem?

5 REPLIES 5
ballardw
Super User

Might help to actually post the code involved.

nikhilbajaj
Calcite | Level 5

here is the code-

 

rsubmit;
proc sql;
create table TEST_RESULT as
select B.OFFRG_N,
B.OFFRG_TS,
A.AG_PER_POL_L
from MPTST031_UWS_POL A, CSTST061_UWS_CB_CV B
where A.POL_N = B.POL_N

except

select OFFRG_N,
OFFRG_TM_CRT_TS,
AG_PER_POL_L
from CCTRP121_CSIX;
select count(*) from TEST_RESULT;
quit;

nikhilbajaj
Calcite | Level 5

hey guys, today I am not getting that unexpected output. I have no idea why this happened. But anyways thanks and sorry if you put your time on this.

Howles
Quartz | Level 8

Don't know what was expected, but the EXCEPT operator is not commutative.

Ksharp
Super User

Maybe you should uniform these variables name .   These two set of variables should be the same name .

Just Guest.

Xia Keshan

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
  • 5 replies
  • 948 views
  • 0 likes
  • 4 in conversation