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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1179 views
  • 0 likes
  • 4 in conversation