<?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 quick &amp; dirty way to cut &amp; paste data from excel into SAS editor? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/quick-dirty-way-to-cut-paste-data-from-excel-into-SAS-editor/m-p/176670#M33842</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to run Chi-squared tests on a series of small datasets contained in Excel spreadsheets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an easy way to simply cut and paste the cells containing the data from Excel directly into a data input statement in the SAS editor?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm running into formatting issues with tabs and character length formats. I've tried copying &amp;amp; pasting the data from Excel to Notepad first, then copying from Notepad to the SAS editor, but no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example of inpatient count data listed by hospital in an Excel spreadsheet:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 581px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl67" height="121" width="269"&gt;PROVIDER&lt;/TD&gt;&lt;TD class="xl65" width="78"&gt;Q1Q2_2011_denom&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none;" width="78"&gt;Q1Q2_2011_numer&lt;/TD&gt;&lt;TD class="xl65" width="78"&gt;Q3Q4_2013_denom&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none;" width="78"&gt;Q3Q4_2013_numer&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;CAPITAL_CITY_HOSPITAL&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;102&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;321&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;ST_PAULS&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;129&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;8&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;253&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;UNIVERSITY_MEDICAL_CENTER&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;95&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;7&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;162&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which I want to cut &amp;amp; paste into SAS as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; hospital_data;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; PROVIDER &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal;"&gt;$50.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; Q1Q2_2011_denom Q1Q2_2011_numer Q3Q4_2013_denom Q3Q4_2013_numer;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black;"&gt;CAPITAL_CITY_HOSPITAL 102&amp;nbsp; 4&amp;nbsp; 321&amp;nbsp; 7&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black;"&gt;ST_PAULS 129&amp;nbsp; 8&amp;nbsp; 253&amp;nbsp; 9&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black;"&gt;UNIVERSITY_MEDICAL_CENTER 95&amp;nbsp; 7&amp;nbsp; 162&amp;nbsp; 16&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the output data in hospital_data lumps the provider name and the inpatient count data together under PROVIDER and leaves a blank in the &lt;A _jive_internal="true" href="https://communities.sas.com/mailto:Q!Q@_2011/"&gt;Q1Q2_2011&lt;/A&gt;_denom column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts how to expedite quick &amp;amp; dirty cut and pastes from Excel to SAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Jan 2015 20:12:15 GMT</pubDate>
    <dc:creator>RobF</dc:creator>
    <dc:date>2015-01-09T20:12:15Z</dc:date>
    <item>
      <title>quick &amp; dirty way to cut &amp; paste data from excel into SAS editor?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quick-dirty-way-to-cut-paste-data-from-excel-into-SAS-editor/m-p/176670#M33842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to run Chi-squared tests on a series of small datasets contained in Excel spreadsheets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an easy way to simply cut and paste the cells containing the data from Excel directly into a data input statement in the SAS editor?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm running into formatting issues with tabs and character length formats. I've tried copying &amp;amp; pasting the data from Excel to Notepad first, then copying from Notepad to the SAS editor, but no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example of inpatient count data listed by hospital in an Excel spreadsheet:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 581px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl67" height="121" width="269"&gt;PROVIDER&lt;/TD&gt;&lt;TD class="xl65" width="78"&gt;Q1Q2_2011_denom&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none;" width="78"&gt;Q1Q2_2011_numer&lt;/TD&gt;&lt;TD class="xl65" width="78"&gt;Q3Q4_2013_denom&lt;/TD&gt;&lt;TD class="xl66" style="border-left: medium none;" width="78"&gt;Q3Q4_2013_numer&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;CAPITAL_CITY_HOSPITAL&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;102&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;321&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;ST_PAULS&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;129&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;8&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;253&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;UNIVERSITY_MEDICAL_CENTER&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;95&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;7&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;162&lt;/TD&gt;&lt;TD align="right" class="xl68"&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which I want to cut &amp;amp; paste into SAS as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; hospital_data;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; PROVIDER &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal;"&gt;$50.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; Q1Q2_2011_denom Q1Q2_2011_numer Q3Q4_2013_denom Q3Q4_2013_numer;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black;"&gt;CAPITAL_CITY_HOSPITAL 102&amp;nbsp; 4&amp;nbsp; 321&amp;nbsp; 7&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black;"&gt;ST_PAULS 129&amp;nbsp; 8&amp;nbsp; 253&amp;nbsp; 9&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: #ffffc0; color: black;"&gt;UNIVERSITY_MEDICAL_CENTER 95&amp;nbsp; 7&amp;nbsp; 162&amp;nbsp; 16&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the output data in hospital_data lumps the provider name and the inpatient count data together under PROVIDER and leaves a blank in the &lt;A _jive_internal="true" href="https://communities.sas.com/mailto:Q!Q@_2011/"&gt;Q1Q2_2011&lt;/A&gt;_denom column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts how to expedite quick &amp;amp; dirty cut and pastes from Excel to SAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 20:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quick-dirty-way-to-cut-paste-data-from-excel-into-SAS-editor/m-p/176670#M33842</guid>
      <dc:creator>RobF</dc:creator>
      <dc:date>2015-01-09T20:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: quick &amp; dirty way to cut &amp; paste data from excel into SAS editor?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quick-dirty-way-to-cut-paste-data-from-excel-into-SAS-editor/m-p/176671#M33843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add a colon before the informat $50.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 12.8000001907349px; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.8000001907349px; font-family: 'Courier New'; color: black; background: white;"&gt; PROVIDER &lt;SPAN style="color: #800000;"&gt;:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.8000001907349px; font-family: 'Courier New'; color: teal; background: white;"&gt;$50.&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.8000001907349px; font-family: 'Courier New'; color: black; background: white;"&gt; Q1Q2_2011_denom Q1Q2_2011_numer Q3Q4_2013_denom Q3Q4_2013_numer;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.8000001907349px; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.8000001907349px; font-family: 'Courier New'; color: black; background: white;"&gt;That way you will be reading PROVIDER with &lt;EM&gt;formatted list&lt;/EM&gt; input, i.e. the input field will end at the first space encountered.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.8000001907349px; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.8000001907349px; font-family: 'Courier New'; color: black; background: white;"&gt;PG&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 03:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quick-dirty-way-to-cut-paste-data-from-excel-into-SAS-editor/m-p/176671#M33843</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-01-10T03:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: quick &amp; dirty way to cut &amp; paste data from excel into SAS editor?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quick-dirty-way-to-cut-paste-data-from-excel-into-SAS-editor/m-p/176672#M33844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might find some useful code at: &lt;A href="http://www.sascommunity.org/wiki/Copy_and_Paste_from_Excel_to_SAS" title="http://www.sascommunity.org/wiki/Copy_and_Paste_from_Excel_to_SAS"&gt;Copy and Paste from Excel to SAS - sasCommunity&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 03:48:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quick-dirty-way-to-cut-paste-data-from-excel-into-SAS-editor/m-p/176672#M33844</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-01-10T03:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: quick &amp; dirty way to cut &amp; paste data from excel into SAS editor?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quick-dirty-way-to-cut-paste-data-from-excel-into-SAS-editor/m-p/176673#M33845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, I've also found that cutting and pasting data from Excel into this editor window for a new SAS Discussion question automatically formats the data. I can then cut paste from the editor window directly into a data step &amp;amp; SAS creates a correctly formatted dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data hospital_data;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; provider &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: teal;"&gt;$50.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt; PROVIDER $ Q1Q2_2011_denom Q1Q2_2011_numer Q3Q4_2013_denom Q3Q4_2013_numer;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;…&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 14:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quick-dirty-way-to-cut-paste-data-from-excel-into-SAS-editor/m-p/176673#M33845</guid>
      <dc:creator>RobF</dc:creator>
      <dc:date>2015-01-10T14:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: quick &amp; dirty way to cut &amp; paste data from excel into SAS editor?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quick-dirty-way-to-cut-paste-data-from-excel-into-SAS-editor/m-p/176674#M33846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Personally I just copy and paste and then issue a change command to change the tabs to |.&lt;/P&gt;&lt;P&gt;Then in the DATA step add an INFILE statement to let SAS know to use DSD option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input cards dsd dlm='|' truncover;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 23:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quick-dirty-way-to-cut-paste-data-from-excel-into-SAS-editor/m-p/176674#M33846</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-01-10T23:14:35Z</dc:date>
    </item>
  </channel>
</rss>

