<?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: Transpose data with condition in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216220#M16239</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;First I would like to thank you all for those fast answers, they helped me a lot! I'm really thankful for that!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Now I'm trying to test all solutions that you gave me here and I will post the results as soon as I can, now I'm using the university edition, I'm going to have access to 4.3EG again and to real data only on Monday, when I will be back at the office.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Reeza, "Name" is string and all others are numeric, the "%" symbol I had added to this post just to exemplify, as I did with the VARA, VARB etc. These generic variables (VARA, VARB etc) have the same name for all the 100 partners variables, with a number instead of letter. For example, VARA01, VARB01 for Partner_01 and VARA100, VARB100 for Partner_100. Sorry if I was not clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 04 Apr 2015 19:49:14 GMT</pubDate>
    <dc:creator>anonymous_user</dc:creator>
    <dc:date>2015-04-04T19:49:14Z</dc:date>
    <item>
      <title>Transpose data with condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216214#M16233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt; Thanks in advance for reading this thread. I have been trying to find a solution to my case for a while, and I will be very glad to any help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt; The table tbl_partners contains some data from the partners of our customers, like the percentage (%) share, level, number and type. Each customer has a distinct ID (first variable in &lt;STRONG&gt;Layout A&lt;/STRONG&gt; observation).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt; But curiously this table came with data separated in almost 900 variables for each ID, instead of transposed observations. I need to transpose this table from &lt;STRONG&gt;Layout A&lt;/STRONG&gt; to &lt;STRONG&gt;Layout B&lt;/STRONG&gt;, so then I will be able to extract data to create a specific report.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt; I'm trying to use &lt;STRONG&gt;PROC TRANSPOSE BY GROUPS&lt;/STRONG&gt;, but the problem is that the table has almost 900 variables and in many cases this variables are "0", what indicates that the Partner_X doesn't exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt; In fact, the problem is that every ID has his own number of partners from Partner_01 (red color) to a maximum of 100.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt;So I have to transpose information's only when PARTNER_&lt;STRONG&gt;X&lt;/STRONG&gt;_LEVEL variable is grater than 0, because in that case I will be sure that the partner exists. For example, in the obs below, the ID 999999 has 2 partner's so Partner_03 (green color) doesn't exist and came with zeros "0", so in that case I have to transpose infos only from Partner_01 (red color) and Partner 02 (blue color) what will generate &lt;STRONG&gt;Layout 2&lt;/STRONG&gt; table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt; I'm using Enterprise Guide 4.3&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;Thank you very much, regards from Brazil.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Layout A&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" style="border: 1px solid #000000; width: 1235px; height: 69px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Id&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Partner_01&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #ff0000; font-size: 10pt;"&gt;&lt;STRONG&gt;Level&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Partner_01&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #ff0000; font-size: 10pt;"&gt;&lt;STRONG&gt;Number&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Partner_01&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #ff0000; font-size: 10pt;"&gt;&lt;STRONG&gt;Type&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #ff0000; font-size: 10pt;"&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #ff0000; font-size: 10pt;"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #ff0000; font-size: 10pt;"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #ff0000; font-size: 10pt;"&gt;&lt;STRONG&gt;D&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Partner_01&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #ff0000; font-size: 10pt;"&gt;&lt;STRONG&gt;Share&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Partner_02&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #0000ff; font-size: 10pt;"&gt;&lt;STRONG&gt;Level&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Partner_02&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #0000ff; font-size: 10pt;"&gt;&lt;STRONG&gt;Number&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Partner_02&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #0000ff; font-size: 10pt;"&gt;&lt;STRONG&gt;Type&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #0000ff; font-size: 10pt;"&gt;&lt;STRONG&gt;AA&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #0000ff; font-size: 10pt;"&gt;&lt;STRONG&gt;BB&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #0000ff; font-size: 10pt;"&gt;&lt;STRONG&gt;CC&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #0000ff; font-size: 10pt;"&gt;&lt;STRONG&gt;DD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Partner_02&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #0000ff; font-size: 10pt;"&gt;&lt;STRONG&gt;Share&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;Partner_03&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #008000; font-size: 10pt;"&gt;&lt;STRONG&gt;Level&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;Partner_03&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #008000; font-size: 10pt;"&gt;&lt;STRONG&gt;Number&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;Partner_03&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #008000; font-size: 10pt;"&gt;&lt;STRONG&gt;Type&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #008000; font-size: 10pt;"&gt;&lt;STRONG&gt;Var&lt;BR /&gt;AAA&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;BBB &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;CCC&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="color: #ffffff; padding: 2px; text-align: center; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG&gt;DDD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;999999&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;Example&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;777777&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;50%&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;888888&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;90%&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #008000;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #008000;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #008000;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #008000;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #008000;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #008000;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center; color: #000000; background-color: transparent;"&gt;&lt;SPAN style="color: #008000;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Layout B&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#000000&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;}" style="border: 1px solid #000000; width: 489px; height: 94px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; color: #000000; padding: 2px; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;Id&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; color: #000000; padding: 2px; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; color: #000000; padding: 2px; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;Partner&lt;/STRONG&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;STRONG&gt;Level&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="text-align: center; color: #000000; padding: 2px; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;Partner&lt;/STRONG&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;STRONG&gt;Number&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="text-align: center; color: #000000; padding: 2px; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;Partner&lt;/STRONG&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;STRONG&gt;Type&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="text-align: center; color: #000000; padding: 2px; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;P&gt;&lt;STRONG&gt;A&lt;/STRONG&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="text-align: center; color: #000000; padding: 2px; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;P&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="text-align: center; color: #000000; padding: 2px; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="text-align: center; color: #000000; padding: 2px; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;Var&lt;/STRONG&gt;&lt;P&gt;&lt;STRONG&gt;D&lt;/STRONG&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="text-align: center; color: #000000; padding: 2px; font-family: arial, helvetica, sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;Partner&lt;BR /&gt;Share&lt;BR /&gt;&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;999999&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #000000; font-size: 13.3333330154419px; text-align: center;"&gt;Example&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;777777&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #ff0000;"&gt;50%&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #000000; font-size: 13.3333330154419px; text-align: center;"&gt;999999&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #000000; font-size: 13.3333330154419px; text-align: center;"&gt;Example&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;888888&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;X&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; color: #000000; text-align: center; background-color: transparent;"&gt;&lt;SPAN style="color: #0000ff;"&gt;90%&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Apr 2015 15:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216214#M16233</guid>
      <dc:creator>anonymous_user</dc:creator>
      <dc:date>2015-04-04T15:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose data with condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216215#M16234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting problem!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wouldn't really call this a transposition; that would be more if the data were in the form&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Id VarAA x&lt;BR /&gt;Id VarBB x&lt;BR /&gt;Id VarCC x&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and you want to convert it to the format that you've got. Rather, in your case, what should be distinct records are concatenated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you use the query builder instead:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 1. Create one result of Id and all of the Partner 01 variables, where Partner_01Level &amp;gt; 0. Then do the same for Partner 2, Partner 3, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 2. Once you have these tables, concatenate (UNION) them together.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's the only way I can think of to do it with EG's point and click options. It will unfortunately be a pain because of the number of possible partners.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the other hand, if you're comfortable submitting SAS code through an EG code window, this job can be done much more easily using SAS macros. Let us know if this is the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Apr 2015 15:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216215#M16234</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2015-04-04T15:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose data with condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216216#M16235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you post some sample data in a useable format someone can help with the code. Right now you've provided variable labels, variable names will be important, especially the VARA-VARD names as I'm not sure what naming convention is used for those variables (You can't have VARA*100 as the variable name would be too long for SAS).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As &lt;A __default_attr="379045" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; has indicated you could use a macro.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to me your table will always have 100 records with empty values for ones that aren't available.&amp;nbsp; You could use the SASHELP.VCOLUMN table to get the column names and create 8 arrays and then use those to flip in a data step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you could use CALL VNEXT if your data structure is consistent but again the naming convention is required. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Apr 2015 16:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216216#M16235</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-04T16:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose data with condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216217#M16236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Double proc transpose .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
data have;
input id name $ level1 number1 level2 number2 level3 number3;
cards;
1 xx 1 2 2 3 0 0
2 xx 1 2 2 3 0 0
;
run;
proc transpose data=have out=temp;
by id name;
run;
data temp;
 set temp;
 by id name;
 retain flag lev 0;
 length vname $ 20;
 vname=compress(_name_,,'ka');
 if first.name then flag=0;
 if _name_ eq: 'level' then do;
&amp;nbsp; if col1=0 then flag=1;
&amp;nbsp;&amp;nbsp; else do;flag=0;lev=col1;end;
 end;
run;
proc transpose data=temp(where=(flag=0)) out=want;
by id name lev;
id vname;
var col1;
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Apr 2015 16:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216217#M16236</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-04-04T16:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose data with condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216218#M16237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm guessing there's going to be a mix of data types - character and number, but the OP is in a better position to answer that. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Apr 2015 17:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216218#M16237</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-04T17:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose data with condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216219#M16238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=have out=long;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id name;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var Partner_01_Level--Partner_03_Share;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data long;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set long;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id name;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain keepit level;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set long ( firstobs = 2 keep = Col1 rename = (Col1 = Next_Col1) )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; long (&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obs = 1 drop = _all_ );&lt;/P&gt;&lt;P&gt;&amp;nbsp; Col1=strip(Col1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if find(_name_,'Level') then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; keepit=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _name_='Level';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Col1 eq 0 and Next_Col1 eq 0 then keepit=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else level=Col1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if find(_name_,'Number') then _name_='Number';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if find(_name_,'Type') then _name_='Type';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if find(_name_,'Share') then _name_='Share';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if find(_name_,'var') then _name_=substr(_name_,1,5);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if keepit then output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=long out=want (drop=_:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; by id name level;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var col1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Apr 2015 18:11:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216219#M16238</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-04-04T18:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose data with condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216220#M16239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;First I would like to thank you all for those fast answers, they helped me a lot! I'm really thankful for that!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Now I'm trying to test all solutions that you gave me here and I will post the results as soon as I can, now I'm using the university edition, I'm going to have access to 4.3EG again and to real data only on Monday, when I will be back at the office.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Reeza, "Name" is string and all others are numeric, the "%" symbol I had added to this post just to exemplify, as I did with the VARA, VARB etc. These generic variables (VARA, VARB etc) have the same name for all the 100 partners variables, with a number instead of letter. For example, VARA01, VARB01 for Partner_01 and VARA100, VARB100 for Partner_100. Sorry if I was not clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Apr 2015 19:49:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216220#M16239</guid>
      <dc:creator>anonymous_user</dc:creator>
      <dc:date>2015-04-04T19:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose data with condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216221#M16240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I modified the code I originally posted to account for all of the variables, except name, to be numeric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Apr 2015 20:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216221#M16240</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-04-04T20:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose data with condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216222#M16241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here are the results, everything works perfect, so thank you all for spending your time to help with this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/* 04/05/2015 - Credits to &lt;/SPAN&gt;&lt;A class="" href="https://communities.sas.com/message/266407#266407"&gt;https://communities.sas.com/message/266407#266407&lt;/A&gt;&lt;SPAN&gt; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input Id Name $ Level_Partner_01 Number_Partner_01 Type_Partner_01 Vara_01 Varb_01 Varc_01 Vard_01 Share_Partner_01 Level_Partner_02 Number_Partner_02 Type_Partner_02 Vara_02 Varb_02 Varc_02 Vard_02 Share_Partner_02 Level_Partner_03 Number_Partner_03 Type_Partner_03 Vara_03 Varb_03 Varc_03 Vard_03 Share_Partner_03 Level_Partner_04 Number_Partner_04 Type_Partner_04 Vara_04 Varb_04 Varc_04 Vard_04 Share_Partner_04;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;111111 CompanyA 1 111111 1 1 1 1 1 10 2 222222 2 2 2 2 2 20 3 333333 3 3 3 3 3 30 0 0 0 0 0 0 0 0&lt;/P&gt;&lt;P&gt;222222 CompanyB 4 444444 4 4 4 4 4 40 5 555555 5 5 5 5 5 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0&lt;/P&gt;&lt;P&gt;333333 CompanyC 3 666666 6 6 6 6 6 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=have out=temp;&lt;/P&gt;&lt;P&gt;by Id Name;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt; set temp;&lt;/P&gt;&lt;P&gt; by Id Name;&lt;/P&gt;&lt;P&gt; retain flag lev 0;&lt;/P&gt;&lt;P&gt; length vname $ 20;&lt;/P&gt;&lt;P&gt; vname=compress(_name_,,'ka');&lt;/P&gt;&lt;P&gt; if first.Name then flag=0;&lt;/P&gt;&lt;P&gt; if _name_ eq: 'Level' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if col1=0 then flag=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /*falta entender isso*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else do;flag=0;lev=col1;end;&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=temp(where=(flag=0)) out=want;&lt;/P&gt;&lt;P&gt;by id name lev;&lt;/P&gt;&lt;P&gt;id vname;&lt;/P&gt;&lt;P&gt;var col1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 05 Apr 2015 14:48:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Transpose-data-with-condition/m-p/216222#M16241</guid>
      <dc:creator>anonymous_user</dc:creator>
      <dc:date>2015-04-05T14:48:22Z</dc:date>
    </item>
  </channel>
</rss>

