Getting Started with SAS Viya Copilot for SAS Visual Analytics
Recent Library Articles
Turn data into insights faster with AI-powered summaries, translations, and more. This post covers how SAS Visual Analytics leverages copilot and walks through its capabilities and interface, best practices for writing prompts, as well as some tips on responsible use.
Team Name Comture Track Public Sector Use Case We combine publicly available geospatial information to build analytical models that estimate disaster risk, and develop an explainable AI agent that supports preparedness decisions. Technology SAS Viya, Python Region AP Team lead Kiyotaka Murata Team members Chiaki Furukawa Kaho Yamashi ta Kosei Oyama Rei Kawakatsu Arata Hasunuma Social media handles Is your team interested in participating in an interview? N Optional: Expand on your technology expertise
... View more
In the past few months, we have seen an increase in demand to optimize the credit lifecycle for SME and commercial lending. Around 3 out 5 banks are exploring a transformation in this segment. This market represents 90% of worldwide business and provides more than 50% of global employment according to the World Bank. In addition, serving this market is becoming more and more the core focus of banks as it is a major profit source for financial institutions. When it comes to pricing commercial loans, many banks continue to rely on manual, inconsistent processes that leave significant value on the table. Historically, institutions have depended on policy-based pricing grids, relationship manager discretion, or manual credit committee adjustments, an approach that breaks down under today's conditions of margin compression, heightened competition, and economic uncertainty. In practice, this can lead to missed revenue opportunities, hidden margin leakage, inconsistent customer pricing, and suboptimal alignment between risk and growth strategies. The Risk-Based Pricing Challenge Compared with consumer lending, which benefits from highly standardized and automated products, SME and commercial lending are inherently more complex, with financing needs ranging from small working-capital loans of tens of thousands of dollars to multi-million-dollar credit facilities, and credit can take many forms: term loans, overdrafts, equipment financing, and real estate. Conventional pricing practices typically require relationship managers to refer to rate sheets, route deals through multiple approval layers, and negotiate terms based on credit analysis, competitive dynamics, and client relationships. This creates: Lengthy approval processes and operational inefficiencies Inconsistency across relationship managers and regional interpretations Fair lending concerns, bias, and lack of explainability Underpriced borrowers (lost revenue) and overpriced borrowers (lost business) The Answer: Risk-Based Pricing Incorporating Relationship Value Risk-based pricing in commercial lending is a complex process that considers the full customer relationship, not just the loan being requested. This includes existing lending exposure, investment and foreign exchange revenues, employee payroll domiciliation, corporate credit card revenues, and other sources of profitability. Pricing comparison between two companies requesting a new loan When a new loan request is received, a real-time on demand price optimization incorporates both the characteristics of the new facility and the projected profitability of the overall relationship. The calculation accounts for operating costs, cost of funds, expected credit losses, and the required return on capital established by the bank's portfolio strategy. In some cases, a pricing premium or discount may be applied to align with competitive objectives, customer segment strategies, industry outlooks, or broader portfolio optimization goals. Relationship managers need a fast and efficient tool that performs these calculations in real-time while requiring only a minimal amount of information from the user. SAS enables an on-demand commercial loan pricing solution that can integrate seamlessly with a front-end application. Rather than providing a single recommendation, the solution can generate multiple pricing scenarios, helping relationship managers negotiate deals that are both competitive and profitable. The real-time price optimization process Core Components of an Automated Risk-Based Pricing Framework Three integrated capabilities are required to operationalize automated risk-based pricing at scale. Data Integration Layer Many banks encourage risk-based pricing but see it fail because relationship managers must manually consolidate large numbers of data points a time-consuming, error-prone process that often results in the pricing calculator being skipped altogether. With SAS an effective integration layer can be built to: Pull real-time data via API from core systems, credit bureaus, and financial data providers Standardize structured, semi-structured, and unstructured data into common templates Apply OCR and LLM agents to extract information from PDFs, appraisal reports, and financial statements Flag data quality issues missing values, outliers, and inconsistencies for human review Allow relationship managers to review, modify, and confirm extracted data before pricing runs Commercial Loan Pricing Engine A modern commercial lending process must automate not just pricing, but the entire loan origination flow. SAS’s key decisioning capabilities include: Capability Description Unified Origination and Pricing Process End-to-end configurable strategies integrating LLM components, rules, ML models, ECL and Capital calculation processes, price optimization and conditional logic Granular Segmentation Differentiated strategies by portfolio, risk tier, product line, or customer profile Lookup Table Integration Cost of funds, operating costs and other RAROC parameters, policy matrices, and risk ladders updatable without recoding A/B Testing Framework Champion/challenger testing before full strategy deployment Model Integration PD, LGD and EAD models imported directly from model repository ECL and Capital Calculation Engine Integration with the bank’s own ECL and Capital calculation models (including collateral allocation) for real-time on-demand ECL and Capital calculation Governance & Audit Version control, change logs, approval workflows, and role-based access Simulation Scenario simulation to negotiate improved collateral quality and optimize pricing conditions The RAROC Calculator in Practice The pricing engine brings all components together in an iterative process: Project expected revenue from existing loans and cross-sell opportunities Derive expected loss from PD × LGD × EAD (considering new loan and full collateral stack) Calculate economic capital contribution of the individual customer Evaluate the desired rate and fees with respect to target hurdle rate Iterate on the new loan rate and fees until all constraints are satisfied including meeting the customer segment hurdle rate Add strategic premium from portfolio and market intelligence tables With this setup, the engine typically requires only the new loan amount, tenor, type, and collateral as input. All other data is automatically retrieved, processed, and calculated to produce the optimal rate or rates to charge. Risk-Based Pricing in Action This example illustrates a simple user interface where the relationship manager enters key details about the request, including the customer reference number, requested loan amount, proposed rate and fees, collateral value, and loan term. Most of the remaining information can be automatically retrieved from internal systems and databases. User interface illustration Once the user submits the request, the solution immediately calculates the expected return on capital for the entire customer relationship and compares it to the portfolio/customer segment’s hurdle rate. In this example, the proposed pricing generates a return below the target threshold. Illustration of desired outcome in the system Most financial institutions aim to give options to the relationship manager and not just approve or reject the request, and with SAS it is possible to produce alternative pricing options, for instance: Option 1- Adjust Interest Rate: Maintain the proposed fees while adjusting the interest rate to achieve the target return on capital and any portfolio strategy premium. Option 2 – Revised Fees: Maintain the proposed interest rate while recommending revised fees that satisfy profitability and portfolio objectives. Option 3 – Optimized approach: Apply a balanced optimization approach that starts from standard pricing levels for the product and customer segment, then optimizes the interest rate and fees to achieve the desired outcome. How SAS supports the end-to-end backend process to generate an offer in minutes Pull Financials and Calculate Ratios: Behind the scenes, SAS Decision Engine runs a real-time price optimization process that starts by pulling in a customer's digitized (OCR-processed) financial statements from the source database to assess financial health and key ratios like debt service coverage against lending policies automatically flagging or revising the loan amount if it would breach acceptable thresholds. Query internal Data and Models: The system then evaluates the full customer relationship by querying existing loans, investments, FX activity, other products, and collateral values, and uses the customer's risk grade to look up (or model in real time) their probability of default, along with segment- and tenor-specific pricing parameters such as hurdle rate, cost of funds, and operating costs. Calculate Collateral Allocation: Loss given default is calculated from collateral allocation across the customer's loan portfolio, and SAS functions (built-in or custom) project exposures and interest over the next 12 months. (For more information consult SAS Solution for Regulatory Capital | SAS) Functions to Calculate Return on Capital: With all inputs prepared, a custom function calculates return on capital for the proposed rate and fees, comparing it to the hurdle rate, while a segmentation tree routes the request to the appropriate approval level if needed. Run Optimization: Finally, an optimization function runs thousands of iterations to find the optimal rate/fee combination that meets the hurdle rate with optional premiums applied by industry or segment. Test and publish without recoding: The strategy can be tested on individual scenarios or full datasets before being published for real-time or batch processing. Reporting & Analytics Integrating with data in real-time ensures the strategy is performing as expected and indicates whether changes to the strategy need to be made when drifts are detected. Different stakeholders require tailored dashboards and analytics, ranging from portfolio risk, performance and profitability monitoring for credit officers and risk analysts, to executive-level insights on portfolio composition, risk-adjusted returns, competitive performance, and strategic initiatives. SAS Visual Analytics provides a tiered reporting framework ensuring all stakeholders have the insights they need. Strategic Impact Across the Banking Value Chain Impact on Revenue and Efficiency Automated risk-based pricing fundamentally reshapes multiple areas of the institution from revenue generation and cost efficiency to relationship management and competitive positioning. Revenue Impact Competitive pricing wins high-quality borrowers Granular pricing captures value on underpriced loans Relationship pricing unlocks cross-sell opportunities Dynamic repricing responds to market shifts in near real-time Cost & Efficiency Impact Shorter loan cycles boost RM productivity Reduced human error eliminates rework Integrated platform reduces technology sprawl Cloud infrastructure lowers maintenance overhead By replacing manual, judgment-heavy processes with integrated decisioning, granular risk analytics, and dynamic pricing capabilities, institutions unlock a step-change in both financial performance and operational agility creating a more resilient, scalable, and strategically aligned lending ecosystem. Recommended Resources SAS for Risk Modeling & Decisioning | SAS For more information, please contact @sasorza and @CarlaBoustany
... View more
Years ago, I wrote a post on another platform about whether it makes more sense to treat patients in a crossover study as a random effect, or as a repeated measures effect, in a mixed model. At the time, I was primarily talking about models with a normal distribution and an identity link. I still get the question regularly, so I figured this is a good time to resurrect the content plus update the whole thing with remarks about more recent research and some additional procedures. I'm reproducing most of the original post here along with additions and newer references in the statistical literature. I'm using PROC GLIMMIX code this time instead of PROC MIXED, and will explain why later. I hope you enjoy!
... View more
SAS Visual Analytics (VA) is a powerful tool for creating interactive reports and dashboards. But what if you want to automate the process of exporting these reports to PDF?
Whether you're building a reporting pipeline, integrating SAS with other systems, or simply want to schedule exports, the SAS Visual Analytics REST APIs are your solution.
In this article, we’ll walk through how to:
Authenticate with SAS Viya using OAuth 2.0
Retrieve available reports
Export full reports to PDF
Use Python and the requests library to automate the process
... View more
%global stind endind;
%let stind=0; %let endind=500;
%macro m_sinx(nx, baseratio, noiseratio);
/*%let nx=30;*/
data temp_simu_sin_od;
%do i=1 %to &nx;
ybase=(round(ranuni(&i.),0.1)+0.1)*&baseratio.;
%do x=&stind. %to &endind.;
tick=&i.;
ynoise=(ranuni(&i.)-0.5)*&noiseratio.*2*ranuni(&x.);
y=ybase*sin(&x./200)+(ranuni(&i.)-0.5)*&noiseratio.*2*ranuni(&x.);
ind=&x.;
output;
%end;
%end;
run;quit;
%mend;
%m_sinx(300,20,0.5);
When nx=30, it takes only seconds. But when nx=300, it takes forever. I have to stop in middle.
Any wrong with the coding?!
21830
21831 %m_sinx(30,20,0.5);
NOTE: The data set WORK.TEMP_SIMU_SIN_OD has 15030 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 3.52 seconds
cpu time 3.56 seconds
21832
21833 %m_sinx(300,20,0.5);
NOTE: DATA statement used (Total process time):
real time 4:48.31
cpu time 4:03.35
... View more