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

Hello,

 

i have two SAS Viya modules which are SAS® Visual Data Mining and Machine Learning and SAS® Visual Analytics and my storage is at 'my folder'. I unable to import csv file from my local disk and i checked that the csv file that i want to import is in the path that i write in the code. I able to upload it in SAS University Edition but i enable to upload it with the use of SAS Viya. Here is the log, 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
75
76
77
78 /** FOR CSV Files uploaded from Windows **/
79
80 FILENAME CSV "C:\Users\user\Desktop\SASUniversityEdition\myfolders\Testing2.csv" TERMSTR=CRLF;
81
82 /** Import the CSV file. **/
83
84 PROC IMPORT DATAFILE=CSV
85 OUT=WORK.MYCSV
86 DBMS=CSV
87 REPLACE;
88 RUN;
NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
WARNING: Physical file does not exist,
/opt/sas/viya/config/var/run/compsrv/default/a06c76f7-1bec-4f6e-aa80-12f984a485f1/C:\Users\user\Desktop\SASUniversityEdition\myfolde
rs\Testing2.csv.
ERROR: Import unsuccessful. See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.05 seconds
cpu time 0.09 seconds
 
89
90 /** Print the results. **/
91
92 PROC PRINT DATA=WORK.MYCSV; RUN;
ERROR: File WORK.MYCSV.DATA does not exist.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
93
94 /** Unassign the file reference. **/
95
96 FILENAME CSV;
NOTE: Fileref CSV has been deassigned.
97
98
99 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
112
 
1 ACCEPTED SOLUTION
9 REPLIES 9
ChrisNZ
Tourmaline | Level 20

One thing is certain:

The file

/opt/sas/viya/config/var/run/compsrv/default/a06c76f7-1bec-4f6e-aa80-12f984a485f1/C:\Users\user\Desktop\SASUniversityEdition\myfolders\Testing2.csv.

does not exist.

You are mixing a unix path (in blue) and a windows path (in red).

Where is your file?

 

Note that this evidence is also what the log reads unambiguously:

WARNING: Physical file does not exist

 

 

 

Kurt_Bremser
Super User

Your Viya runs on a UNIX system, using Windows names will not work.

You need to upload your file to the Viya system first, so the SAS process running there has access to it.

Doesn't the interface provide a means for uploading?

SungPing
Calcite | Level 5

Annotation 2020-03-27 191708.png

 Annotation 2020-03-27 1917081.png

Yes, there is an upload button between the three dots and the delete button. I uploaded the file and insert the file path into the codes below

FILENAME CSV "/Users/MY035/My Folder/Testing1.csv" TERMSTR=LF;

/** Import the CSV file. **/

PROC IMPORT DATAFILE=CSV
OUT=WORK.MYCSV
DBMS=CSV
REPLACE;
RUN;

/** Print the results. **/

PROC PRINT DATA=WORK.MYCSV; RUN;

/** Unassign the file reference. **/

FILENAME CSV;

 

and

 

FILENAME CSV "/Users/MY035/My Folder/Testing1.csv" TERMSTR=CRLF;


PROC IMPORT DATAFILE=CSV
OUT=WORK.MYCSV
DBMS=CSV
REPLACE;
RUN;

/** Print the results. **/

PROC PRINT DATA=WORK.MYCSV; RUN;

/** Unassign the file reference. **/

FILENAME CSV;

 

But both codes showed the same results, it still cannot. 

 

SungPing
Calcite | Level 5
1     OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
75    
76    FILENAME CSV "/Users/MY035/My Folder/Testing1.csv" TERMSTR=CRLF;
77    
78    
79    PROC IMPORT DATAFILE=CSV
80        OUT=WORK.MYCSV
81        DBMS=CSV
82        REPLACE;
83    RUN;
NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to 
WORK.PARMS.PARMS.SLIST.
WARNING: Physical file does not exist, /Users/MY035/My Folder/Testing1.csv. 
ERROR: Import unsuccessful.  See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.06 seconds
      cpu time            0.10 seconds
      
84    
85    /** Print the results. **/
86    
87    PROC PRINT DATA=WORK.MYCSV; RUN;
ERROR: File WORK.MYCSV.DATA does not exist.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      
88    
89    /** Unassign the file reference.  **/
90    
91    FILENAME CSV;
NOTE: Fileref CSV has been deassigned.
92    
93    
94    OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
107   
Tom
Super User Tom
Super User
With VIYA you need to define a filename using their special filename engine to be able to find the file. I don't remember the syntax since I don't use VIYA, but this question has been asked and answered on this forum before.
ChrisNZ
Tourmaline | Level 20

@ChrisHemedinger Should there be a Viya programming community? The SAS language is different.

ChrisHemedinger
Community Manager

Hi @ChrisNZ - it's true that there are new elements in SAS Viya (especially with CAS actions and specific procedures in CAS).  But most existing SAS code (including PROC IMPORT) can work in a SAS Viya environment.  This is especially true in SAS Viya 3.5 and later.

 

So, I'm not opposed to a SAS Viya (or CAS) board...but I don't want to fragment discussions if we don't need to.  New users who are working in SAS Viya can benefit from the expertise of all of those contributing general SAS programming solutions.

Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 9 replies
  • 877 views
  • 3 likes
  • 5 in conversation