Hi
I am running the following code from Programming 1.
I changed the datafile to file, the result seems to be exact the same.
is there any difference between DATAFILE and FILE?
What does the log say when you use FILE= in place of DATAFILE=?
So it is a working, undocumented statement; I suspected that SAS might have written something to the log like "erroneous FILE option interpreted as DATAFILE".
here are the two logs, I can't see any difference.
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 70 71 proc import file="/home/u62043935/EPG1V2/data/eu_sport_trade.xlsx" 72 dbms=xlsx 73 out=eu_sport_trade 74 replace; 75 run; NOTE: One or more variables were converted because the data type is not supported by the V9 engine. For more details, run with options MSGLEVEL=I. NOTE: The import data set has 6816 observations and 6 variables. NOTE: WORK.EU_SPORT_TRADE data set was successfully created. NOTE: PROCEDURE IMPORT used (Total process time): real time 0.40 seconds user cpu time 0.40 seconds system cpu time 0.00 seconds memory 3210.25k OS Memory 30632.00k Timestamp 15/10/2022 09:21:09 PM Step Count 24 Switch Count 2 Page Faults 0 Page Reclaims 944 Page Swaps 0 Voluntary Context Switches 19 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1032 76 77 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 88
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 70 71 proc import datafile="/home/u62043935/EPG1V2/data/eu_sport_trade.xlsx" 72 dbms=xlsx 73 out=eu_sport_trade 74 replace; 75 run; NOTE: One or more variables were converted because the data type is not supported by the V9 engine. For more details, run with options MSGLEVEL=I. NOTE: The import data set has 6816 observations and 6 variables. NOTE: WORK.EU_SPORT_TRADE data set was successfully created. NOTE: PROCEDURE IMPORT used (Total process time): real time 0.39 seconds user cpu time 0.39 seconds system cpu time 0.00 seconds memory 3178.87k OS Memory 30888.00k Timestamp 15/10/2022 09:22:25 PM Step Count 30 Switch Count 4 Page Faults 0 Page Reclaims 618 Page Swaps 0 Voluntary Context Switches 34 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 1032 76 77 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 88
FILE is an Alias for DATAFILE - but if you look into a current SAS documentation you only find DATAFILE so use this name.
SAS is highly backward compatible and therefore many things still work even though you might no more find it documented for newer versions.
SAS EG shows me the following:
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.