<?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 how to do  concatenation not missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-do-concatenation-not-missing-values/m-p/811401#M320033</link>
    <description>&lt;P&gt;data set in raw.have&lt;BR /&gt;data have;&lt;BR /&gt;infile datalines dsd truncover;&lt;BR /&gt;input subjid $ THER NEWTR CHTR SHOS OTHER ;&lt;BR /&gt;datalines;&lt;BR /&gt;101,1,1,1,1,1,.,&lt;BR /&gt;102,1,1,1,1,.&lt;BR /&gt;103,1,1,1,,&lt;BR /&gt;104,1.,1,,,,.&lt;BR /&gt;105,1,,.,,.,&lt;BR /&gt;106,1,.,1,.,.,.,&lt;BR /&gt;107,.,1.,,1,1,.,.&lt;BR /&gt;108,.,1.,1,,.&lt;BR /&gt;109,.,1,.,1,.&lt;BR /&gt;110,.,1,.,.,.&lt;BR /&gt;111,1,.,.,.,.,&lt;BR /&gt;112,.,.,1,1,.&lt;BR /&gt;113,.,.,1,.&lt;BR /&gt;114,.,.,.,1,.&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want this output&lt;/P&gt;
&lt;P&gt;data want ;&lt;/P&gt;
&lt;P&gt;length subjid $20 acnoth $200;&lt;BR /&gt;infile datalines dsd truncover;&lt;BR /&gt;input subjid $ acnoth $;&lt;BR /&gt;datalines;&lt;BR /&gt;101,"NON-DRUG THERAPY, NEW OTC OR RX DRUG ADDED, CHANGE IN CONCOMITANT MEDICATION, HOSPITALIZATION (INCLUDES ER VISITS),OTER"&lt;BR /&gt;102,"NON-DRUG THERAPY, NEW OTC OR RX DRUG ADDED, CHANGE IN CONCOMITANT MEDICATION, HOSPITALIZATION (INCLUDES ER VISITS)"&lt;BR /&gt;103,"NON-DRUG THERAPY, NEW OTC OR RX DRUG ADDED, CHANGE IN CONCOMITANT MEDICATION"&lt;BR /&gt;104,"NON-DRUG THERAPY, NEW OTC OR RX DRUG ADDED"&lt;BR /&gt;105,"NON-DRUG THERAPY"&lt;BR /&gt;106,"NON-DRUG THERAPY, CHANGE IN CONCOMITANT MEDICATION"&lt;BR /&gt;107,"NEW OTC OR RX DRUG ADDED, HOSPITALIZATION (INCLUDES ER VISITS),OTER"&lt;BR /&gt;108,"NEW OTC OR RX DRUG ADDED, CHANGE IN CONCOMITANT MEDICATION"&lt;BR /&gt;109,"NEW OTC OR RX DRUG ADDED, HOSPITALIZATION (INCLUDES ER VISITS)"&lt;BR /&gt;110,"NEW OTC OR RX DRUG ADDED"&lt;BR /&gt;111,"NON-DRUG THERAPY"&lt;BR /&gt;112,"CHANGE IN CONCOMITANT MEDICATION, HOSPITALIZATION (INCLUDES ER VISITS)"&lt;BR /&gt;113,"CHANGE IN CONCOMITANT MEDICATION"&lt;BR /&gt;114,"HOSPITALIZATION (INCLUDES ER VISITS)"&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;I want final output&lt;/P&gt;
&lt;P&gt;data fin;&lt;BR /&gt;merge have want ;&lt;BR /&gt;by subjid ;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Wed, 04 May 2022 10:10:26 GMT</pubDate>
    <dc:creator>teja5959</dc:creator>
    <dc:date>2022-05-04T10:10:26Z</dc:date>
    <item>
      <title>how to do  concatenation not missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-do-concatenation-not-missing-values/m-p/811401#M320033</link>
      <description>&lt;P&gt;data set in raw.have&lt;BR /&gt;data have;&lt;BR /&gt;infile datalines dsd truncover;&lt;BR /&gt;input subjid $ THER NEWTR CHTR SHOS OTHER ;&lt;BR /&gt;datalines;&lt;BR /&gt;101,1,1,1,1,1,.,&lt;BR /&gt;102,1,1,1,1,.&lt;BR /&gt;103,1,1,1,,&lt;BR /&gt;104,1.,1,,,,.&lt;BR /&gt;105,1,,.,,.,&lt;BR /&gt;106,1,.,1,.,.,.,&lt;BR /&gt;107,.,1.,,1,1,.,.&lt;BR /&gt;108,.,1.,1,,.&lt;BR /&gt;109,.,1,.,1,.&lt;BR /&gt;110,.,1,.,.,.&lt;BR /&gt;111,1,.,.,.,.,&lt;BR /&gt;112,.,.,1,1,.&lt;BR /&gt;113,.,.,1,.&lt;BR /&gt;114,.,.,.,1,.&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want this output&lt;/P&gt;
&lt;P&gt;data want ;&lt;/P&gt;
&lt;P&gt;length subjid $20 acnoth $200;&lt;BR /&gt;infile datalines dsd truncover;&lt;BR /&gt;input subjid $ acnoth $;&lt;BR /&gt;datalines;&lt;BR /&gt;101,"NON-DRUG THERAPY, NEW OTC OR RX DRUG ADDED, CHANGE IN CONCOMITANT MEDICATION, HOSPITALIZATION (INCLUDES ER VISITS),OTER"&lt;BR /&gt;102,"NON-DRUG THERAPY, NEW OTC OR RX DRUG ADDED, CHANGE IN CONCOMITANT MEDICATION, HOSPITALIZATION (INCLUDES ER VISITS)"&lt;BR /&gt;103,"NON-DRUG THERAPY, NEW OTC OR RX DRUG ADDED, CHANGE IN CONCOMITANT MEDICATION"&lt;BR /&gt;104,"NON-DRUG THERAPY, NEW OTC OR RX DRUG ADDED"&lt;BR /&gt;105,"NON-DRUG THERAPY"&lt;BR /&gt;106,"NON-DRUG THERAPY, CHANGE IN CONCOMITANT MEDICATION"&lt;BR /&gt;107,"NEW OTC OR RX DRUG ADDED, HOSPITALIZATION (INCLUDES ER VISITS),OTER"&lt;BR /&gt;108,"NEW OTC OR RX DRUG ADDED, CHANGE IN CONCOMITANT MEDICATION"&lt;BR /&gt;109,"NEW OTC OR RX DRUG ADDED, HOSPITALIZATION (INCLUDES ER VISITS)"&lt;BR /&gt;110,"NEW OTC OR RX DRUG ADDED"&lt;BR /&gt;111,"NON-DRUG THERAPY"&lt;BR /&gt;112,"CHANGE IN CONCOMITANT MEDICATION, HOSPITALIZATION (INCLUDES ER VISITS)"&lt;BR /&gt;113,"CHANGE IN CONCOMITANT MEDICATION"&lt;BR /&gt;114,"HOSPITALIZATION (INCLUDES ER VISITS)"&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;I want final output&lt;/P&gt;
&lt;P&gt;data fin;&lt;BR /&gt;merge have want ;&lt;BR /&gt;by subjid ;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 10:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-do-concatenation-not-missing-values/m-p/811401#M320033</guid>
      <dc:creator>teja5959</dc:creator>
      <dc:date>2022-05-04T10:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to do  concatenation not missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-do-concatenation-not-missing-values/m-p/811405#M320035</link>
      <description>&lt;P&gt;Sorry, but it is not clear what you want concatenated.&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 10:30:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-do-concatenation-not-missing-values/m-p/811405#M320035</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-05-04T10:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to do  concatenation not missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-do-concatenation-not-missing-values/m-p/811411#M320038</link>
      <description>&lt;P&gt;Please explain the logic that lets you go from the input data to the output data. Please give a step by step example.&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 11:27:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-do-concatenation-not-missing-values/m-p/811411#M320038</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-04T11:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to do  concatenation not missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-do-concatenation-not-missing-values/m-p/811413#M320040</link>
      <description>&lt;P&gt;I'm not going to format each individual value, but I'm assuming this is what you wanted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	length acnoth $200.;
	array v [*] ther -- other;
	do i = 1 to dim(v);
		if not missing(v[i]) then acnoth = catx(', ', acnoth, vname(v[i]));
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In future posts, please provide more information - we can only make assumptions. If you have actual character values associated with variables, please provide those too.&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 11:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-do-concatenation-not-missing-values/m-p/811413#M320040</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2022-05-04T11:34:25Z</dc:date>
    </item>
  </channel>
</rss>

