<?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: Import data and add a new variable in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Import-data-and-add-a-new-variable/m-p/488017#M25321</link>
    <description>&lt;P&gt;It looks like you're using IML - that isn't my forte so I'd suggest you move that to an IML forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some short cut references that may help:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/09/28/create-test-matrices.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2015/09/28/create-test-matrices.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it was a data step it would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    do Row_Number=1 to 100;
        constant=1;
        x=rand('integer', 5, 10);
        *create a random number between 5 and 10;
        output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 18 Aug 2018 19:07:16 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-08-18T19:07:16Z</dc:date>
    <item>
      <title>Import data and add a new variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Import-data-and-add-a-new-variable/m-p/487072#M25260</link>
      <description>&lt;P&gt;I am starting to work with SAS and I would like you to please help me resolve the following questions.&lt;/P&gt;
&lt;P&gt;How do I transform an imported database from Excel into a matrix?&lt;BR /&gt;How can I add a column vector of ones?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 18:59:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Import-data-and-add-a-new-variable/m-p/487072#M25260</guid>
      <dc:creator>alix1</dc:creator>
      <dc:date>2018-08-15T18:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Import data and add a new variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Import-data-and-add-a-new-variable/m-p/487135#M25262</link>
      <description>&lt;P&gt;Are you planning to work with SAS/IML or with base programming?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're using Base Programming here are some instructions on how to import your data and to create a new column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Import a CSV file&lt;/P&gt;
&lt;P&gt;&lt;A href="https://video.sas.com/detail/videos/sas-analytics-u/video/4573016758001/creating-a-sas-table-from-a-csv-file" target="_blank"&gt;https://video.sas.com/detail/videos/sas-analytics-u/video/4573016758001/creating-a-sas-table-from-a-csv-file&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Import an Excel file&lt;/P&gt;
&lt;P&gt;&lt;A href="https://video.sas.com/detail/video/4664358166001/using-the-import-data-utility-in-sas-studio" target="_blank"&gt;https://video.sas.com/detail/video/4664358166001/using-the-import-data-utility-in-sas-studio&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new column&lt;/P&gt;
&lt;P&gt;&lt;A href="https://video.sas.com/detail/videos/sas-analytics-u/video/4573023399001/creating-a-new-column-in-sas" target="_blank"&gt;https://video.sas.com/detail/videos/sas-analytics-u/video/4573023399001/creating-a-new-column-in-sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're trying to do this via IML which is more similar to R/Python and matrices/arrays in mathematics, then you would first import your data and then load it into a matrix.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/224593"&gt;@alix1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am starting to work with SAS and I would like you to please help me resolve the following questions.&lt;/P&gt;
&lt;P&gt;How do I transform an imported database from Excel into a matrix?&lt;BR /&gt;How can I add a column vector of ones?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 19:03:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Import-data-and-add-a-new-variable/m-p/487135#M25262</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-15T19:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: Import data and add a new variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Import-data-and-add-a-new-variable/m-p/488010#M25319</link>
      <description>Thanks for your help.&lt;BR /&gt;I would like to know how I do to build a vector that contains a one and a&lt;BR /&gt;random value of a uniform distribution. I tried to do it in the following&lt;BR /&gt;way, but it generates an error.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc iml;&lt;BR /&gt;x={1 RAND("UNIFORM")};&lt;BR /&gt;print x;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Aug 2018 17:42:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Import-data-and-add-a-new-variable/m-p/488010#M25319</guid>
      <dc:creator>alix1</dc:creator>
      <dc:date>2018-08-18T17:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Import data and add a new variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Import-data-and-add-a-new-variable/m-p/488017#M25321</link>
      <description>&lt;P&gt;It looks like you're using IML - that isn't my forte so I'd suggest you move that to an IML forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some short cut references that may help:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2015/09/28/create-test-matrices.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2015/09/28/create-test-matrices.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it was a data step it would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    do Row_Number=1 to 100;
        constant=1;
        x=rand('integer', 5, 10);
        *create a random number between 5 and 10;
        output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Aug 2018 19:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Import-data-and-add-a-new-variable/m-p/488017#M25321</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-18T19:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Import data and add a new variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Import-data-and-add-a-new-variable/m-p/488032#M25323</link>
      <description>&lt;P&gt;Thank you, your help is very useful.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Aug 2018 00:07:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Import-data-and-add-a-new-variable/m-p/488032#M25323</guid>
      <dc:creator>alix1</dc:creator>
      <dc:date>2018-08-19T00:07:38Z</dc:date>
    </item>
  </channel>
</rss>

