Suppose in the Develop SAS Code part of SAS Viya, I have a table that I've generated using PROC SQL. I want to make this table accessible to the SAS Data Explorer so that I can utilize it in SAS Visual Analytics. What is the best way I can do this?
You will need to upload the data to CAS by uploading the table into one of your CASLIBS. Since your using Studio this video should help. It runs through the entire process.
Understanding Caslibs and Loading Data in SAS® Viya™
Here is the documentation: Load Data to a Caslib
Once the data is loaded into CAS you can work with it in Visual Analytics since it needs an in-memory table to create your visualizations.
Related to this, is there a way in SAS Visual Analytics to perform joins and calculated columns using code instead of the GUI's?
From my work with SAS Visual Analytics, you can perform joins and calculated columns inside Visual Analytics, however that's not the tool's main purpose. Like you said, it would take many clicks to do so. I personally like to do all my data prep using SAS or Python, then taking the finalized data and uploading it to CAS.
Your best bet is to perform the joins using a programming language of your choice (SAS, SQL, Python, R. Open source languages will work as long as it is set up with your admin and you install the SWAT package) and perform the data prep. Once the data is prepped you can save the physical file in a CASLIB and load that table into memory, or you can do it using code. It allows you the flexibility to do it as you see fit.
I noticed you said you plan on using PROC SQL. How big is your data? Is it currently in CAS or are you working with it as a SAS data set? Be aware that PROC SQL does not run distributed in CAS. So if your data is big and it is already in CAS you might want to think about using PROC FEDSQL. Here is a quick blog: SAS® Viya®: How to Emulate PROC SQL Using CAS-Enabled PROC FedSQL.
However, if you don't need the distributed power of CAS you can stick to PROC SQL.
Assuming there is a way to do what I had mentioned above, it may work for certain applications, but it might not necessarily have the active, reloadable connection to database data that some applications require.
I wasn't 100% clear on this part. Which applications? If you write code you could connect to the database, pull the data, clean it, then upload it to CAS. You can run that program and it should do that.
Hope this helps. I can create a quick demo program if the video doesn't help.
- Peter
... View more