BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Count
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.  **
PROC IMPORT DATAFILE=TESTING
		    OUT=pubcas.MYCSV
		    DBMS=CSV
		    REPLACE;
RUN;

/** Unassign the file reference.  **/

FILENAME testing;

/** Print the results. **/

PROC PRINT DATA=pubcas.MYCSV; 
RUN;

/*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";
run;

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

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

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

proc casutil;
     list tables incaslib="PUBLIC";
run;

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

Accepted Solutions
alexdelara
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.


https://support.sas.com/kb/63/855.html

View solution in original post

3 REPLIES 3
andreas_lds
Jade | Level 19

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.

Count
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.
alexdelara
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.


https://support.sas.com/kb/63/855.html

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 5299 views
  • 0 likes
  • 3 in conversation