Usage Note 63855: Import CSV and other delimited files in SAS® Studio 5.1
SAS Studio 5.1 cannot read files directly from the file system.
When the IMPORT procedure or a FILENAME statement references a CSV or delimited file on the file system, errors that are similar to the following occur:
ERROR: Physical file does not exist,
/opt/sas/viya/config/var/run/compsrv/default/7dbc6b1d-0d47-43b5-ab17-0637d23b5093/c:\temp\mycsv.csv.
ERROR: Import unsuccessful. See SAS Log for details.
There are two methods for successfully importing a delimited file from the local file system. Method 1 uses a CSV file as an example.
Method 1
- Click on the Explorer navigation (the computer icon on the left).
- Expand SAS Content.
- Navigate to the SAS Content folder that you want to upload the file to.
- While the folder name is highlighted, click Upload (with the arrow icon).
- In the Upload Files pop-up window, click the plus sign to add an attachment.
- Navigate to the CSV file on your local file system that you want to upload. Then click Upload.
- After you upload the file, you should see it in the navigation pane within the SAS Content folder that you chose to upload the file to. Right-click the CSV file and choose Create file reference.
- Assign a name for the file reference or accept the default and click OK.
- Use PROC IMPORT or a DATA step to import the file. Use the file reference name that you created in the previous step:
proc import datafile=mycsv out=ds dbms=csv;
run;
Method 2
- Place the files into a shared directory. The folder must be accessible by both the compute server and the SAS® Cloud Analytic Services (CAS) server. A site administrator must create the shared directory.
- A PROC IMPORT step that references the path of the shared directory can then be used to import any CSV or delimited files in that directory.
Note: In SAS Studio 5.1, the files that you access from the shared directory are not visible in the navigation pane.
Operating System and Release Information
SAS System | SAS Studio for Viya | Microsoft® Windows® for x64 | 5.1 | | Viya | |
Linux for x64 | 5.1 | | Viya | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
For SAS Studio 5.1, delimited files must be in a folder in the SAS Content area or placed in a shared drive that is available to the CAS server. Otherwise, you see "Physical file does not exist" or "Import unsuccessful" errors when you use PROC IMPORT or a FILENAME statement to read the file.
Date Modified: | 2019-08-13 09:16:57 |
Date Created: | 2019-03-15 11:28:02 |