<?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: Market Research - ERROR: Too few variables defined for the dimension(s) specified for the array in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Market-Research-ERROR-Too-few-variables-defined-for-the/m-p/531471#M145463</link>
    <description>&lt;P&gt;Reeza - Thank you for your response! I changed the magnitude of the array and it worked. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Julia&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ps. Thank you for your notes on posting etiquette - very helpful!&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jan 2019 20:08:07 GMT</pubDate>
    <dc:creator>jws47</dc:creator>
    <dc:date>2019-01-30T20:08:07Z</dc:date>
    <item>
      <title>Market Research - ERROR: Too few variables defined for the dimension(s) specified for the array x.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Market-Research-ERROR-Too-few-variables-defined-for-the/m-p/531151#M145322</link>
      <description>&lt;PRE&gt;Hi All - I am trying to build a Discrete Choice Experiment (DCE) questionnaire in SAS. I am trying to build a DCE with four generic attributes at three levels, presented in 18 runs. &lt;BR /&gt;In each run, respondents will be presented with two alternatives, plus a constant alternative (declining both alternatives).&lt;BR /&gt;I am using the following code, but I am generating the error ERROR: Too few variables defined for the dimension(s) specified for the array x.&lt;BR /&gt;&lt;BR /&gt;title 'Generic Distribution Attributes';
%mktex (3 ** 4, n=18, seed=17);
data final (drop=i);
	set design end=eof;
	retain f1-f2 1 f3 0;
	output;
	if eof then do;
		array x[18]x1-x4 f1-f3;
		do i=1 to 18; x[i] = i le 4 or i eq 18; end;
		output;
		end;
	run;

proc print data=final(where=(x1 eq x3 and x2 eq x4 or f3)); run; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;How can I fix this?&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 19:57:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Market-Research-ERROR-Too-few-variables-defined-for-the/m-p/531151#M145322</guid>
      <dc:creator>jws47</dc:creator>
      <dc:date>2019-01-29T19:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Market Research - ERROR: Too few variables defined for the dimension(s) specified for the array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Market-Research-ERROR-Too-few-variables-defined-for-the/m-p/531173#M145337</link>
      <description>&lt;PRE&gt;array x[18]x1-x4 f1-f3;&lt;/PRE&gt;
&lt;P&gt;Your array statement lists 18 items and you loop over 18 items. But X1-X4 is 4 and F1-F3 is 3, which means you're only providing 7 variables for an array you've declared as size 18. You need 11 more variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without having further information about your input data structure, I'm not sure how to fix this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FYI - the code blocks are for code, your text should go outside the code blocks for legibility. One of the benefits of a code block is to be able to copy just that and paste it into an editor without changes. If you have it all together it doesn't provide that benefit.&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/258637"&gt;@jws47&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;Hi All - I am trying to build a Discrete Choice Experiment (DCE) questionnaire in SAS. I am trying to build a DCE with four generic attributes at three levels, presented in 18 runs. &lt;BR /&gt;In each run, respondents will be presented with two alternatives, plus a constant alternative (declining both alternatives).&lt;BR /&gt;I am using the following code, but I am generating the error ERROR: Too few variables defined for the dimension(s) specified for the array x.&lt;BR /&gt;&lt;BR /&gt;title 'Generic Distribution Attributes';
%mktex (3 ** 4, n=18, seed=17);
data final (drop=i);
	set design end=eof;
	retain f1-f2 1 f3 0;
	output;
	if eof then do;
		array x[18]x1-x4 f1-f3;
		do i=1 to 18; x[i] = i le 4 or i eq 18; end;
		output;
		end;
	run;

proc print data=final(where=(x1 eq x3 and x2 eq x4 or f3)); run; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;How can I fix this?&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jan 2019 20:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Market-Research-ERROR-Too-few-variables-defined-for-the/m-p/531173#M145337</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-29T20:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Market Research - ERROR: Too few variables defined for the dimension(s) specified for the array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Market-Research-ERROR-Too-few-variables-defined-for-the/m-p/531471#M145463</link>
      <description>&lt;P&gt;Reeza - Thank you for your response! I changed the magnitude of the array and it worked. Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Julia&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ps. Thank you for your notes on posting etiquette - very helpful!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 20:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Market-Research-ERROR-Too-few-variables-defined-for-the/m-p/531471#M145463</guid>
      <dc:creator>jws47</dc:creator>
      <dc:date>2019-01-30T20:08:07Z</dc:date>
    </item>
  </channel>
</rss>

