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)*/
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.
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.