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.
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.
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.
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.
That is why Maxim 2 is so high up on the list. It was one of the first 4 Maxims that came to my mind when I got the idea.
Are you absolutely sure that LINXT5.xls was not accidentally overwritten with the contents of LINXT1.xls?
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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.