13.07.2015 Views

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SAS/ACCESS 9.2 for Relational Databases: Reference, Fourth Edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

132 DBMSTEMP= LIBNAME Option 4 Chapter 10(select pty.pty_idfrom permdata.pty_rb pty,permdata.PTY_ARNG_PROD_RB accwhere acc.ACC_PD_CTGY_CD = ’LOC’and acc.pty_id = pty.pty_idgroup by pty.pty_id having count(*) > 5);create table tempdata.ptyacloc as(select ptyacc.pty_id,acc.ACC_APPSYS_ID,acc.ACC_CO_NO,acc.ACCNO,acc.ACC_SUB_NO,acc.ACC_PD_CTGY_CDfrom tempdata.ptyacc ptyacc,perm data.PTY_ARNG_PROD_RB accwhere ptyacc.pty_id = acc.pty_idand acc.ACC_PD_CTGY_CD = ’LOC’);create table tempdata.righttab as(select ptyacloc.pty_idfrom permdata.loc_acc loc,tempdata.ptyacloc ptyaclocwhereptyacloc.ACC_APPSYS_ID = loc.ACC_APPSYS_IDand ptyacloc.ACC_CO_NO = loc.ACC_CO_NOand ptyacloc.ACCNO= loc.ACCNOand ptyacloc.ACC_SUB_NO = loc.ACC_SUB_NOand ptyacloc.ACC_PD_CTGY_CD = loc.ACC_PD_CTGY_CDand loc.ACC_CURR_LINE_AM - loc.ACC_LDGR_BL > 20000);select * from tempdata.ptyaccexceptselect * from tempdata.righttab;.drop table tempdata.ptyacc;drop table tempdata.ptyacloc;drop table tempdata.righttab;quit;See Also“CONNECTION= LIBNAME Option” on page 108“Temporary Table Support <strong>for</strong> <strong>SAS</strong>/<strong>ACCESS</strong>” on page 38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!