<?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: trasform/rotate datasets using arrays in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208693#M4831</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All right. I will use proc transpose then...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Aug 2015 18:47:58 GMT</pubDate>
    <dc:creator>dr2014</dc:creator>
    <dc:date>2015-08-27T18:47:58Z</dc:date>
    <item>
      <title>trasform/rotate datasets using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208688#M4826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , I am looking to rotate a SAS dataset (temp3) ,basically converting a tall dataset to a fat dataset. The &lt;STRONG&gt;dataset 'represents answers to each option within a question'&lt;/STRONG&gt;. The original ids for the questions and its options were not labeled in a sequential/logical&amp;nbsp; manner. I have new labels for each of the 'options' within a questionid using certain criteria represented by the variable name new_optionid. Copy-pasted below is how the dataset temp3 looks after sorting and stacking datasets by sequential order of questionid and optionid.&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="236" style="width: 817px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="64"&gt;ID&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="88"&gt;questionid&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="76"&gt;optionid&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="92"&gt;answer&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="64"&gt;Name&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="69"&gt;Name_of_unit&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="62"&gt;sortid&lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="109"&gt;new_questionid&lt;/TD&gt;&lt;TD class="xl67" style="border-left: none;" width="103"&gt;new_optionid&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="90"&gt;new_sortid&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;267899&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;26&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;837&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;xyz&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;Q0101C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;378990&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;27&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;467&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;xyz&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;Q0201C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;378991&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;27&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;519&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;xyz&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;Q0202C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;207320&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;27&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;520&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;xyz&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;Q0203C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;207330&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;27&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;521&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;xyz&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;Q0204C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;207340&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;27&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;522&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;xyz&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;Q0205C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;207350&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;27&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;523&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;xyz&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;6&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;Q0206C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;"&gt;207360&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;58&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;170&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;xyz&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;7&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;Q0401C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Questionid=26 and its optionid=837 corresponds to new_optionid Q0101C...the first 2 digits '01' in 'Q0101C' corresponds to questionid=26 and next 2 digits '01' in 'Q0101C' corresponds to optionid=837&lt;/P&gt;&lt;P&gt;Questionid=27 and its optionid=467 corresponds to new_optionid Q0201C...the first 2 digits '02' in 'Q0201C' corresponds to questionid=27 and next 2 digits '01' in 'Q0201C' corresponds to optionid=467..and so on&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the dataset only houses non-missing answers, the new_optionid only contains only those answered ids . I also created a numeric field called new_sortid to use arrays with numeric data only. So, new_optionid='Q0101C' corresponds to new_sortid=1 and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to have a final dataset that looks like this, where the responses in the answer column are below each new_optionid:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 783px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" width="64"&gt;Name&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="88"&gt;Name_of_unit&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="76"&gt;Q0101C&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="92"&gt;Q0201C&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="64"&gt;Q0202C&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="69"&gt;Q0203C&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="62"&gt;Q0204C&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="98"&gt;Q0205C&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="90"&gt;Q0206C&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="80"&gt;Q0401C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="20" style="border-top: none;"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;xyz&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used an array (below is the code I began with)...but its not giving me what I need.&lt;STRONG&gt;.could I use an array without creating a new_sortid&lt;/STRONG&gt;. &lt;STRONG&gt;How can I incorporate the character value of new_optionid as column names?&lt;/STRONG&gt; Please advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data temp4;&lt;/P&gt;&lt;P&gt;array s(9) s1-s9;&lt;/P&gt;&lt;P&gt;retain s1-s9;&lt;/P&gt;&lt;P&gt;set temp3;&lt;/P&gt;&lt;P&gt;by new_questionid;&lt;/P&gt;&lt;P&gt;s(new_sortid)=answer;&lt;/P&gt;&lt;P&gt;if last.new_questionid then output;&lt;/P&gt;&lt;P&gt;keep new_questionid s1-s9 name name_of_unit ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above code gave me (which is making it more complicated). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 553px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="64"&gt;s1&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;s2&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;s3&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;s4&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;s5&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;s6&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="64"&gt;s7..etc&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="105"&gt;new_questionid&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;.&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 15:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208688#M4826</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2015-08-27T15:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: trasform/rotate datasets using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208689#M4827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure what your explanation with questionid and optionid other than having something to do with recapturing the original question 'names'. I suspect that logic to assign that value would be the first part but I don't get the "digits" as you give no idea what questionid 27 and optionis 519 through 522 mean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And since Questionid 58 has an option id 170 what does that relate to?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the "meaning" of Q0201C something like Question 2, first category selected(if 1, not selected if 0?) and Q0202C Question 2, Second category (like Question 2 is a "mark all that apply" question)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do any of the OPTIONID values appear associated with more than one QUESTIONID? If not then it may be that questionid is redundant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't show any relationship between the example raw data and the S variables in the example code. So no clue as why it isn't working or even what it may actually do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And what happens to the first column just labeled ID?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we can get something that looks close to that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 16:47:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208689#M4827</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-27T16:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: trasform/rotate datasets using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208690#M4828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Ballardw..all right , I see what you mean. Its hard to explain as a lot of data management has been done to arrive at the dataset (temp3) . I probably do not need to go through all those explanations. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me just restructure my concern. Here is data temp3.&amp;nbsp; ID in it stands for each individual row/record in the data for a response(represented by the variable 'answer')&amp;nbsp; to a new_optionid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp3&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 379px; border-width: 0px; border-color: #000000; border-style: solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;ID&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;answer&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Name&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Name_of_unit&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;new_optionid&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;267899&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="82"&gt;xyz&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="105"&gt;Q0101C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;378990&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="82"&gt;xyz&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="105"&gt;Q0201C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;378991&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="82"&gt;xyz&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="105"&gt;Q0202C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;207320&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="82"&gt;xyz&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="105"&gt;Q0203C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;207330&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="82"&gt;xyz&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="105"&gt;Q0204C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;207340&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="82"&gt;xyz&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="105"&gt;Q0205C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;207350&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="82"&gt;xyz&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="105"&gt;Q0206C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;207360&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="82"&gt;xyz&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="105"&gt;Q0401C&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to transform temp3 to temp4:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;temp4&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;NaN&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="width: 694px; border-width: 0px; border-color: #000000; border-style: solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Name&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Name_of_unit&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Q0101C&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Q0201C&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Q0202C&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Q0203C&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Q0204C&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Q0205C&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Q0206C&lt;/TH&gt;&lt;TH style="color: #ffffff; background-color: #6690bc; text-align: center; padding: 2px;"&gt;Q0401C&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;Alaska&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;xyz&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="82"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="75"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="89"&gt;0&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="color: #575757; text-align: left; padding: 0px; background-color: transparent; font-family: arial,helvetica,sans-serif;" width="64"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The order of new_optionid&amp;nbsp; from top to bottom in temp3 needs to be retained from 'left to right' in temp4. Is it possible to do that transformation in one go? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this version of my concern is not appropriate, then please let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S: new_optionid corresponds to items/options within a question which have a response of '1' or '0' or '9'.&lt;/P&gt;&lt;P&gt;e.g&amp;nbsp;&amp;nbsp;&amp;nbsp; Question 01: Do you have fire drill protocol in your unit?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Option 01: *yes&amp;nbsp;&amp;nbsp;&amp;nbsp; *no&amp;nbsp;&amp;nbsp; *dont know.........................................&lt;STRONG&gt;Q0101C&lt;/STRONG&gt; (the first '01' in 'Q0101C' from the left corresponds to 'question 01' and the &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; second 01 after it corresponds to 'option 01' in 'question 01')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A response of 'yes' translates to '1' in the variable 'answer' and,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A response of 'no' translates to '0' and,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A response of 'dont know' translates to '9'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 17:32:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208690#M4828</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2015-08-27T17:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: trasform/rotate datasets using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208691#M4829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Isn't that a straightforward proc transpose? Have you tried a proc transpose that didn't work?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 17:47:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208691#M4829</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-08-27T17:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: trasform/rotate datasets using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208692#M4830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@reeza...I didn't use it. Does it work well when there are missing values in the data? It had messed up one of my tables in the past so was avoiding it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 17:55:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208692#M4830</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2015-08-27T17:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: trasform/rotate datasets using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208693#M4831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All right. I will use proc transpose then...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 18:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208693#M4831</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2015-08-27T18:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: trasform/rotate datasets using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208694#M4832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Define missing values. Is that a missing one across all observations? If there is a value for one observation then it will be included for all. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 19:07:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208694#M4832</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-08-27T19:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: trasform/rotate datasets using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208695#M4833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Reeza. Thanks for sharing that. Now for this data, once I sort&amp;nbsp; by new_optionid, the first observation for the 'answer' will have '0' value (which stands for 'no') , and the rest of the questions will have a missing value( represented by a period). The best way to avoid any problems will be to recode missing values with a numeric value e.g. '999'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 20:11:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208695#M4833</guid>
      <dc:creator>dr2014</dc:creator>
      <dc:date>2015-08-27T20:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: trasform/rotate datasets using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208696#M4834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc transpose data=tr out=trans_tr;&lt;/P&gt;&lt;P&gt;by Name Name_of_unit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var answer;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id new_optionid;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc print data=trans_tr;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2015 07:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/208696#M4834</guid>
      <dc:creator>samirt</dc:creator>
      <dc:date>2015-08-31T07:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: trasform/rotate datasets using arrays</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/377063#M11478</link>
      <description>&lt;P&gt;proc transpose data=tr out=trans_tr;&lt;/P&gt;&lt;P&gt;by Name Name_of_unit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var answer;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id new_optionid;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=trans_tr;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an old post but the last code was very helpful in transforming my data too (similar layout). Only problem is that I have duplicate persons&amp;nbsp;on my by statement. I used the "let" in the procedure to test the code but I do not want the last observation. I want all of them in the wide format with numbers behind them (ethnic01 ethnic02, etc). Not sure how the code works to&amp;nbsp;add this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance! J&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 16:23:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/trasform-rotate-datasets-using-arrays/m-p/377063#M11478</guid>
      <dc:creator>jljones</dc:creator>
      <dc:date>2017-07-18T16:23:58Z</dc:date>
    </item>
  </channel>
</rss>

