SAS® 9.2: Implications for Biotech Bay Area SUG June 7th 2010

Download Report

Transcript SAS® 9.2: Implications for Biotech Bay Area SUG June 7th 2010

SAS® 9.2
Implications for Biotech
Bay Area SAS User’s Group
June 7th 2010
Sarmad Pirzada, MD, MPH
Cancer Research & Biostat.
Seattle WA 98199
[email protected]
Bay Area SUG June 2010
1
Topics for SAS Programmers and IT
• ODS Graphics
• SAS Graph Vs. Data
Graphics
• Procedures
–
–
–
–
–
PHREG
LIFETEST
SGPLOT
SAS Graph Template
SGPLOT & Related
• A Few Tricks
• SAS Installs
• OS Issues
– 32 Vs. 64 Bit
– M2 Vs M3
– Win Server 2008 R2
• Download Manager
• ODBC Driver Issues for
34 Vs. 64 Bit for Unix
• JAVA Applet Installs
Bay Area SUG June 2010
2
SAS/Stat PHREG Procedures < SAS9.2
Survival
Curves
Old Way <9.2
1.
2.
3.
4.
5.
6.
Data Step
Lots of SAS Code (>1,200 lines of macro code)
SAS Stat Proc Outputs
Data Step
SAS Graph Programs
Output (Not Easily Portable)
Bay Area SUG June 2010
3
Code Example from < SAS9.1 for Survival Curves
Bay Area SUG June 2010
4
SAS/Stat PHREG Procedures > SAS9.1
Survival
Curves
New Way
ods graphics on;
proc phreg data=s9321 plots(overlay=stratum)=survival;
*ods select survivalplot;
model surtim*surind(0)= age ;
baseline covariates=ROW out=PRED survival=_all_/ROWID=ISS;
run;
ods graphics off;
quit;
Bay Area SUG June 2010
5
SAS/REG Procedures SAS9.2
Other ODS
Graphics
New Way
Ref: SAS/Stat® 9.2 User’s Guide: Stat Graphics Using ODS
ods graphics on;
proc reg data=sashelp.class;
model weight=height;
quit;
run;
ods graphics off;
Bay Area SUG June 2010
6
GTL and the SG Procedure
Scatter Plot
•Proc Template;
ods listing sge=on;
proc template;
define statgraph classscatter;
begingraph;
entrytitle 'Weight by Height';
layout overlay;
scatterplot y=weight x=height;
endlayout;
endgraph;
end;
run;
proc sgrender data=sashelp.class template=classscatter;
run;
proc sgplot data=sashelp.class;
title 'Weight by Height';
scatter x=height y=weight;
run;
Ref: SAS/Stat® 9.2 User’s Guide: Stat Graphics Using ODS
Bay Area SUG June 2010
7
GTL and the SG Procedure
Spline Regression Plot
ods graphics on;
proc transreg data=sashelp.class;
model
identity(weight)=spline(height);
output out=class clm cli p;
run;
Ref: SAS/Stat® 9.2 User’s Guide: Stat Graphics Using ODS
Bay Area SUG June 2010
8
GTL and the SG Procedure
Box Plot
proc template;
define statgraph classboxplot;
begingraph;
entrytitle 'Gender and Weight
Distribution';
layout overlay;
boxplot y=weight x=sex; endlayout;
endgraph;
end;
run;
proc sgrender data=sashelp.class template=classboxplot;
run;
Ref: SAS/Stat® 9.2 User’s Guide: Stat Graphics Using ODS
Bay Area SUG June 2010
9
SAS Graph Template Language (GTL)
Bay Area SUG June 2010
10
SAS Graph Template Language (GTL)
Bay Area SUG June 2010
11
SAS/Stat Survival Analysis: PROC PHREG
Macro Errors
•Macros Using PROC PHREG, developed prior to SAS9.2 will run into errors if
macros are using default output names
•Usage Note 37170 : Variable name in ParameterEstimates table changed from
'Variable' to 'Parameter'
•Code: Output ParameterEstimate=PE(rename=(Parameter=Variable));
•This Topic covered in usage notes: http://support.sas.com/kb/37/170.html
•In SAS9.2, Plots=Survival (CL), ODS Graphics plot does not extend the survival
confidence limits to the last time for censored observations.
•This Topic is covered in usage notes: http://support.sas.com/kb/35/951.html
Bay Area SUG June 2010
12
SAS/Stat Survival Analysis: Proc PHREG
Hazard Ratios
•GLM Parameterization: Wald Confidence limits provided by the
HAZARDRATIO might be incorrect
•Proc PHREG;
•Class Gender Group/Param=GLM;
•Model Duration*Censor(1)=Gender X Group
X*Group;
•Solution: Need to Compute Custom Hazards Ratios
•HotFix
http://ftp.sas.com/techsup/download/hotfix/HF2/A52.html#38391
Bay Area SUG June 2010
13
SAS/Stat Survival Analysis: Proc PHREG
Other Changes
•Estimation Method: Default method for estimating survival function has
changed to Cumulative Hazards from Product Limit (Method=CH Vs.
Method=PL). Implication: If default method has been used in the past, the
option needs to be changed for reproducing the same results.
•More memory for survival analysis (Usage Notes: 37830)
•Where statements may lead to syntax error
•Example: Proc Phreg(where(age=1 or age=2) and x=‘B’ data=a;
•Fix: Proc Phreg Data=a(where=((age=1 or age=2) and x=‘B’));
•On the Good Side: A Class Option in Phreg!
Bay Area SUG June 2010
14
IT/Install Related:
Most Common ODS Graphics Error
Error Log:
ERROR: The Java proxy is not responding.
ERROR: Unable to load the Java Virtual Machine.
Please see the installation instructions or system administrator.
Investigate under
Win32/64:
proc options option=appletloc; run;
proc options option=jreoptions; run;
proc javainfo; run;
Bay Area SUG June 2010
15
Investigations and e-mails for
SAS Tech Support!
Steps for checking JRE Version
1. Check to see if you have this a jvm.dll file here
C:\Program Files\Java\JRE1.5.0_12\bin\client\jvm.dll
2. Open a command prompt and go to C:\Program
Files\Java\JRE1.5.0_12\bin\
Issue the following at the prompt: java -version
Save results for Tech Support:
3. Check your config file: c:\program
files\sas\sasfoundation\9.2\nls\en\sasv9.cfg
Search for the -jreoptions line
Review every thing that you see on the -jreoptions line
4. Review the logs in the following folder: C:\Documents and
Settings\userid\Application Data\SAS\LOGS
Bay Area SUG June 2010
16
IT/Install Related:
Most Common ODS Graphics Error
Error Log:
Investigate under
Unix/Solaris:
ERROR: The Java proxy is not responding.
ERROR: Unable to load the Java Virtual Machine.
Please see the installation instructions or system administrator.
%put %sysget(JAVA_HOME) ;
%put %sysget(LD_LIBRARY_PATH) ;
%put %sysget(LD_LIBRARY_PATH_32) ;
%put %sysget(LD_LIBRARY_PATH_64) ;
proc javainfo ; run ; proc javainfo picklist 'graph/graph.txt'; run;
proc options option=jreptions ; run ;
Modify JREOPTIONS value
/opt/sas/SAS_9.2/SASFoundation/9.2/sasv9_local.cfg
Add
-Dsas.app.repository.path=/opt/sas/SAS_9.2/SASVersionedJarRepository/9.2/(machine name)
Good SAS Tech Support Contact: Tim Braam
SAS Technical Support/Unix Systems
Bay Area SUG June 2010
17
IT/Install Related DBC Drivers for Oracle
32 Vs. 64 Bit Issues (Notes)
#--- This line assumes that ODBC is located in a directory other than /usr/local
#---------------------------------------------------------------------------------------------------------------LD_LIBRARY_PATH=$SYBASE/$SYBASE_OCS/lib:$ODBCHOME/lib/sparcv9:$ODBCHOME/lib:/usr/lib/sparcv9:/usr/lib:$
ORACLE_HOME/lib:$ORACLE_HOME/lib32
http://support.sas.com/kb/11/728.html oracle 64
_____________________________________________
#!/bin/bash
# IMPORTANT !!!
# This script moves 32 bit modules to the executables
# so that 32 bit ODBC drivers will work
# Must be applied following all Service packs
# --------------------------------------------------#set -x
VERS="9_2"
OUT="/opt/sas/odbc9.2_change.""`date +'%Y%b%d'`"".log"
OUTZIP="/opt/sas/odbc_bkup.""`date +'%Y%b%d%H%M'`"".zip"
SASHOME=/opt/sas/SAS_9.2/SASFoundation/9.2
echo '****************************************' > $OUT
echo 'starting bin/ODBC_9.2.bash ' >> $OUT
echo '****************************************' >> $OUT
function move_and_link
{while read fn
do
echo " " >> $OUT
fn2=${fn%_u}
echo ". zipping $fn2 to zip file ">> $OUT
zip $OUTZIP $fn $fn2
echo ".. moving $fn2 to $fn2.orig64 ">> $OUT
mv -i $fn2 $fn2.orig64
echo "... linking $fn to $fn2" >> $OUT
ln -s $fn $fn2
echo " " >> $OUT
done }
cd $SASHOME
find $SASHOME -name '*_u' -print >/tmp/sas_odbc_files
Bay Area SUG June 2010
move_and_link < /tmp/sas_odbc_files
rm /tmp/sas_odbc_files
18
Summary
•SAS9.2 has major changes in its graphics capabilities that are worth
changing your code to
•Challenges for IT in terms of 32 Vs. 64 Bit Operating Systems
•Graph Template Language is a Powerful Tool for Programmers
•Portable Graphics
•Check your Essential Macros Prior to Migrating to 9.2M3
•Thank You!
Bay Area SUG June 2010
19