×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problem with the IN statement in Proc SQL;

Problem with the IN statement in Proc SQL;

Problem with the IN statement in Proc SQL;

(OP)
Here is my dilemma,

When my WORK.bn2000 table hits the IN statement in verifies that a bus_reg_nb(PK) is not in the BN2001 table. The problem is that as soon as i reference a second
table(t2_income_stmt t2_is), it gives me a shared memery address error. I need to use the 2 tables in the query in order for it to function properly. The Error message I receive is as follows.

/*
   Error: Read Access Violation In Task [SQL]
   Exception occurred at [5EEF7EFF]
   Task Traceback
*/

PROC SQL;
CREATE TABLE WORK.bn2001 as
SELECT  t2_fd.bus_reg_nbr,t2_fd.ref_yr_cd,t2_fd.fpe_dt,t2_fd.fps_dt
FROM tms.t2_financial_declaration t2_fd, tms.t2_income_stmt t2_is
WHERE  t2_fd.ref_yr_cd = '2001' AND
       T2_FD.REF_YR_CD = t2_is.REF_YR_CD AND
       T2_FD.BUS_REG_NBR = t2_is.BUS_REG_NBR AND
       T2_FD.BN_ACCT_SQNBR = t2_is.BN_ACCT_SQNBR AND
       T2_FD.FPE_DT = t2_is.FPE_DT AND
       T2_FD.FPS_DT = t2_is.FPS_DT AND
     
     (t2_fd.fpe_dt - t2_fd.fps_dt) >= 30 AND
     (t2_fd.dnr_find_mdul_nbr = '0' or
     t2_fd.dnr_find_mdul_nbr = '1' or
     t2_fd.dnr_find_mdul_nbr is null)
ORDER by T2_FD.fpe_dt desc
;
QUIT;

PROC SORT data=WORK.bn2001 nodupkey;
by bus_reg_nbr ref_yr_cd;
QUIT;


PROC SQL;
CREATE TABLE WORK.bn2000 as
SELECT  t2_fd.bus_reg_nbr,
  t2_fd.ref_yr_cd,
  t2_fd.fpe_dt,
  t2_fd.fps_dt
FROM tms.t2_financial_declaration t2_fd, tms.t2_income_stmt t2_is
WHERE t2_fd.ref_yr_cd = '2001' AND
       T2_FD.REF_YR_CD = t2_is.REF_YR_CD AND
       T2_FD.BUS_REG_NBR = t2_is.BUS_REG_NBR AND
       T2_FD.BN_ACCT_SQNBR = t2_is.BN_ACCT_SQNBR AND
       T2_FD.FPE_DT = t2_is.FPE_DT AND
       T2_FD.FPS_DT = t2_is.FPS_DT AND

     (t2_fd.fpe_dt - t2_fd.fps_dt) >= 30 AND
     (t2_fd.dnr_find_mdul_nbr = '0' or
      t2_fd.dnr_find_mdul_nbr = '1' or
      t2_fd.dnr_find_mdul_nbr is null) AND
        t2_fd.bus_reg_nbr not in
        (SELECT bus_reg_nbr FROM work.bn2001 )
;
QUIT;

PROC SORT data =  work.bn2000 ;
by descending fpe_dt ;
QUIT;

PROC SORT data= work.bn2000 nodupkey;
by bus_reg_nbr ref_yr_cd;
QUIT;

RE: Problem with the IN statement in Proc SQL;

Hi;

Have tried leaving PROC SQL (where I always get strange errors with anything I do) and doing what you want in a qualified DATA statement with a KEEP thrown in?I think that PROC SQL uses memory differently, hence the error message.

Hope that helps at all.

g

"Man is the cheapest computer we can put into a spacecraft and the only one we can mass-produce with unskilled labor."                             Werner von Braun

RE: Problem with the IN statement in Proc SQL;

(OP)
I upgraded to SAS 8.2 and the problem disappeared. It had something to do with a memory problem which they fixed in version 8.2 ...  Thanks for taking the time to reply. I suggest the upgrade if you have not already, It seams that they have solved quite a few of my Proc SQL; dilemmas.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close