<?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: Multiple record into Single record in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520268#M141234</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="无标题1.jpg" style="width: 558px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25539i38AE86B14AEE8478/image-size/large?v=v2&amp;amp;px=999" role="button" title="无标题1.jpg" alt="无标题1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Dec 2018 07:15:29 GMT</pubDate>
    <dc:creator>learsaas</dc:creator>
    <dc:date>2018-12-11T07:15:29Z</dc:date>
    <item>
      <title>Re: Multiple record into Single record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520707#M141231</link>
      <description>&lt;P&gt;if you look into the resulted output (want dataset)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Name&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Landline&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Mobile&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;a&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1234678&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;991122488&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;b&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;8795643210&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;77889912&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;c&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4085794&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#FF9900"&gt;77889912&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;d&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;9112456781&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#FF9900"&gt;77889912&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In record c &amp;amp; d mobile no of b record is reating.... which shd be supressed and should be display as . &lt;STRONG&gt;(period) or blank&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and one more thing is all &lt;STRONG&gt;8 digits&lt;/STRONG&gt; numbers should come under Landline and &lt;STRONG&gt;10 digits&lt;/STRONG&gt; number should be under Mobile no...&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 08:07:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520707#M141231</guid>
      <dc:creator>vThanu</dc:creator>
      <dc:date>2018-12-12T08:07:56Z</dc:date>
    </item>
    <item>
      <title>Multiple record into Single record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520255#M141233</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Plz can any one help me how to read mutliple records into single record on conditionally&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input name$&amp;nbsp;contact 10.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;a 1234678&lt;/P&gt;&lt;P&gt;a 9911224488&lt;/P&gt;&lt;P&gt;b 8795643210&lt;/P&gt;&lt;P&gt;c 04085794&lt;/P&gt;&lt;P&gt;d 9112456781&lt;/P&gt;&lt;P&gt;b 77889912&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and looking for the below result. (&lt;STRONG&gt;if the name appears twice and have muliple records should be write in single record in the result like below&lt;/STRONG&gt;)&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name$&amp;nbsp; landline&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Mobile&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1234678&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9911224488&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;77889912&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8795643210&lt;/P&gt;&lt;P&gt;c&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;04085794&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;.&lt;/P&gt;&lt;P&gt;d&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;9112456781&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 06:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520255#M141233</guid>
      <dc:creator>vThanu</dc:creator>
      <dc:date>2018-12-11T06:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple record into Single record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520268#M141234</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="无标题1.jpg" style="width: 558px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25539i38AE86B14AEE8478/image-size/large?v=v2&amp;amp;px=999" role="button" title="无标题1.jpg" alt="无标题1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 07:15:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520268#M141234</guid>
      <dc:creator>learsaas</dc:creator>
      <dc:date>2018-12-11T07:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple record into Single record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520269#M141235</link>
      <description>&lt;P&gt;You can either use proc transpose to get the wanted dataset from the having one or&lt;/P&gt;
&lt;P&gt;define an array of contacts and enter each contact to separate member of the array.&lt;/P&gt;
&lt;P&gt;Assuming data is sorted by name:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input name$ contact 10.;
datalines;
a 1234678
a 9911224488
b 8795643210
c 04085794
d 9112456781
b 77889912
;
run;

data want;
 set have;
  by name;&lt;BR /&gt;  retain i contact1-contact9; /* adapt to max number of contacts expected */
  drop i contact;
  array cn {*} contact1-contact9 ;

  if first.name then i=1;
  cn(i) = contact; 
  i+1;
  if last.name then output;
run;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 07:18:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520269#M141235</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-12-11T07:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple record into Single record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520284#M141236</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/192107"&gt;@learsaas&lt;/a&gt;: posting code in pictures is &lt;EM&gt;&lt;STRONG&gt;very&lt;/STRONG&gt;&lt;STRONG&gt; unhelpful&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;It forces others to type everything in manually, wasting time and giving ample opportunity for mistakes.&lt;/P&gt;
&lt;P&gt;Use the "little running man" icon or the {i} button to post code by simply using copy/paste from the program editor.&lt;/P&gt;
&lt;P&gt;The "little running man" will do its best to mimic the coloring of the Enhanced Editor.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 08:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520284#M141236</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-11T08:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple record into Single record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520293#M141237</link>
      <description>&lt;PRE&gt;data want (drop=contact);
  set have;
  by name;
  retain landline mobile;
  if first.name then landline=contact;
  if last.name and not first.name then mobile=contact;
  if last.name then output;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Dec 2018 09:03:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520293#M141237</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-11T09:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple record into Single record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520711#M141238</link>
      <description>&lt;P&gt;&lt;BR /&gt;data want (keep=name contact1 contact2);&lt;BR /&gt;set have;&lt;BR /&gt;by name; retain i contact1-contact9; /* adapt to max number of contacts expected */&lt;BR /&gt;drop i contact;&lt;BR /&gt;array cn {*} contact1-contact9 ;&lt;BR /&gt;if first.name then i=1;&lt;BR /&gt;cn(i) = contact;&lt;BR /&gt;i+1;&lt;BR /&gt;if last.name then output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Name&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Contact1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Contact2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;a&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1234678&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;991122488&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;b&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;8795643210&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;77889912&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;c&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4085794&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;77889912&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;d&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;9112456781&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;77889912&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The resulted output showing repeated values for record &lt;STRONG&gt;C&lt;/STRONG&gt; and record &lt;STRONG&gt;D&lt;/STRONG&gt; of record &lt;STRONG&gt;B&lt;/STRONG&gt; values.&lt;/P&gt;&lt;P&gt;Ideally it should be &lt;STRONG&gt;. (period) or blank...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 08:16:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520711#M141238</guid>
      <dc:creator>vThanu</dc:creator>
      <dc:date>2018-12-12T08:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple record into Single record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520715#M141232</link>
      <description>&lt;P&gt;If you want to reliably use the number of digits to make decisions, you need to work with character variables, and make use of the tools SAS provides for converting long datasets to wide:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input name $ contact :$10.;
if length (contact) = 10
then type = 'mobile  ';
else type = 'landline';
datalines;
a 1234678
a 9911224488
b 8795643210
c 04085794
d 9112456781
b 77889912
;
run;

proc sort data=have;
by name;
run;

proc transpose
  data=have
  out=want (drop=_name_)
;
by name;
var contact;
id type;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 08:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520715#M141232</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-12T08:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple record into Single record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520717#M141239</link>
      <description>&lt;P&gt;I moved the whole thread to the Programming community.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Dec 2018 08:28:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-Multiple-record-into-Single-record/m-p/520717#M141239</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-12T08:28:04Z</dc:date>
    </item>
  </channel>
</rss>

