BookmarkSubscribeRSS Feed
Leah088
Calcite | Level 5

Hi there. I'm a first time user on a HP laptop (not sure if this could be relevant). 

 

I want to run the command:

DATA X;
INFILE '____';

 But I cant seem to find a command that works, or a place to store the file in which it can be read. I've tried going deep into my files searching for SASUniversityEdition but it doesn't exist. I've tried making the files myself and copying the directory but that doesn't work. 

 

I have no idea where the files are actually saved on my laptop at all because i cant find them, and the file called 'sas' on my laptop somehow loops onto itself?

 

I'm very confused, I just want it to read a text file 😅

11 REPLIES 11
Shmuel
Garnet | Level 18

INFILE is just declaring the input file. Its syntax is

    infile "<full path><file name>"   <options>;

You better check the sas documentation for INPUT.

 

To read a record you need INPUT statement, something like

   input  <list of variable names>;

 

As some variables are alphanumeric, other are numeric - dates, integers, real number etc. - you need to assign type and INFORMAT of the variables.

 

Search for examples in the documentation.

Kurt_Bremser
Super User

When you set up University Edition, you defined the shared folder. Files need to be put there for UE to read them, and files need to be created there by your programs so you can fetch them back to the "outside".

The internal path (UE is a virtual Linux machine, containing a miniature SAS BI Server) is /folders/myfolders.

 

Please post complete logs from steps that fail (code and messages); use the button indicated to copy/paste the log into the proper communities sub-window:

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

Leah088
Calcite | Level 5

Is there a way to see which file was selected as the shared one? 

 

I'm sorry for not posting the whole thing the first time. 

73         DATA FUNGAL;
 74         INFILE 'C:/fungal.txt' FIRSTOBS=2 EXPANDTABS;
 75         INPUT PATNO TREAT $ AGE SEX $ SEVERITY CLEARS;
 76         RUN;
 
 ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/C:/fungal.txt.
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set WORK.FUNGAL may be incomplete.  When this step was stopped there were 0 observations and 6 variables.
 WARNING: Data set WORK.FUNGAL was not replaced because this step was stopped.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds

This is what I tried to do, is it typed out correctly?

Shmuel
Garnet | Level 18

What sas platform are you using?

 

It seems that you are running SAS installed on a unix (or linux)  server from windows.

You need to move your file from C:\ to some predefined folder depending on your sas platform.

Leah088
Calcite | Level 5

How would I find what the predefined folder is?

 

I'm not 100% sure which platform it is, it says SAS Studio on the tab and I downloaded SAS University Edition. 

 

I also tried looking for the file names that it said in the error message, but no files under that name could be found on my laptop when I did a search. 

Shmuel
Garnet | Level 18

So you are using SAD UE (University edition) as I do.

 

The shared folder need be assigned as:  C:\SASUniversityEdition\myfolders or on any other device.

The path used in a sas program is /folders/myfolders  with any subfolder in above directory.

 

for example:

     filename source "/folders/myfolders/source/myprog.sas";     or

     infile "/folders/myfolders/rowdata/csv_file.csv";

 

 

Kurt_Bremser
Super User

IF you followed the instructions for setting up University Edition correctly, you will have a folder in your Windows called SASUniversityEdition with a subfolder myfolders. This is represented within UE as /folders/myfolders.

Store your text file there, and use

/folders/myfolders/fungal.txt

as the name of your INFILE.

Leah088
Calcite | Level 5

I have a file called 'sas' but no 'SASUniversityEdition'

 

The 'sas' folder contains 'simstudioconfig' and inside of that 'spawner' and 'workspaceserver'. 

 

Does this sound like anything?

 

If I didn't set it up correctly is there a way to re-configure it or something?

Tom
Super User Tom
Super User

To run SAS UE you had to install it into a virtual machine. It is the in the setup of the virtual machine that you set the location on your Windows machine that is shared.  So check the setting in that software.

 

For a small file you can use use the SAS/Studio interface to "upload" the file.

image.png

Leah088
Calcite | Level 5

Ah thank you for the VM suggestion, I found the 'SASUniversityEdition' file after rooting around in there for a while. 

 

Still no 'myfolders' though, only 'Logs' and 'snapshot' folders are in there. Is this the right one or no?

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 11 replies
  • 1647 views
  • 0 likes
  • 4 in conversation