Data manipulations in proc sql sas
Pdf File 2,077.56 KByte, 34 Pages
*DATA MANIPULATIONS
IN PROC SQL
Horizontal Table Joins With Matching and/or Non-Matching Conditions
*Horizontal Table Joins in PROC SQL
Advantages of PROC SQL joins:
*It executes on the server and is faster for
large data pulls;
*It does not require sorting or indexing; *It does not require the same name for the
columns in join expressions;
*It permits joining multiple tables in one
step;
*Business Intelligence team understands
PROC SQL code. 2
*Horizontal Table Joins in PROC SQL
Disadvantages of PROC SQL joins:
*It permits joining of the maximum of 256
tables in one step (SAS 9.3);
*Its longer queries sometimes are very
difficult to troubleshoot;
*It can create only one table from a query; *It may not be possible to incorporate
complex logic into the PROC SQL join.
3
*Part I. Joining Tables with Date
Specific Records
Only active accounts are required (Activity=`A') as of October 2, 2013
New accounts should be 4
considered active
*Part I. Joining Tables with Date
Specific Records
The end result should look like this. A nice bonus is to have any kind of product information.
5
*Part I. Joining Tables with Date
Specific Records
/*one side merge using left join*/; proc sql; create table leftmerge1 as select a.*,
b.* from account1 a left join activity1 b on a.acct_id=b.acct_id where a.date='02oct2013'd and b.date='02oct2013'd and activity in('A',' '); quit;
6
- sugi 27 using the magical keyword into in proc sql
- 131 31 using data set options in proc sql
- advanced subqueries in proc sql
- sugi 27 taking advantage of missing values in proc sql
- proc sql for data step die hards idre stats
- conditional processing using the case expression in proc sql
- more about into host variable in proc sql examples
- sugi 26 merging tables in data step vs proc sql
- getting the most out of into in proc sql an example for
- using the sas® data step and proc sql to create macro arrays
- proc sql from select to pass through sql christopher w
- pdf 139 2010 exploring powerful features in proc sql
- 269 29 data step vs proc sql what s a neophyte to do
- quick results with proc sql sas savvy
- data step vs proc sql in a many to many match merge