BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Obsidian | Level 7

Hello all, 


I am using SAS Studio 5.1 (VIYA release V.03.04). 


I am very new to VIYA programming and am trying to import a CSV file from my desktop into my CAS library so that I can manipulate it in SAS VIYA studio and then push it to SAS VIYA Visual Analytics. I know how to import it through Visual Analytics for use in Studio, but not the other way around.


At the moment, the only way I can figure out how to do this is to import a file manually using Explorer > Upload file.

However, this places the CSV in Explorer > SAS Content (rather than > Libraries), so I then have to use PROC IMPORT to import it from SAS Content into my CAS session and then use PROC CASUTIL to promote it for use throughout VIYA.


Also, I cannot for the life of me get Studio to recognise file paths, so have to manually point-and-click to create a file reference to do the PROC IMPORT. I've tried searching for help, but everything I have found so far seems to discuss how to move things from the libraries section into CAS, but everything I import is first stuck in SAS Content.


I'm sure it's something very obvious for someone in the know, but can anyone point me in the right direction or am I doomed forever?

I've included my hack job of the code below in case it helps. Thanks in advance!


/*MANUAL ACTION - need to create a file reference 'testing' by right-clicking on the file because can't seem to find the right file path*/

/** Import the CSV file from SAS content into the public cas session.  **

/** Unassign the file reference.  **/

FILENAME testing;

/** Print the results. **/


/*IT SUPPORT Q - Why can it print the table but I can't open it and see it through drag and drop?*/

/*Checking the Promoted Table to see if the mycsv table is global_promoted It isn't*/

proc casutil;
     list tables incaslib="public";

/*Because it's not promoted - I need to promote it*/

proc casutil;
     promote casdata="MYCSV"
     Incaslib="PUBLIC" Outcaslib="PUBLIC" CASOUT="MYCSV";

/*Rechecking to see if the Promoted Table to see if the mycsv table is global/promoted - It is.*/

proc casutil;
     list tables incaslib="PUBLIC";

/*Should now be accessible through Explore and Visualise Data (can sometimes take a few minutes)*/

Accepted Solutions
SAS Employee

Sorry I don't know enough to give an in-depth response but there are two ways to do that and first you already found. The other way is in this article.

View solution in original post


In most environments i know accessing a users desktop via code is not possible, because it would require that the server executing the sas-code has access to the computer.

Obsidian | Level 7
Hi Andreas, thanks for replying, yes that does make sense. So, do most people just import via the Visual Analytics component then? Or upload all there data via an admin through the environment manager/admin component? Because then they would all be located in Studios SAS libraries section (if promoted)? And how do they get around the file size limits? I have so many questions and I find it difficult to find a lay person-level instructions for VIYA. Perhaps I'll go right back to the start and try to get a good handle on VIYA architecture.
SAS Employee

Sorry I don't know enough to give an in-depth response but there are two ways to do that and first you already found. The other way is in this article.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 3 in conversation