<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Importing from Excel -- there's got to be an easier way! in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213853#M1711</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza, setting the guessingrows to read the entire file will help in some cases, but not in the case where a variable is char in one file and blank in the other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe no one can solve the algorithm problem, and that's ok. What I don't understand is why basic data cleaning tasks (that must be performed quite often) are so convoluted. For example: In SAS, if I want to rename 80 variables in my dataset, I have to use a rename statement for every single one and have 80 lines of code (or complex macros or code that is beyond many users' understanding). in R, I can set a vector of names to be the names of all of the variables in a dataset with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;names(dat) = var_names or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;names(dat) = read.xls("var_names.xls"). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SAS, if a variable gets imported as character and I want to convert it to a number, I have to input it into a new variable, drop the old variable, and rename the new variable. In R, it's&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dat$var1 = as.numeric(dat$var1) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and character variables are converted to NA values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not saying SAS has to be like R. R has its own annoyances to be sure. But why are these basic tasks so difficult? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Apr 2015 16:16:37 GMT</pubDate>
    <dc:creator>shailey</dc:creator>
    <dc:date>2015-04-01T16:16:37Z</dc:date>
    <item>
      <title>Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213842#M1700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'd like to hear suggestions on easy ways to import excel files with many variables so they can be merged with other imported excel files without getting errors that certain variables are defined as character and numeric. I've read many suggestions in these forums and elsewhere but all seem overly complex to me, so I'm open to new strategies that are simple and efficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More context:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I routinely need to import and merge files from excel. I understand that excel is not a database, and that SAS has to guess the format, and that it uses 8 rows to guess, etc. But this must be a common task, I am surprised that it is so difficult. I feel that the suggestions I've seen on the internet are completely bonkers. Renaming a variable, inputting a new variable with a specified format, dropping the old variable, and then renaming the new variable to the old variable name is an OK solution if you have one variable that is "defined as character and numeric", but when you need to merge 10 files with 80 variables and 15 of them are defined differently (and the differences vary across files) it becomes a hassle. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition to the variable rename technique above I've tried/heard about the following workarounds: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Converting the files to CSV and specifying the format: This is an ok workaround, but it's pretty inconvenient to open each file, save it as a different format, and store two formats of a data set (not to mention if the two data sets have different variable names for the same variable, I would have to go in and change them by hand in excel or write a ton of code to rename, keep, drop, etc. Not appealing for one-time projects). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. A colleague of mine inserts 8 rows of letters for char variables and numbers for num variables and then deletes them after import. Definitely not an appealing option. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. In Excel, manually changing the format of each column and praying that the dbms = xlsx will read them. Again, a hassle with multiple files with long lists of variables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Changing the number of guessing rows: This is fine, but if a variable is blank in one data set, or if there are some variables that have values in rows where others have blanks (and thus can't be sorted such that the values are on top across both variables) then this strategy won't help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the best solution I've come up with so far: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Put each dataset in different tabs in the worksheet. Set the excel file as a library using libname lib excel "&amp;lt;file path&amp;gt;". Use proc contents to export the variable names to a third excel worksheet. Use that list to create a list of individual formats for each variable. Then set the excel datasets to a SAS dataset using dbSAStype for each variable. I think this procedure is very thorough but overly complex. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Today I tried to experiment with the following strategy: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname lib excel "&amp;lt;file-path&amp;gt;"; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;data dat; &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;informat var1 var2 $200.; &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;set lib."dat1$"n lib."dat2"n; &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;run; &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;in dat1, var1 has some character strings, and in dat2, var1 is totally blank. SAS told me me var1 and var2 are defined as character and numeric and wouldn't merge the files. (An aside: Why can't I just change the format of one of the variables? Why can SAS guess that I spelled commands wrong but it can't guess that a variable with digits as characters might be numeric?) &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;There's got to be an easier way! &lt;/SPAN&gt;I understand that Excel isn't ideal but many people use Excel so there must be a simpler way to perform what must be a very common task. I'd really love to hear ideas that might make this procedure simpler. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 19:52:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213842#M1700</guid>
      <dc:creator>shailey</dc:creator>
      <dc:date>2015-03-31T19:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213843#M1701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where did you hear that SAS uses 8 rows to guess?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2015 22:30:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213843#M1701</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-03-31T22:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213844#M1702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My mistake, I guess it's 20 rows. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 01:32:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213844#M1702</guid>
      <dc:creator>shailey</dc:creator>
      <dc:date>2015-04-01T01:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213845#M1703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, you can set it, and generally it can be set to scan the entire file first which helps to resolve a lot of the errors. &lt;/P&gt;&lt;P&gt;Out of curiosity what type of algorithm would you suggest to determine if a column is text/character? And how would you ensure that this is consistent between files where even variable names are not consistent as in your example?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 01:38:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213845#M1703</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-01T01:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213846#M1704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shailey, your note is very clear on the data processing problem. &lt;BR /&gt;The humans working with Excel can make a tremendous of their data. As that is how spreadsheet works (cell oriented) you cannot solve that SAS cannot solve that nobody can solve that. What you have found is a lot of idea-s of people thinking they are solving that.&amp;nbsp; &lt;BR /&gt;There is a strange attitude as we have been educated to solve problems expecting every problem has a solution. Going real there are likely more problems&amp;nbsp; having no solution than there problems having one (may be still unknown). same as R numbers are outnumbering Q&amp;nbsp; en those of I are far more on those.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must have noticed that: the number 1 get right aligned in a cell but the character 1 (type a '1 ) get left aligned and marked with a green corner.&amp;nbsp; There are a lot of Excel fucntions showing the value of 1 as result of some other value. A human will see only a 1 but in reality these are totally different. How would you correct those endless list of possible differences.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 08:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213846#M1704</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-04-01T08:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213847#M1705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have given an apt description why Excel has NO place in Business Intelligence. Except maybe as a simple tool to create (optically) nice output, at the very end of the processing chain.&lt;/P&gt;&lt;P&gt;Using data _from_ Excel is one good example for the acronym GIGO.&lt;/P&gt;&lt;P&gt;What you are experiencing is the same pain that everyone else working with SAS has when "data" comes from a source as unreliable and faulty as Excel.&lt;/P&gt;&lt;P&gt;Part of my income can be described as "payment for somehow making sense out of the crap idiots deliver when they try to be intelligent with seemingly easy-to-use tools".&lt;/P&gt;&lt;P&gt;In other words, don't despair. This is why you get paid the big bucks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 10:12:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213847#M1705</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-01T10:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213848#M1706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a note that these issues are the same no matter what software you use to read in the excel files, R, Python, SAS, SPSS etc...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 11:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213848#M1706</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-01T11:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213849#M1707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data processing and guessing (rows) are not compatible.&amp;nbsp; You want to show you know what you're doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use a scripting language like Power Shell or VBSCRIPT (I've used this one) to do #1 "save the EXCEL sheets to CSV files or other delimited file format.&amp;nbsp; You can find lots of examples of this on the web and here:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/message/128928#128928"&gt;https://communities.sas.com/message/128928#128928&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now all fields are character and you can read each with the proper SAS attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define all the fields as SAS variables in a data set with zero observations.&amp;nbsp; This way you will have complete control over how each field is defined, length and type, to SAS and the INFORMAT used to read it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data all;&lt;/P&gt;&lt;P&gt;&amp;nbsp; stop;&lt;/P&gt;&lt;P&gt;&amp;nbsp; attrib&lt;/P&gt;&lt;P&gt;&amp;nbsp; .....&lt;/P&gt;&lt;P&gt;&amp;nbsp; call missing(of _all_);&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Download my macro from this thread&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/message/210551#210551"&gt;https://communities.sas.com/message/210551#210551&lt;/A&gt;&lt;/P&gt;&lt;P&gt;also discussed here&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/message/245139#245139"&gt;https://communities.sas.com/message/245139#245139&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This macro will use the data set as the the guide for which fields are read and how.&amp;nbsp; The order of fields in the CSV is not important and fields that are not defined by the empty data set are ignored.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 12:40:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213849#M1707</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-04-01T12:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213850#M1708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My solution:&lt;/P&gt;&lt;P&gt;1. Import Excel worksheet with all columns as character by using the MIXED and GETNAMES options. For example:&lt;/P&gt;&lt;P&gt;PROC IMPORT DATAFILE='...'&lt;/P&gt;&lt;P&gt;OUT=rawdata_character&lt;/P&gt;&lt;P&gt;DBMS=EXCEL REPLACE;&lt;/P&gt;&lt;P&gt;SHEET="..."&lt;/P&gt;&lt;P&gt;MIXED=YES;&lt;/P&gt;&lt;P&gt;GETNAMES=NO;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Assuming that the row of column headers is within the guessingrows range this technique will force all columns to be character. The SAS variable names will be F1, F2, F3, ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Note that the formatted value in each cell will be imported. e.g., value=5.1324234, formatted cell=5.13, SAS value=5.13.&lt;/P&gt;&lt;P&gt;3. In data steps find the row containing the column headers (hard code it if it's always the same row), read the headers into SAS macro variables, and loop through the macro variables to create a SAS numeric variable for each column.&amp;nbsp; When reading the row of headers remove special characters in order to produce a valid SAS name. When converting character to numeric (e.g., numeric_name = INPUT(character_name,BEST.) check if the conversion was successful (if character_name NE '' and numeric_name = . then conversion failed) and output unsuccessful conversions to a data file for further investigation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can enhance the data steps to handle issues such as inconsistent column header names by using a crosswalk mapping of each name to a standard name.&lt;/P&gt;&lt;P&gt;Bill.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 14:11:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213850#M1708</guid>
      <dc:creator>Bill_in_Toronto</dc:creator>
      <dc:date>2015-04-01T14:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213851#M1709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;bypasses bypasses assumptions conversions, not seeing something that is a really an easier way&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 14:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213851#M1709</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-04-01T14:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213852#M1710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Beat the users into submission or have them pay for every time they change file layout/content is the only way to make this "easier".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW I have had some of the same issues with data exported from MS SQL Server in CSV format to be read by SQL server because the folks providing the data kept changing schema and such without referring to the documentation. They one time asked why we had a "programming" cost line on our billing for services. We sent them examples of 5 files generated over a period of 10 days that were supposed to have identical layout and content types that had changes in column orders and whether character variables were fully quote qualified or not or "numeric" fields with additional codes or text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 15:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213852#M1710</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-04-01T15:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213853#M1711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reeza, setting the guessingrows to read the entire file will help in some cases, but not in the case where a variable is char in one file and blank in the other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe no one can solve the algorithm problem, and that's ok. What I don't understand is why basic data cleaning tasks (that must be performed quite often) are so convoluted. For example: In SAS, if I want to rename 80 variables in my dataset, I have to use a rename statement for every single one and have 80 lines of code (or complex macros or code that is beyond many users' understanding). in R, I can set a vector of names to be the names of all of the variables in a dataset with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;names(dat) = var_names or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;names(dat) = read.xls("var_names.xls"). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SAS, if a variable gets imported as character and I want to convert it to a number, I have to input it into a new variable, drop the old variable, and rename the new variable. In R, it's&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dat$var1 = as.numeric(dat$var1) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and character variables are converted to NA values. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not saying SAS has to be like R. R has its own annoyances to be sure. But why are these basic tasks so difficult? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:16:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213853#M1711</guid>
      <dc:creator>shailey</dc:creator>
      <dc:date>2015-04-01T16:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213854#M1712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kurt, I am totally on board with this--merging multiple excel files from multiple sources with multiple processes (color coding as a variable indicator?? or notes?? really??) is frustrating and error-prone and illustrates why Excel is not well-suited for data storage. I have to admit, sometimes I do enjoy getting paid to solve these kinds of puzzles. But sometimes I wish I could just convert a variable to numeric without several lines of code. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:22:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213854#M1712</guid>
      <dc:creator>shailey</dc:creator>
      <dc:date>2015-04-01T16:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213855#M1713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, data_null; I will stretch my mind and try to understand these procedures as I can. In the meantime I'm hoping I can find some more straightforward and simple solutions that I know how to use. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:23:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213855#M1713</guid>
      <dc:creator>shailey</dc:creator>
      <dc:date>2015-04-01T16:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213856#M1714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bill, thanks for these thoughts. Can you show me an example of what you mean by reading the headers into a macro variable? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213856#M1714</guid>
      <dc:creator>shailey</dc:creator>
      <dc:date>2015-04-01T16:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213857#M1715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For renaming, if you have a variable mapping list its an easy exercise to create a macro variable that will perform the rename for you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:30:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213857#M1715</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-01T16:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213858#M1716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I personally would forget about guessing with PROC IMPORT or the LIBNAME engine and leave the "BS" others.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:31:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213858#M1716</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-04-01T16:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213859#M1717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza, I will check out using a macro for renaming variables. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:33:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213859#M1717</guid>
      <dc:creator>shailey</dc:creator>
      <dc:date>2015-04-01T16:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213860#M1718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data_null_; I'm not sure what you're saying; do you mean that I should just give up on using SAS if I have to receive files in Excel format? Or that I can't use SAS unless I learn VB? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this is a forum about integrating SAS with Microsoft, and the answer is "don't"? Seems a little user-unfriendly. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213860#M1718</guid>
      <dc:creator>shailey</dc:creator>
      <dc:date>2015-04-01T16:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Importing from Excel -- there's got to be an easier way!</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213861#M1719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the integration with Microsoft Office usually refers to the SAS Product know as Add In for Microsoft Office.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can integrate, the answer is it's not easy, and if you expect it to be you'll be disappointed.&amp;nbsp; If you have different specific questions, such as renaming, changing character types those are more specific and you can probably find more efficient ways of doing things. But for such a generic question the answer is probably avoid Excel - which I think is impossible, personally. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:45:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Importing-from-Excel-there-s-got-to-be-an-easier-way/m-p/213861#M1719</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-01T16:45:39Z</dc:date>
    </item>
  </channel>
</rss>

