<?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: Bring the information on one line in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Bring-the-information-on-one-line/m-p/926939#M364805</link>
    <description>&lt;P&gt;Thanks !&lt;/P&gt;</description>
    <pubDate>Fri, 03 May 2024 18:52:50 GMT</pubDate>
    <dc:creator>sasuser_8</dc:creator>
    <dc:date>2024-05-03T18:52:50Z</dc:date>
    <item>
      <title>Bring the information on one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bring-the-information-on-one-line/m-p/926809#M364739</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;From this table:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA HAVE;
INPUT CODE TYPE$ CATEGORY$;
CARDS;

15 A Y6D
15 B K45
08 A LS7
08 B G27
63 A A09
63 A Q98
63 B Z98
05 A P09
10 A W87
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to obtain the following result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WANT.jpg" style="width: 376px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96131iEFA8F9A3FB9B1B5D/image-dimensions/376x137?v=v2" width="376" height="137" role="button" title="WANT.jpg" alt="WANT.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 15:32:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bring-the-information-on-one-line/m-p/926809#M364739</guid>
      <dc:creator>sasuser_8</dc:creator>
      <dc:date>2024-05-02T15:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: Bring the information on one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bring-the-information-on-one-line/m-p/926845#M364759</link>
      <description>&lt;P&gt;You should sort but it does work notsorted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA HAVE;
INPUT CODE TYPE$ CATEGORY$;
CARDS;
15 A Y6D
15 B K45
08 A LS7
08 B G27
63 A A09
63 A Q98
63 B Z98
05 A P09
10 A W87
;
   RUN;

data haveidx;
   set have;
   by code type notsorted;
   if first.type then i=0;
   i + 1;
   run;
proc transpose data=haveidx out=want prefix=Type_ delim=_;
   by code notsorted;
   var category;
   id type i;
   run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 337px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96140i42E3BC87067D3BA0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 20:04:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bring-the-information-on-one-line/m-p/926845#M364759</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2024-05-02T20:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Bring the information on one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bring-the-information-on-one-line/m-p/926903#M364794</link>
      <description>&lt;P&gt;If I have two variables to transpose instead of one, can I still do it with a transpose ? By example:&lt;/P&gt;
&lt;PRE&gt;DATA HAVE;
INPUT CODE TYPE$ CATEGORY$ COLOR$;
CARDS;
15 A Y6D BLUE
15 B K45 YELLOW
08 A LS7 RED
08 B G27 RED 
63 A A09 BLACK
63 A Q98 WHITE
63 B Z98 GRAY
05 A P09 GREEN
10 A W87 GRAY
;
   RUN;
&lt;/PRE&gt;
&lt;P&gt;For this result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WANT_2.jpg" style="width: 571px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96148i61D604AEFDE782AD/image-size/large?v=v2&amp;amp;px=999" role="button" title="WANT_2.jpg" alt="WANT_2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 14:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bring-the-information-on-one-line/m-p/926903#M364794</guid>
      <dc:creator>sasuser_8</dc:creator>
      <dc:date>2024-05-03T14:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Bring the information on one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bring-the-information-on-one-line/m-p/926932#M364802</link>
      <description>&lt;P&gt;Indeed&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA HAVE;
INPUT CODE TYPE$ CATEGORY$ COLOR$;
CARDS;
15 A Y6D BLUE
15 B K45 YELLOW
08 A LS7 RED
08 B G27 RED 
63 A A09 BLACK
63 A Q98 WHITE
63 B Z98 GRAY
05 A P09 GREEN
10 A W87 GRAY
;
   RUN;
proc sort;
   by code type;
   run;

data haveidx;
   set have;
   by code type;
   if first.type then i=0;
   i + 1;
   run;
proc transpose data=haveidx out=tall name=vname;
   by code type i;
   var category color;
   run;

proc transpose data=tall out=want delim=_;
   by code;
   var col1;
   id vname type i;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="data_null___0-1714758921683.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96156i2987060FD750C6E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="data_null___0-1714758921683.png" alt="data_null___0-1714758921683.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 17:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bring-the-information-on-one-line/m-p/926932#M364802</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2024-05-03T17:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Bring the information on one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bring-the-information-on-one-line/m-p/926939#M364805</link>
      <description>&lt;P&gt;Thanks !&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 18:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bring-the-information-on-one-line/m-p/926939#M364805</guid>
      <dc:creator>sasuser_8</dc:creator>
      <dc:date>2024-05-03T18:52:50Z</dc:date>
    </item>
  </channel>
</rss>

