SQL Debug: Is it doing the right thing?

Discussion in 'SAS (Statistical Analysis Software)' started by Tony Wang, Oct 8, 2004.

  1. Tony Wang

    Tony Wang Guest

    Hi all,

    I have the following codes

    proc sql;
    create table allclm as
    select a.mbrid,b.prvid,b.mksplty,a.numer,a.indicato from denom a , ws.pairs b
    where a.mbrid=b.mbrid and a.member_dob+365<=b.date_of_service<a.member_dob+365*2
    and compress(b.prvid) ne '0099999999' ;
    quit;


    My question is, a.member_dob+365<=b.date_of_service<a.member_dob+365*2
    is comparing variables across tables after finding the records with the same mbrid?

    Should I join them first then do the comparison?

    proc sql;
    create table allclm as
    select a.mbrid,b.prvid,b.mksplty,a.numer,a.indicato from denom a , ws.pairs b
    where a.mbrid=b.mbrid and compress(b.prvid) ne '0099999999' ;
    quit;

    data allclm;
    set allclm;
    if member_dob+365<=date_of_service<member_dob+365*2;
    run;

    Can someone explain the actual process of SQL joins?

    Thanks for your help,

    Tony
     
    Tony Wang, Oct 8, 2004
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.