<?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: arrary restructuring question in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615814#M18823</link>
    <description>That's a good idea! just want to make sure, the character variable can also do the transpose right?</description>
    <pubDate>Tue, 07 Jan 2020 21:46:27 GMT</pubDate>
    <dc:creator>shawn123</dc:creator>
    <dc:date>2020-01-07T21:46:27Z</dc:date>
    <item>
      <title>arrary restructuring question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615781#M18816</link>
      <description>&lt;P&gt;Hello. I am new to learn the array. I know array can restructure the data from horizontal to vertical, but I don't know how can I transfer my data? This is my code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class="language-sas"&gt;data q11;
input q1-q10;

cards;
1 2 3 6 5 3 7 4 7 9
1 2 3 9 5 3 7 3 9 8
1 2 9 6 5 2 7 3 7 8
;run;

data store;
set q11;
array store{10}q1-q10;
do i=1 to 10;
transfer=store{i};
output;
end;
drop q1-q10; 
run;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="my code output" style="width: 236px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35205iADF71FBD1E6A5610/image-size/large?v=v2&amp;amp;px=999" role="button" title="array rescturing question.PNG" alt="my code output" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;my code output&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="desird structure" style="width: 62px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35206i3FCB14368B26707B/image-size/large?v=v2&amp;amp;px=999" role="button" title="array rescturing question1.PNG" alt="desird structure" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;desird structure&lt;/span&gt;&lt;/span&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 20:24:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615781#M18816</guid>
      <dc:creator>shawn123</dc:creator>
      <dc:date>2020-01-07T20:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: arrary restructuring question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615785#M18817</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="array rescturing question.PNG" style="width: 236px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35208i4F3599FB8C4A2936/image-size/large?v=v2&amp;amp;px=999" role="button" title="array rescturing question.PNG" alt="array rescturing question.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="array rescturing question1.PNG" style="width: 62px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35207i2225CD30AE2C29FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="array rescturing question1.PNG" alt="array rescturing question1.PNG" /&gt;&lt;/span&gt;( I want this format)&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 20:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615785#M18817</guid>
      <dc:creator>shawn123</dc:creator>
      <dc:date>2020-01-07T20:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: arrary restructuring question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615789#M18818</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/295663"&gt;@shawn123&lt;/a&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data q11;
input q1-q10;

cards;
1 2 3 6 5 3 7 4 7 9
1 2 3 9 5 3 7 3 9 8
1 2 9 6 5 2 7 3 7 8
;run;
data want;
 do _n_=1 by 1 until(z);
  set q11 end=z;
  array t(9999,9999) _temporary_;
  array j q1-q10;
  do over j;
   t(_n_,_i_)=j;
  end;
 end;
 array want(3);
 do over j;
  do _n_=1 to dim(want);
   want(_n_)=t(_n_,_i_);
  end;
  output;
 end;
 drop q:;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jan 2020 20:28:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615789#M18818</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-01-07T20:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: arrary restructuring question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615790#M18819</link>
      <description>Thank you so much!</description>
      <pubDate>Tue, 07 Jan 2020 20:30:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615790#M18819</guid>
      <dc:creator>shawn123</dc:creator>
      <dc:date>2020-01-07T20:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: arrary restructuring question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615802#M18822</link>
      <description>&lt;P&gt;PROC TRANSPOSE is designed to do that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=q11 out=flop prefix=x ;
  var q1-q10;
run;

proc print data=flop;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs    _NAME_    x1    x2    x3

  1     q1        1     1     1
  2     q2        2     2     2
  3     q3        3     3     9
  4     q4        6     9     6
  5     q5        5     5     5
  6     q6        3     3     2
  7     q7        7     7     7
  8     q8        4     3     3
  9     q9        7     9     7
 10     q10       9     8     8&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jan 2020 21:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615802#M18822</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-07T21:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: arrary restructuring question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615814#M18823</link>
      <description>That's a good idea! just want to make sure, the character variable can also do the transpose right?</description>
      <pubDate>Tue, 07 Jan 2020 21:46:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615814#M18823</guid>
      <dc:creator>shawn123</dc:creator>
      <dc:date>2020-01-07T21:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: arrary restructuring question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615818#M18824</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/295663"&gt;@shawn123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;That's a good idea! just want to make sure, the character variable can also do the transpose right?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you want to include character variable(s) in the list of variables to transpose then you must include the VAR statement. Without it PROC TRANSPOSE will just transpose the numeric variables.&amp;nbsp; Also if you transpose a mix of numeric and character variables then the numeric values will be converted to character.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2020 21:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/arrary-restructuring-question/m-p/615818#M18824</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-07T21:52:16Z</dc:date>
    </item>
  </channel>
</rss>

