<?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: Store value of a variable to reuse it anywhere else in data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Store-value-of-a-variable-to-reuse-it-anywhere-else-in-data/m-p/557394#M155385</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Subj tpt grpid $;
infile datalines missover;
datalines;
1 24 bd
1 36 bid
1 72
;

data want(drop=temp);
   set have;
   if tpt=24 then temp=grpid;
   if tpt=72 then grpid=temp;
   retain temp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 09 May 2019 09:53:43 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-05-09T09:53:43Z</dc:date>
    <item>
      <title>Store value of a variable to reuse it anywhere else in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Store-value-of-a-variable-to-reuse-it-anywhere-else-in-data/m-p/557390#M155383</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data as following&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Subj tpt grpid&lt;/P&gt;&lt;P&gt;1 24 bd&lt;/P&gt;&lt;P&gt;1 36 bid&lt;/P&gt;&lt;P&gt;1 72&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And many more. I want when my tpt is 72 and irrespective of grpid missing or non missing should take grpid of tpt=24&lt;/P&gt;&lt;P&gt;So my data should look&lt;/P&gt;&lt;P&gt;Subj tpt grpid&lt;/P&gt;&lt;P&gt;1 24 qd&lt;/P&gt;&lt;P&gt;1 36 bid&lt;/P&gt;&lt;P&gt;1 72 qd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 09:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Store-value-of-a-variable-to-reuse-it-anywhere-else-in-data/m-p/557390#M155383</guid>
      <dc:creator>augustcrez</dc:creator>
      <dc:date>2019-05-09T09:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Store value of a variable to reuse it anywhere else in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Store-value-of-a-variable-to-reuse-it-anywhere-else-in-data/m-p/557394#M155385</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Subj tpt grpid $;
infile datalines missover;
datalines;
1 24 bd
1 36 bid
1 72
;

data want(drop=temp);
   set have;
   if tpt=24 then temp=grpid;
   if tpt=72 then grpid=temp;
   retain temp;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 May 2019 09:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Store-value-of-a-variable-to-reuse-it-anywhere-else-in-data/m-p/557394#M155385</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-09T09:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Store value of a variable to reuse it anywhere else in data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Store-value-of-a-variable-to-reuse-it-anywhere-else-in-data/m-p/557400#M155388</link>
      <description>&lt;P&gt;Some questions that might determine whether a solution works or not:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will each SUBJ always have a TPT=24 record?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, will the TPT=24 record always come before the TPT=72 record?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not, what should happen on the TPT=72 record?&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 10:37:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Store-value-of-a-variable-to-reuse-it-anywhere-else-in-data/m-p/557400#M155388</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-05-09T10:37:08Z</dc:date>
    </item>
  </channel>
</rss>

