Help using Base SAS procedures

weired output with except all command

Reply
Occasional Contributor
Posts: 13

weired output with except all command

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?

Super User
Posts: 11,343

Re: weired output with except all command

Posted in reply to nikhilbajaj

Might help to actually post the code involved.

Occasional Contributor
Posts: 13

Re: weired output with except all command

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;

Occasional Contributor
Posts: 13

Re: weired output with except all command

Posted in reply to nikhilbajaj

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.

Regular Contributor
Posts: 184

Re: weired output with except all command

Posted in reply to nikhilbajaj

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

Super User
Posts: 10,046

Re: weired output with except all command

Posted in reply to nikhilbajaj

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

Just Guest.

Xia Keshan

Ask a Question
Discussion stats
  • 5 replies
  • 228 views
  • 0 likes
  • 4 in conversation