<?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: Create dataset from array in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-dataset-from-array/m-p/165920#M31989</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Arthur, that is exactly what I wanted to do.&amp;nbsp; I did not realize I could create a dataset on the fly using a loop.&amp;nbsp; As usual, I made it harder than it needed to be. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Feb 2014 22:00:11 GMT</pubDate>
    <dc:creator>gsnidow</dc:creator>
    <dc:date>2014-02-06T22:00:11Z</dc:date>
    <item>
      <title>Create dataset from array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-dataset-from-array/m-p/165918#M31987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings all.&amp;nbsp; I need to create a 6500 unique account numbers for testing, 'ACCTNO0001' through 'ACCTNO6500'.&amp;nbsp; I'm putting them into a one dimension array, but I can't figure out how to write the array to a dataset.&amp;nbsp; I thought the write_array function would work, but I keep getting error message below.&amp;nbsp; Is there a way to do this?&amp;nbsp; All the example I found showed 2 dimension arrays, so maybe that is the problem?&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array accts[6500] $ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to 6500 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = cat("ACCTNO",put(i,z4.)) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; accts(i) = x ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = write_array('work.accounts',accts) ;&lt;/P&gt;&lt;P&gt;run ; quit ;&lt;/P&gt;&lt;P&gt;ERROR 68-185: The function WRITE_ARRAY is unknown, or cannot be accessed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Illegal reference to the array accts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 21:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-dataset-from-array/m-p/165918#M31987</guid>
      <dc:creator>gsnidow</dc:creator>
      <dc:date>2014-02-06T21:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create dataset from array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-dataset-from-array/m-p/165919#M31988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not really sure what you are trying to end up with.&amp;nbsp; Do you want all of the data on one record or one each on 6500 records?&amp;nbsp; The following would do the latter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;work.accounts&lt;/SPAN&gt;;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; do _n_=1 to 6500;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACCTNO=put(_n_,z4.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp; end ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 21:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-dataset-from-array/m-p/165919#M31988</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-02-06T21:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create dataset from array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-dataset-from-array/m-p/165920#M31989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Arthur, that is exactly what I wanted to do.&amp;nbsp; I did not realize I could create a dataset on the fly using a loop.&amp;nbsp; As usual, I made it harder than it needed to be. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 22:00:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-dataset-from-array/m-p/165920#M31989</guid>
      <dc:creator>gsnidow</dc:creator>
      <dc:date>2014-02-06T22:00:11Z</dc:date>
    </item>
  </channel>
</rss>

