SAS Viya Copilot for Code Assistance in SAS Data and AI Studio
Recent Library Articles
In this post, we’ll take a look at how SAS Viya Copilot for Code Assistance can help with some of those everyday tasks: understanding code, improving it, and making changes more confidently—all without leaving the SAS Data and AI Studio environment.
After an extensive investigation, I have found the following, SAS Viya3.5 can only use an internal PostgreSQL database for its Infrastructure Data Server. An external PostgreSQL database is not supported. When we do database maintenance, the re-Index can only happen on the Primary database, not on any secondary standby databases. https://documentation.sas.com/doc/en/calcdc/3.5/calsrvinf/n00000sasinfrdatasrv000admin.htm#n03011viyainfrsrvs00000admin So even if we were to create a cluster, it would not help us allowing the users to work on the Standby but maintenance get done on Primary. We won’t be able to resync back as it would overwrite the reindexed databases and tables. As we are currently on PostgreSQL version 15, would we be allowed to use the “REINDEX INDEX/DATABASE CONCURRENTLY”? If so, what would be the best way to achieve this? I’d think maybe “REINDEX DATABASE CONCURRENTLY” only after hours to reduce impact to users that are online and working. If we were to do a “REINDEX INDEX CONCURRENTLY”, would you be able to supply a recommended script that would list and build the list of indexes so that the tables get reindexed one at a time instead of the entire database? We have a multi-tenant deployment, and some tenants take several hours to process. This is a Fraud system at a bank and requires to be up as closely to 24/7. How are other SAS Clients getting the Database Maintenance (vacuum and reindex) with minimal downtime on a SAS Viya3.5 system?
... View more
The activity.recording.values has three levels: low, medium and high
I cannot understand exactly the difference between the levels and how to determine what level is sufficient for me
I was hoping to find an example that highlights the difference but could not find any
... View more
I am trying to create the equivalent of the below using sas-viya CLI and I am not sure how to achieve it (if it is possible at all):
EyalGonen_0-1788328546040.png
Specifically how to set the conopts parameter within the datasource option
Thanks!
... View more
I have created a macro variable to hold a hyperlink: %let CT_link = https://controller.vcu.edu/grants/; I am using the PROC REPORT to generate the report. I try to embed that hyperlink into a block of text using the Line Statement: line @1 'deadline ^{style [url="&ct_link" linkcolor=white]via the ^{style [color=blue textdecoration=underline]cost transfer form} available on the G&C webpage.} '; We then have a parameter to specify if the report should be output as either PDF or EXCEL. When the report is written as PDF, the hyperlink works fine: jlwatts_0-1788958681923.png But when I export the report to EXCEL, the hyperlink does not work: jlwatts_1-1788958758782.png Is there a way to embed the hyperlink in a line of text to have it work both in PDF and EXCEL format? This is the code that we include to allow selection between PDF, EXCEL or HTML: data _null_; if upcase("&outtype") = "HTML" then call symput("odsdest","HTML"); if upcase("&outtype") = "PDF" then do; rc = stpsrv_header('Content-type','application/pdf'); rc = stpsrv_header('Content-disposition','attachment; filename=temp.pdf'); call symput("odsdest","PDF"); end; if upcase("&outtype") = "EXCEL" then do; rc = stpsrv_header('Content-type','application/vnd.ms-excel;'); rc = stpsrv_header('Content-disposition','attachment; filename=temp.xls'); call symput("odsdest","tagsets.excelxp"); end; run;
... View more
If you’ve worked with SAS macros, you’ve probably inherited one written by someone else, and had no idea how to use it. Or maybe you’re the macro writer, looking for ways to handle unexpected parameters and make your macro easier for others to use. Good macro error handling isn’t about catching every possible failure. It’s about making failures visible, early, and diagnosable, so you or whoever inherits your code isn’t debugging blind six months from now.
In this post, we’ll explore three practical techniques for making your macros more robust:
Normalize user input so differences in casing don’t lead to silent failures.
Build in self-documentation so users can discover how to use the macro without digging through the source code.
Validate parameters so invalid values produce clear, actionable error messages.
To make these techniques concrete, we’ll work through a real example using the SASHELP.CARS table. You can experiment with these techniques and apply them to your own SAS macros.
... View more