Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
SAS MELBOURNE USER GROUP3 DECEMBER 2014
A Merry SMUGness – tis the season to be jolly!
Copyr igh t © 2013, SAS Ins t i tu te Inc . A l l r i gh ts reserved.
IN MEMORY OF BILL GIBSON (1958 – 2014)
Bill was one of the most capable and loyal employees known throughout the SAS community for more than 32 years.
He made countless contributions, not just to our business, but to the lives of so many individuals who are part of the SAS family and community.
He was an icon – loved and respected by colleagues, customers and the user community.
DON’T FORGET TO CHECK YOUR EMAIL – TO COMPLETE THE SMUG ONLINE SURVEY
VOTE FOR TODAY’S BEST PRESENTATION…
By completing the online survey you could win…
2 x adult passes to Hoyts La Premiere
SMUG 2014
CASE STUDY WITH SAS CREDIT SCORING & RISK MANAGEMENT
BY ELIZABETE COLACIOPPO
WHO AM I?ELIZABETE COLACIOPPO
(LIZ)
1996
First IT job
1998 to 2000
Uni Data Processing
2003
First BI job
2008
Analytics
2009
SAS Credit Solutions
2010 to 2011
MBA Project Management
2012
Australia
Medical Industry1996-1998
Other Services1998-2001
Banking2001-2012
Retail2012-2014
1996
First IT job
1998 to 2000
Uni Data Processing
2003
First BI job
2008
Analytics
2009
SAS Credit Solutions
IN EVERY COUNTRY, FULLY DEVELOPED OR NOT
BUSINESS IS BUSINESS
AND TECHNOLOGY IS THERE TO SERVE IT
WHAT AM I TALKING ABOUT?• CREDIT SCORING FOR BANKING
• CREDIT RISK MANAGEMENT
• IMPLEMENTATION PROCESS
• PROJECT MANAGEMENT
• LESSONS LEARNT
• EXTRA BENEFITS
WHAT AM I NOT TALKING ABOUT?• INDEXES SUCH AS PD, LGD, EAD, CCF
• HOW TO CREATE A MODEL
• SAS CODING
WHAT AM I NOT TALKING ABOUT?• BASEL II OR III
CALCULATING CAPITAL REQUIREMENT AND RISK WEIGHTED ASSETS FOR RETAIL
THE CAPITAL REQUIREMENT, K, IS CALCULATED AS
IS THIS RGHT???
CREDIT SCORING FOR BANKING• LETS YOU DEVELOP, VALIDATE, DEPLOY AND TRACK CREDIT SCORE CARDS
CREDIT RISK MANAGEMENT FOR BANKING
• THIS SOLUTION WILL PROVIDE ALL THE NUMBERS THAT SHOULDBE SENT IN REGULATORY REPORTS CALCULATING THE MAINRESERVE THAT THE INSTITUTION SHOULD KEEP IN ORDER TO BEA HEALTH BUSINESS.
• AND GENERATE THESE REPORTS
DATA FLOW
Operational Systems Staging DDS
Regulatory Reporting for Credit Risk
External Data
DATA FLOW
Operational Systems Staging DDS DM
Reporting for Credit Scoring for Banking
Regulatory Reporting for Credit Risk
External Data
DATA FLOW
DDS DM ABTs
SAS MINER
Reporting for Credit Scoring for Banking
Regulatory Reporting for Credit Risk
DATA FLOW
ApplicationsSurrogate KeyValid FromValid ToAppl Id
Credit Card
Others
DDS
ApplicationsAppl IdAppl Date
Credit Card
Others
DMCorporate ModelCustomer IdAppl QtyAppl AmtCredit Card Amt
ABT
Consumers Model
DATA MART BENEFITS
DM
ABTsSAS
MINER
Reporting for Credit Scoring for Banking
Marketing analyses Campaigns
Other analyses
DATA MART PERSONALISATION
DM’1
ABTsSAS
MINER
Reporting for Credit Scoring for Banking
Marketing analyses Campaigns
Other analyses
DM
www
DATA FLOW’1REAL CASE OF CREDIT SCORING FOR BANKING
Operational Systems Staging DM’
1
DM
ABTs
SAS MINER
Reporting for Credit Scoring for Banking
DDS’1
Functional Specification
Data Modelling
Technical Specification
Development
Testing
IMPLEMENTATION
Design
Staging • Design completed
DDS • Design completed
DM • Design completed
Reporting
IMPLEMENTATION
Staging • 3 months to start up to 1 year• Resources: 1 project member and Customer team
DDS
• 4 to 6 months• Project: architect, team lead, business analyst,
developers• Customer: Technical and business contacts
DM • Same as DDS• Data Modeller
Reporting
IMPLEMENTATION
DOCUMENTATION80% OF THE PROJECT IS ANALYSES AND DOCUMENTATION!
• BUSINESS SPECIFICATIONS
• DATA MODELS
• TECHNICAL SPECIFICATIONS
• DATA DICTIONARY
DOCUMENTATIONA PROJECT WITH A GOOD DOCUMENTATION CAN BE EASILY UNDERSTOOD ANDMODIFIED
A GOOD PROJECT POOR WITH DOCUMENTATION WOULD HAVE BIG COSTS FOR CHANGING AND EVEN FOR UNDERSTANDING OF CURRENT SCENARIO
PROJECT MANAGEMENTRISKS IN CASES STUDY• CREDIT RISK MANAGEMENT:
• Staging area with delay and changing structure (Ex.: PK) after closing date
• Rework in DDS specifications
• Rework in DDS development
• Delay in DDS (Due Delay in Stage)
• DM design/specification in parallel with DDS specification using assumptions has required some rework
• Development team with too many members for a few weeks
• A lot of work from the lead team to transfer the knowledge and not productive team in the first week
PROJECT MANAGEMENTPARALLELISM OR WATERFALL?• RISKS OF DELAY IN WATERFALL:
• Delay in one stage delays the whole project• Next projects for your resources can be impacted• Bigger cost if resources cannot be released
• RISKS OF DELAY IN PARALLELISM:• Redesign in one stage means redesign in all subsequent stages• Resource allocation for rework• Bigger cost
PROJECT MANAGEMENTPARALLELISM OR WATERFALL?• BENEFITS OF WATERFALL:
• Easier to analyse and development (Second stage starts after fist stage)
• Use even with delay in other stages when contract has clear clauses on dependencies allowing to postponing dates
• BENEFITS OF PARALLELISM:
• More chances to reach the date even with rework
• Use when resources cannot be reallocate or date cannot shift
PROJECT MANAGEMENTRISKS IN CASES STUDY• CREDIT SCORING FOR BANKING:
• DDS developed by Customer
• Delay in DDS causing delay / parallel work in DM with rework
• Extra effort from project team to validate DDS
• Lack of control in the DDS design
• DM personalized
• More work require to adjust Reporting linked to the solution
RECOMMENDATIONS• DDS AND DM MUST BE CONTROLLED/DEVELOPED BY PROJECT TEAM
• STAGING
• Should be finalized before project team is involved
• A project member should be deeply involved in Staging development
• Project team could be responsible to control and design Staging area
• (Project team will be focus on the project while Business team will have other priorities as well)
• DOCUMENTATION
• PLAN GOOD TIME FOR DOCUMENTATION AND VALIDATION/APPROVAL OF THAT BY THE BUSINESS
SOME TECHNICAL INFO• DATABASE FOR STAGING: ORACLE (BOTH CASES)
• DATABASE FOR DDS AND DM:
• SAS / Unix (credit risk management)
• Oracle (Credit scoring for banking)
• ETL: SAS DI (DATA INTEGRATION)
• Use of Some personalized transformations
LESSONS LEARNT• RISK OF PARALLELISM BETWEEN STAGING, DDS AND DM
• Rework on next stages
• MAKE SURE THE BUSINESS HAVE CLEAR UNDERSTANDING OF FUNCTIONAL AND TECHNICAL SPECIFICATIONS BEFORE APPROVAL
• The business approved the specifications with not much time to validate which cause changing requests
• DOCUMENTATION AND DOCUMENTATION
• Ex.: technical specification of default with 10 pages
EXTRA BENEFITS• DDS
• Data Warehouse
• All information required for BI / Analytics analyses with history
• DM
• Information available in user-friendly structure
• Can be used in SAS Guide, SAS Miner, Excel and others
• Can grow to be the only source for BI / Analytics
• Can be used for analyses on Credit Risk, Marketing, Campaign an others
• ABT
• All information for each model
QUESTIONS???
THANK YOU!!!
TIPS & TRICKS
A Beginning to SAS Macros
Lindsay Oxenham
SMUG 3rd December 2014
Simple Proc Print
• Here is a simple Proc Print without macros• TITLE 'Simple Proc Print' ; • PROC PRINT data=sashelp.shoes ; run ;
40
Simple Proc Print
Obs Region Product Subsidiary Stores Sales Inventory Returns1 Africa Boot Addis Ababa 12 $29,761 $191,821 $7692 Africa Men's Casual Addis Ababa 4 $67,242 $118,036 $2,2843 Africa Men's Dress Addis Ababa 7 $76,793 $136,273 $2,4334 Africa Sandal Addis Ababa 10 $62,819 $204,284 $1,8615 Africa Slipper Addis Ababa 14 $68,641 $279,795 $1,7716 Africa Sport Shoe Addis Ababa 4 $1,690 $16,634 $797 Africa Women's Casual Addis Ababa 2 $51,541 $98,641 $940
----------------------------------
393 Western Europe Sport Shoe Rome 14 $9,969 $74,848 $549 394 Western Europe Women's Casual Rome 2 $19,964 $62,256 $954 395 Western Europe Women's Dress Rome 16 $106,676 $389,861 $3,160
41
Simple Macro
%macro print_dataset ;TITLE 'Simple Macro' ;PROC PRINT data=sashelp.shoes ; run ;%mend print_dataset ;
%print_dataset ; /* invoke macro */
42
Simple Macro
Obs Region Product Subsidiary Stores Sales Inventory Returns1 Africa Boot Addis Ababa 12 $29,761 $191,821 $7692 Africa Men's Casual Addis Ababa 4 $67,242 $118,036 $2,2843 Africa Men's Dress Addis Ababa 7 $76,793 $136,273 $2,4334 Africa Sandal Addis Ababa 10 $62,819 $204,284 $1,8615 Africa Slipper Addis Ababa 14 $68,641 $279,795 $1,7716 Africa Sport Shoe Addis Ababa 4 $1,690 $16,634 $797 Africa Women's Casual Addis Ababa 2 $51,541 $98,641 $940
----------------------------------
393 Western Europe Sport Shoe Rome 14 $9,969 $74,848 $549 394 Western Europe Women's Casual Rome 2 $19,964 $62,256 $954 395 Western Europe Women's Dress Rome 16 $106,676 $389,861 $3,160
43
Macro with Parameters%macro print_dataset(variables=) ;TITLE “Macro with &variables” ;PROC PRINT data=sashelp.shoes ;
VAR &variables ;Run;%mend print_dataset ;
%print_dataset(variables=Product subsidiary sales) ; /* invoke macro */
44
Macro with Product subsidiary sales
Obs Product Subsidiary Sales
1 Boot Addis Ababa $29,761 2 Men's Casual Addis Ababa $67,242 3 Men's Dress Addis Ababa $76,793 4 Sandal Addis Ababa $62,819 5 Slipper Addis Ababa $68,641 6 Sport Shoe Addis Ababa $1,690 7 Women's Casual Addis Ababa $51,541
----------------------------
393 Sport Shoe Rome $9,969 394 Women's Casual Rome $19,964 395 Women's Dress Rome $106,676
45
Macro with all or part%macro print_dataset(variables=all) ;TITLE “Macro with Parameter variables=&variables” ;PROC PRINT data=sashelp.shoes ; %if &variables=all %then %do ;/* print all the variables */%end ;%else %do ;
VAR &variables ;%end ;Run ;%mend print_dataset ;
%print_dataset(variables=Product subsidiary sales) ; /* invoke macro */
46
Macro with number of obs%macro print_dataset(variables=all,nbr_obs=max) ;TITLE “Macro with Parameter variables=&variables – NBR_OBS=&nbr_obs” ;PROC PRINT data=sashelp.shoes (obs=&nbr_obs) ; %if &variables=all %then %do ;/* print all the variables */%end ;%else %do ;
VAR &variables ;%end ;Run ;%mend print_dataset ;
%print_dataset(variables=Product subsidiary returns,nbr_obs=10) ;
47
Macro with Parameter variables=Product subsidiary returns - NBR_OBS=10
Obs Product Subsidiary Returns
1 Boot Addis Ababa $769 2 Men's Casual Addis Ababa $2,284 3 Men's Dress Addis Ababa $2,433 4 Sandal Addis Ababa $1,861 5 Slipper Addis Ababa $1,771 6 Sport Shoe Addis Ababa $79 7 Women's Casual Addis Ababa $940 8 Women's Dress Addis Ababa $3,233 9 Boot Algiers $710 10 Men's Casual Algiers $2,221
48
Macro Options• MLOGIC - trace macro execution• MPRINT-display SAS statements generated by macro execution • SYMBOLGEN - write results of resolving macro variable
references to SAS log• MERROR-Treat apparent undefined macro references as an error • Warning: Apparent invocation of macro macro-name not resolved• SERROR - Treat references to undefined macro variables as an
error
49
SASLOG Output
MLOGIC(PRINT_DATASET): Beginning execution. MLOGIC(PRINT_DATASET): Parameter VARIABLES has value Product subsidiary returnsMLOGIC(PRINT_DATASET): Parameter NBR_OBS has value 10 SYMBOLGEN: Macro variable VARIABLES resolves to Product subsidiary returns SYMBOLGEN: Macro variable NBR_OBS resolves to 10 MPRINT(PRINT_DATASET): TITLE "Macro with Parameter variables=Product subsidiary returns - NBR_OBS=10" ; SYMBOLGEN: Macro variable NBR_OBS resolves to 10 MPRINT(PRINT_DATASET): PROC PRINT data=sashelp.shoes (obs=10) ; SYMBOLGEN: Macro variable VARIABLES resolves to Product subsidiary returns MLOGIC(PRINT_DATASET): %IF condition &variables=all is FALSE SYMBOLGEN: Macro variable VARIABLES resolves to Product subsidiary returns MPRINT(PRINT_DATASET): VAR Product subsidiary returns ; MPRINT(PRINT_DATASET): Run ;
NOTE: There were 10 observations read from the data set SASHELP.SHOES. NOTE: The PROCEDURE PRINT printed page 1. NOTE: The PROCEDURE PRINT used 0.05 CPU seconds and 14093K.
NOTE: The address space has used a maximum of 916K below the line and 15956K above the line.
MLOGIC(PRINT_DATASET): Ending execution.
50
Re-usable Macros
• Store macros in a library• Use SASAUTOS=• Included Macro NBRRECS (next slide)
51
/******************************************************************** Macro program to get the number of observations in a dataset
The default ddname is work
Note :- this macro set the option dsnferr on & off
The macro variable returned by this macro is :-nbr_obs - which is the number of observations in a dataset
invoke macro this way :-%nbrrecs(libref=pdb,dataset=rmfintrv) ;
Programmer - Lindsay Oxenham - December 2014 *********************************************************************/
%macro nbrrecs(libref=work,dataset=) ; %global nbr_obs ; %let nbr_obs = ; /* reset the nbr_obs macro variable */
/* SAS will not produce error message if dataset not found */ options NODSNFERR ;
%if %length(&libref) eq 0 %then %do ; %let libref = work ;
%end ;
%if %length(&dataset) ne 0 %then %do ; data _null_ ;
call symput('nbr_obs',compress(put(nobs,best.))) ;stop ; set &libref..&dataset nobs=nobs ;
run ; %end ;
options DSNFERR ; /* return back to default */
%mend nbrrecs ;
52
Sample to use NBRRECS macro for Exception Reporting
%macro sendmail ;
%nbrrecs(libref=sashelp,dataset=shoes) ; /* returns &nbr_obs */
%if &nbr_obs > 0 %then %do ; Title "Returns less than $50" ; proc print data=sashelp.shoes (obs=&nbr_obs) ;
where returns < 50 ; id region ; var Product Subsidiary returns ;
run ; %end ;
%mend sendmail ;
%sendmail ;
53
MLOGIC(SENDMAIL): Beginning execution. MLOGIC(SENDMAIL): Beginning compilation of NBRRECS using the autocall file my.macrosMLOGIC(SENDMAIL): Ending compilation of NBRRECS. MLOGIC(NBRRECS): Beginning execution. MLOGIC(NBRRECS): This macro was compiled from the autocall file my.macrosMLOGIC(NBRRECS): Parameter LIBREF has value sashelp MLOGIC(NBRRECS): Parameter DATASET has value shoes MLOGIC(NBRRECS): %GLOBAL NBR_OBS MLOGIC(NBRRECS): %LET (variable name is NBR_OBS) MPRINT(NBRRECS): options NODSNFERR ; SYMBOLGEN: Macro variable LIBREF resolves to sashelp MLOGIC(NBRRECS): %IF condition %length(&libref) eq 0 is FALSE SYMBOLGEN: Macro variable DATASET resolves to shoes MLOGIC(NBRRECS): %IF condition %length(&dataset) ne 0 is TRUE MPRINT(NBRRECS): data _null_ ; MPRINT(NBRRECS): call symput('nbr_obs',compress(put(nobs,best.))) ; MPRINT(NBRRECS): stop ; SYMBOLGEN: Macro variable LIBREF resolves to sashelp SYMBOLGEN: Macro variable DATASET resolves to shoes MPRINT(NBRRECS): set sashelp.shoes nobs=nobs ; MPRINT(NBRRECS): run ; MPRINT(NBRRECS): options DSNFERR ; MLOGIC(NBRRECS): Ending execution. MPRINT(SENDMAIL): ; SYMBOLGEN: Macro variable NBR_OBS resolves to 395 MLOGIC(SENDMAIL): %IF condition &nbr_obs > 0 is TRUE SYMBOLGEN: Macro variable NBR_OBS resolves to 395 MPRINT(SENDMAIL): proc print data=sashelp.shoes (obs=395) ; MPRINT(SENDMAIL): where returns < 50 ; MPRINT(SENDMAIL): run ;
54
Returns less than $50
Region Product Subsidiary Returns
Africa Sport Shoe Cairo $44 Africa Sport Shoe Luanda $29 Asia Sport Shoe Seoul $10 Asia Sport Shoe Tokyo $22 Canada Sandal Ottawa $27 Canada Sandal Toronto $38 Eastern Europe Sandal Prague $48 Middle East Sport Shoe Al-Khobar $43 Middle East Sport Shoe Tel Aviv $47 Pacific Sandal Auckland $10 Pacific Sandal Canberra $21 Pacific Sport Shoe Kuala Lumpur $42 Pacific Sandal Singapore $35 United States Sandal Chicago $35 United States Sandal Los Angeles $38 United States Sandal New York $23 Western Europe Sport Shoe Copenhagen $31 Western Europe Sandal London $24 Western Europe Sandal Rome $48 55
Thank You for Listening
• If you need extra information• Contact Lindsay Oxenham• [email protected]• References - SAS Guide to Macro processing
56
Copyr igh t © 2013, SAS Ins t i tu te Inc . A l l r igh ts reserved.
SAS EDUCATION TAKING YOU WHERE YOU WANT TO GO
the skills to fully realise the power of the SAS software in your hands
Copyr igh t © 2013, SAS Ins t i tu te Inc . A l l r igh ts reserved.
Contact [email protected] for more information
1. Free Analytics U
2. Free e-Courses
SAS Programming 1: Essentials SAS Statistics 1: Introduction to ANOVA, Regression,
and Logistic Regression
3. Certification
Set Yourself Apart Become More Hire Qualified Employees Demand More
Get SAS certified Validate your SAS software skills and earn the globally-recognisedcredential endorsed by SAS3 easy steps to help you….
Copyr igh t © 2013, SAS Ins t i tu te Inc . A l l r igh ts reserved.
BASE Programming Certification
Advanced SAS Programming Certification
Predictive Modelling Certification
Examples of CertificationPackages
SAS Global Certification ProgramSet Yourself Apart
Statistical Analysis Certification
Contact [email protected] for more information
SANZOC UPDATE
SMUG Committee
SAS AUSTRALIA & NEW ZEALAND ONLINE COMMUNITY(SANZOC)
SANZOC now an open group
Available to anyone, allows overseas expertsto participate in local discussions
No waiting for approval
Still moderated, discussions may be relocated.
Encourage you all to join
Discover online communities
Continue user discussions
Remember to follow the SMUGavatar & committee members
http://communities.sas.com/groups/sanzoc
SAS GLOBAL FORUM 201526 – 29 APRIL, DALLAS TEXAS
Call for papers now open
Wide array of subject matter
Visual Analytics, Administration, Programming, Statistics
And many more...
Benefits
International recognition, Peer review, Networking
Looks great on a CV!
Speak to locals who have presented overseas:
Andrew Howell (SMUG & SANZOC) – SGF 2013, SGF 2014
Brian Watts (SMUG speaker) – SEUGI 2001, SEUGI 2002
Michelle Holmes (QUEST & SANZOC) – SGF 2014
http://www.sas.com/en_us/events/2014Q1/sas-global-forum-2015/home.html
WIN A TRIP TOSAS GLOBAL FORUM 2015
All presentations are judged by our users
Last SMUG Q3 winner: Elisa Young, Novotech Melbourne
The Winner of each user group meeting, entered into the draw
From SMUG, SNUG, QUEST, SAUSAG, WASUP, etc
One winner wins a free trip to SAS Global Forum 2015
Flights
Accommodation
Registration
Last year’s winner was Bob Whitehead from Perth
Speak to a SMUG Committee member about presenting at SMUG
SMUG TRIVIA
10 multiple choice questions….
Were you paying attention?
QUESTION 1
How do you end a macro definition?
a. run;
b. %mend;
c. quit;
d. %macro;
QUESTION 2
Which techniques can make macros re-usable?
a. %include
b. Macro catalog
c. SASAUTOS
d. All of the above
QUESTION 3
How do you trace macro execution?
a. MPRINT
b. MLOGIC
c. SYMBOLGEN
d. MEND
QUESTION 4
Where does reporting for credit scoring occur from?
a. Source System
b. SAS Miner
c. DDS
d. DM
QUESTION 5
What takes up 80% of the project?
a. Getting approval
b. Planning
c. Documentation
d. Development
QUESTION 6
In the implementation of the credit scoring approach, what came after “Staging”?
a. DDS
b. Reporting
c. TMP
d. DM
QUESTION 7
Which of the following are benefits of a Data Mart?
a. Data is one place
b. Can be used for many types of analyses & reporting
c. Can have multiple DMs
d. All of the above
QUESTION 8
Which is not a risk of a delay in parallel PM approach?
a. Bigger cost
b. Delay of one stage, delays the whole project
c. Resource allocation
d. Redesign of one stage means more redesign of subsequent stages
QUESTION 9
What is the correct order in the 3 design stages during implementation?
a. Functional Specification, Data Modelling, Technical Specification
b. Testing, Data Modelling, Technical Specification
c. Technical Specification, Functional Specification, Data Modelling
d. Functional Specification, Technical Specification, Development
QUESTION 10
What is the International Banking Standard around Credit Scoring?
a. Babel
b. Basel II / III
c. ICC
d. Brazil III
THE ANSWERS…..
1. B
2. D
3. A
4. D
5. C
6. A
7. D
8. B
9. A
10. B
AND the winner is……?
PLEASE SWAP WITH YOUR NEIGHBOUR
Q & A
QUESTIONS FOR THE PRESENTERS?
DON’T FORGET TO COMPLETE THE EVALUATION SURVEY EMAIL
THANK YOU FOR YOUR ATTENDANCE IN 2014
Please join us outside for Refreshments & Networking