<?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: Hi, i am tring to add macro variables as a array variable so help me in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435218#M108089</link>
    <description>&lt;P&gt;The warning and error tell you what you need to know.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) You have mispelt separated.&lt;/P&gt;
&lt;P&gt;2) there needs to be speace before _character_ and after it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After that however, it really doesn't make sense to me why you are doing this in the first place?&amp;nbsp; The logic is all wrong, _character_ will select all the variables in the dataset with character format, your select into macro step is selecting all variables in the dataset, overlap at the best of times, errors most of the time.&amp;nbsp; Explain what it is your trying to do, show what you want out.&amp;nbsp; For instance, you could forget all that code, and to proces the score data - which is numeric by the way, so _character_ will not work - you can simply do:&lt;/P&gt;
&lt;PRE&gt;data want;
  set abc;
  array score{3};
  do i=1 to 3;
    ...;
  end;
run;&lt;/PRE&gt;
&lt;P&gt;Looking further your using the output statment incorrectly as well, and comparing name to nothing.&amp;nbsp; As above, post what you want to do and show some output so that we can guide you properly.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2018 11:54:04 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-02-08T11:54:04Z</dc:date>
    <item>
      <title>Hi, i am tring to add macro variables as a array variable so help me</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435213#M108087</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data abx;&lt;BR /&gt;infile datalines dlm=" ";&lt;BR /&gt;input name :$20. score1 score2 score3;&lt;BR /&gt;datalines;;&lt;BR /&gt;a 23 23 23&lt;BR /&gt;b 23 12 12&lt;BR /&gt;c 23 45 66&lt;BR /&gt;a 66 88 99&lt;BR /&gt;c 34 66 45&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;select distinct name,quote(name)&lt;BR /&gt;into :k separeted by " ",&lt;BR /&gt;:j separeted by ","&lt;BR /&gt;from abx;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;option mprint;&lt;BR /&gt;data &amp;amp;k;&lt;BR /&gt;set abx;&lt;BR /&gt;array d[*] &amp;amp;k ;//here i did&amp;nbsp; small change it is taking array but it did not send s out put&amp;nbsp; to assigned data set please help//&lt;BR /&gt;do i=1 to dim(d) ;&lt;BR /&gt;if d[i]=name then output d[i];&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;70&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;71&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;72&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;73 data abx;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;74 infile datalines dlm=" ";&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;75 input name :$20. score1 score2 score3;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;76 datalines;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set WORK.ABX has 5 observations and 4 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;user cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;system cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;memory 523.06k&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;OS Memory 27048.00k&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Timestamp 08/02/2018 12:17:28 PM&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Step Count 30 Switch Count 2&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Page Faults 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Page Reclaims 168&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Page Swaps 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Voluntary Context Switches 9&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Involuntary Context Switches 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Block Input Operations 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Block Output Operations 264&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;76 ! ;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;82 ;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;83 run;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;84&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;85&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;86 proc sql;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;87 select distinct name,quote(name)&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;88 into :k separeted by " ",&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;_________&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;1&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;89 :j separeted by ","&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;_________&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;1&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING 1-322: Assuming the symbol SEPARATED was misspelled as separeted.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;90 from abx;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;91 quit;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.01 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;user cpu time 0.01 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;system cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;memory 5448.37k&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;OS Memory 32172.00k&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Timestamp 08/02/2018 12:17:28 PM&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Step Count 31 Switch Count 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Page Faults 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Page Reclaims 686&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Page Swaps 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Voluntary Context Switches 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Involuntary Context Switches 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Block Input Operations 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Block Output Operations 8&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;92&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;93&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;94 option mprint;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;95 data &amp;amp;k;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;96 set abx;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;97 array d[*] &amp;amp;k ;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;98 do i=1 to dim(d) ;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;99 if d[i]=name then output d[i];&lt;/DIV&gt;&lt;DIV class="sasError"&gt;_&lt;/DIV&gt;&lt;DIV class="sasError"&gt;22&lt;/DIV&gt;&lt;DIV class="sasError"&gt;76&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT color="#FF0000"&gt;ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, ;, RC, _DATA_, _LAST_, _NULL_.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT color="#FF0000"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;100 end;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;101 run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;99:9&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The data set WORK.A may be incomplete. When this step was stopped there were 0 observations and 8 variables.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The data set WORK.B may be incomplete. When this step was stopped there were 0 observations and 8 variables.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The data set WORK.C may be incomplete. When this step was stopped there were 0 observations and 8 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;user cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;system cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;memory 1311.81k&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;OS Memory 29364.00k&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Timestamp 08/02/2018 12:17:28 PM&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Step Count 32 Switch Count 6&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Page Faults 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Page Reclaims 258&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Page Swaps 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Voluntary Context Switches 27&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Involuntary Context Switches 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Block Input Operations 0&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Block Output Operations 792&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;102&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;103 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;115&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Feb 2018 12:22:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435213#M108087</guid>
      <dc:creator>ajay35</dc:creator>
      <dc:date>2018-02-08T12:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Hi, i am tring to add macro variables as a array variable so help me</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435218#M108089</link>
      <description>&lt;P&gt;The warning and error tell you what you need to know.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) You have mispelt separated.&lt;/P&gt;
&lt;P&gt;2) there needs to be speace before _character_ and after it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After that however, it really doesn't make sense to me why you are doing this in the first place?&amp;nbsp; The logic is all wrong, _character_ will select all the variables in the dataset with character format, your select into macro step is selecting all variables in the dataset, overlap at the best of times, errors most of the time.&amp;nbsp; Explain what it is your trying to do, show what you want out.&amp;nbsp; For instance, you could forget all that code, and to proces the score data - which is numeric by the way, so _character_ will not work - you can simply do:&lt;/P&gt;
&lt;PRE&gt;data want;
  set abc;
  array score{3};
  do i=1 to 3;
    ...;
  end;
run;&lt;/PRE&gt;
&lt;P&gt;Looking further your using the output statment incorrectly as well, and comparing name to nothing.&amp;nbsp; As above, post what you want to do and show some output so that we can guide you properly.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 11:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435218#M108089</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-08T11:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Hi, i am tring to add macro variables as a array variable so help me</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435224#M108091</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 12:23:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435224#M108091</guid>
      <dc:creator>ajay35</dc:creator>
      <dc:date>2018-02-08T12:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Hi, i am tring to add macro variables as a array variable so help me</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435258#M108113</link>
      <description>i want create n data set with the name using single data set then thought this might be works in that scenario i tried but it shows 2 errors in sending observation to the output .</description>
      <pubDate>Thu, 08 Feb 2018 13:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435258#M108113</guid>
      <dc:creator>ajay35</dc:creator>
      <dc:date>2018-02-08T13:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Hi, i am tring to add macro variables as a array variable so help me</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435284#M108125</link>
      <description>&lt;P&gt;Sorry, I don't follow.&amp;nbsp; Try showing what the output should be from your test data.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 15:13:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435284#M108125</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-08T15:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Hi, i am tring to add macro variables as a array variable so help me</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435299#M108135</link>
      <description>Hi i will explain detail .&lt;BR /&gt;For example you have basket in that basket you have diffrent color boxes.&lt;BR /&gt;Blue ,red , white and green&lt;BR /&gt;Now i want to divide balls into diffrent color baskets like blue in blue,red in red like this I want&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Feb 2018 15:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435299#M108135</guid>
      <dc:creator>ajay35</dc:creator>
      <dc:date>2018-02-08T15:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Hi, i am tring to add macro variables as a array variable so help me</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435300#M108136</link>
      <description>Sorry not boxes balla</description>
      <pubDate>Thu, 08 Feb 2018 15:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435300#M108136</guid>
      <dc:creator>ajay35</dc:creator>
      <dc:date>2018-02-08T15:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Hi, i am tring to add macro variables as a array variable so help me</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435318#M108144</link>
      <description>&lt;P&gt;Sorry, without a clear cut example can't provide anything.&amp;nbsp; What I would say is that what you are doing is called "binning" the data.&amp;nbsp; There are numerous papers out there and several different methods.&amp;nbsp; For example one way would be to normalise the data - i.e. instead of going across, have all the data going down, and then use something like proc rank:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=p0le3p5ngj1zlbn1mh3tistq9t76.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=p0le3p5ngj1zlbn1mh3tistq9t76.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Or apply the logic yourself in a datastep.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 16:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-i-am-tring-to-add-macro-variables-as-a-array-variable-so-help/m-p/435318#M108144</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-02-08T16:14:38Z</dc:date>
    </item>
  </channel>
</rss>

