BookmarkSubscribeRSS Feed
almmotamedi
Obsidian | Level 7

Hi,

 

I am trying to import two different csv files at once into my SAS processflow. The physical addresses are correct on my computer, but I get the error. Could you please help?

 

filename two ('P:\0773\SCOPES\CSV\2015\Oct-08-2015\ScopesCalculations_SecondaryConstruction_ 01_10092015_1158.csv'
'P:\0773\SCOPES\CSV\2015\Oct-08-2015\ScopesCalculations_ScopesCalculations_SecondaryConstruction_ 02_10092015_1219.csv');

 

data test;
infile two;
run;

 

proc print data = test;
run;

13 REPLIES 13
Reeza
Super User

Post your error.

 

Common reasons: its an error in your path, or you're working on a server and your server can't see your computer.

Are you working on either EG or SAS UE or On Demand?

 

Your code isn't correct either - you need an input statement in your data step to import data. All you've created at this point is a connection to the file, but you haven't tried to use it anywere?

almmotamedi
Obsidian | Level 7

This is the ERROR:

 

ERROR: Physical file does not exist,
/sasdata/data/sasconfig_grid/Lev1/SASMain/P:\0773\SCOPES\CSV\2015\Oct-08-2015\ScopesCalculations_SecondaryConstruction_
01_10092015_1158.csv.

 

I am using EG

 

Should I use "INPUT" statement to mention all the variables in the dataset(s)?

 

Thanks for help

ballardw
Super User

The path shown, with the change from / to \, indicates you likely are connecting to a unix based server  and that the server does not have any set up to read your locally defined P drive.

LinusH
Tourmaline | Level 20

You are confusing the path you can see from your Windows client.

SAS Server ( a grid in this situation) accesses data with paths relative to the UNIX/Linux server.

Data never sleeps
Reeza
Super User

As mentioned it looks like you're on a server.

 

Your options are:

 

  1. Determine if your server can see your local machine, may need to ask IT. This is unlikely.
  2. Move your file to the server - either FTP/SFTP or a custom EG Task http://blogs.sas.com/content/sasdummy/2012/12/06/copy-files-in-sas-eg/
  3. Use Import Data wizard from EG instead of import via code.

 

 

almmotamedi
Obsidian | Level 7
I see. However, how is it possible that the server can find my local machine through the "Import Data Wizard"? but not using the code?

The problem of using the wizard is that I actually need to import not only two files (this is just a test), but about 50 files at once.

Thank you
LinusH
Tourmaline | Level 20

If you wish to this by code (and perhaps regularly), try to find away to place your files at a location where your server SAS session can access them. Talk to your server adm for assistance.

Data never sleeps
almmotamedi
Obsidian | Level 7
Thank you. I just did
Reeza
Super User

Code is passed to the server, the GUI is a different implementation and runs locally and uploads to the server.

 

If you can run locally (sometimes there's an option) then you can use your code locally. In EG 4.3 there's a Selected Server window. Click that to see what your options may be.

 

Also, do you see Local listed under your Servers option?

almmotamedi
Obsidian | Level 7

I am not sure if I get this part of your answer "When clicking run there's a little drop down menu. Click that to see what your options may be." Are you talking about the "Import Data Wizard"?

 

Is it possible to use this wizard to import more than one file at once?

 

Thakns

Reeza
Super User

Do all of your files have the same structure?

 

I mistyped, the server connection is shown below. Do you see a Local option?

You can also see the little down arrow by run, if you click that it shows several RUN options, but not what I was intending to reference. 

 

Delete Server Select.JPG

almmotamedi
Obsidian | Level 7

Yes, they have the same structure.

 

But it seems that my server cannot read the local machine this way (I contacted the server admin)

 

1.jpg

 

 

almmotamedi
Obsidian | Level 7

No, that I got connected to the local machine, it seems that the "filename" statement is fine. But, there should be something wrong with the "data" statement. Could you please advise?

 

 

filename two ("/v_share/Xiaomin/SCOPES/sas_dataset/Oct-08-2015/ScopesCalculations_SecondaryConstruction_ 01_10092015_1158.csv"
"/v_share/Xiaomin/SCOPES/sas_dataset/Oct-08-2015/ScopesCalculations_ScopesCalculations_SecondaryConstruction_ 02_10092015_1219.csv");

 

data test;
infile two;
INPUT C_ST;
run;

 

 

 

ERROR: 

 

/v_share/Xiaomin/SCOPES/sas_dataset/Oct-08-2015/ScopesCalculations_ScopesCalculations_SecondaryConstruction_
02_10092015_1219.csv.
FATAL: Unrecoverable I/O error detected in the execution of the DATA step program. Aborted during the EXECUTION phase.

 

Thank you

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 13 replies
  • 1950 views
  • 0 likes
  • 4 in conversation