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

Why does Proc IMPORT keep processing an old data file even after uploading new data file and revising the file specs? No matter how many times I coaxed the Proc IMPORT, it kept processing (verified via proc print) the older file. How do I flush out the old data fle so that a new data can be treated by a subsequent macro program?  Before running the new PROC IMPORT, I usually  comment out the first PROC IMPORT. I assume this is enough but is it? Sometimes, I even quit SAS and come back to it but I still get the same result.

 

Note: I run the PROC IMPORT in SAS Studio under SAS On Demand for Academics.  All data files I referred to above were uploaded to the SAS server.

 

Here are the 2 PROC IMPORT snippets that I used. The only item that I changed was the data filename.

1. 1st PROC IMPORT

PROC IMPORT OUT= LINXT1
DATAFILE= "/home/u49732661/myData/LINXT1.xls"
DBMS=xls REPLACE;
GETNAMES=YES;
proc print;
RUN;

 

2. 2nd PROC IMPORT - RUN AFTER COMMENTING OUT THE 1ST PROC IMPORT. 

PROC IMPORT OUT= LINXT5
DATAFILE= "/home/u49732661/myData/LINXT5.xls"
DBMS=xls REPLACE;
GETNAMES=YES;
proc print;
RUN;

 

Thank you for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
RTO1944
Fluorite | Level 6

I am very sorry about this issue...my bad.  Let me just admit that I blew the whistle too soon.

 

I tried to recapture the error but couldn't so it must have been a wrong folder spec that I supplied because when I supply the right ones to PROC IMPORT, I get the correct data. No problem there.

 

My only "beef"  on this issue >> when I err giving the correct folder location, SAS still processes the previous PROC IMPORT file that is stored in the WORK folder.  I agree that this calls for users to be wary and to always check the LOG  which, in this occasion,  gives "physical file does not exist...." error. An unsuspecting or careless user might just ignore or miss checking the LOG file and could be well off the right track, especially if the new data file has similar specs as the 1st.  I think it is better if SAS does not process the file in the temp WORK folder once the "physical file does not exist" error is detected.  Just my thought.

 

Thank you all for your help. 

View solution in original post

7 REPLIES 7
PaigeMiller
Diamond | Level 26

Please show us the LOG for these two runs of PROC IMPORT. We need to see the ENTIRE (i.e. all, every single line, 100%, nothing chopped out, including code, NOTEs, ERRORs and WARNINGs) for each run of PROC IMPORT.

 

Please copy the log as text and paste it into the window that appears when you click on the </> icon. DO NOT SKIP THIS STEP.

--
Paige Miller
RTO1944
Fluorite | Level 6
OK, I will recapture the problem and post the LOG of each PROC IMPORT run as soon as I can. Thanks.
RTO1944
Fluorite | Level 6

I am very sorry about this issue...my bad.  Let me just admit that I blew the whistle too soon.

 

I tried to recapture the error but couldn't so it must have been a wrong folder spec that I supplied because when I supply the right ones to PROC IMPORT, I get the correct data. No problem there.

 

My only "beef"  on this issue >> when I err giving the correct folder location, SAS still processes the previous PROC IMPORT file that is stored in the WORK folder.  I agree that this calls for users to be wary and to always check the LOG  which, in this occasion,  gives "physical file does not exist...." error. An unsuspecting or careless user might just ignore or miss checking the LOG file and could be well off the right track, especially if the new data file has similar specs as the 1st.  I think it is better if SAS does not process the file in the temp WORK folder once the "physical file does not exist" error is detected.  Just my thought.

 

Thank you all for your help. 

RTO1944
Fluorite | Level 6
Hmm. I can't understand what you mean. They are 2 different Excel datafiles that are called by different PROC IMPORT. Like I said, I commented out the 1st proc import before running the 2nd. I assume (but being new to SAS, I am not so sure) that commenting out the ist proc import should not influence the 2nd. Is this correct?
Kurt_Bremser
Super User

When your LINXT5 dataset contains the same data as your LINXT1 dataset, then the input for both IMPORT steps must have been identical. This is most probably caused by an accidental overwrite of LINXT5.xlsx with the data of LINXT1.xlsx. It only takes a careless click in Excel.

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
  • 7 replies
  • 586 views
  • 1 like
  • 3 in conversation