<?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: How to know additional value in a variable for a list of sequence in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736359#M229381</link>
    <description>&lt;P&gt;Although all the suggestions were useful.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/77163"&gt;@Oligolas&lt;/a&gt;&amp;nbsp; i had used your suggestion in my program and it worked for me. thanks a lot for your time everyone&lt;/P&gt;</description>
    <pubDate>Thu, 22 Apr 2021 09:54:17 GMT</pubDate>
    <dc:creator>Ravindra_</dc:creator>
    <dc:date>2021-04-22T09:54:17Z</dc:date>
    <item>
      <title>How to know additional value in a variable for a list of sequence</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736009#M229287</link>
      <description>&lt;P&gt;I have a dataset with multiple timepoints and every visit has timepoint collected 3 times and if there is any timepoint that is collected more than 3 times it should come in output. I had written below code but it is not working. I had transposed all timepoints and got them into one variable called timepoint.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc_1;
	set abc;
	by SubjectId visit timepoint;
	Seq+1;
	if first.timepoint then Seq=1;
	if seq&amp;gt;3 then flag=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;example dataset as below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ndsn;
infile datalines;
input subject visit $4. TP1 TP2 TP3;
datalines;
101 Day1 1  1  1
101 Day1 1  2  2
101 Day1 3  3  3
101 Day1 4  4  4
101 Day1 7  7  7
101 Day1 7  8  8
101 Day1 9  9  9
101 Day1 9 10 10
101 Day1 11 11 11
101 Day2 1  1  1
101 Day2 2  2  2
101 Day2 2  3  3
101 Day2 4  4  4
101 Day2 5  5  5
101 Day2 5  6  6
101 Day2 7  7  7
101 Day2 10 10 10
101 Day2 11 10 11
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;desired output as below after transposing the 3 variables to one variable called timepoint i got that variable&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ndsn;
infile datalines;
input subject visit $4. timepoint;
datalines;
101 Day1 1 
101 Day1 7 
101 Day1 9
101 Day2 2 
101 Day2 5 
101 Day2 10
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Any help please&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 15:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736009#M229287</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2021-04-21T15:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to know additional value in a variable for a list of sequence</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736036#M229295</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;you could use SQL to achieve this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
   CREATE TABLE ndsn_t AS
      SELECT subject,visit,TP,count(TP) AS COUNT
      FROM
        (SELECT subject,visit,TP1 AS TP FROM ndsn
         UNION CORRESPONDING ALL 
         SELECT subject,visit,TP2 AS TP FROM ndsn
         UNION CORRESPONDING ALL 
         SELECT subject,visit,TP3 AS TP FROM ndsn)
      GROUP BY subject,visit,TP
      HAVING COUNT&amp;gt;3
      ORDER BY subject,visit,TP
   ;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Apr 2021 15:44:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736036#M229295</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2021-04-21T15:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to know additional value in a variable for a list of sequence</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736064#M229302</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ndsn;
infile datalines;
input subject visit $4. TP1 TP2 TP3;
datalines;
101 Day1 1  1  1
101 Day1 1  2  2
101 Day1 3  3  3
101 Day1 4  4  4
101 Day1 7  7  7
101 Day1 7  8  8
101 Day1 9  9  9
101 Day1 9 10 10
101 Day1 11 11 11
101 Day2 1  1  1
101 Day2 2  2  2
101 Day2 2  3  3
101 Day2 4  4  4
101 Day2 5  5  5
101 Day2 5  6  6
101 Day2 7  7  7
101 Day2 10 10 10
101 Day2 11 10 11
;
run;

data temp(drop = tp:);
   set ndsn;
   array t tp:;
   do over t;
      timepoint = t;
      output;
   end;
run;

proc summary data = temp nway;
   class subject visit timepoint;
   var timepoint;
   output out = want(where = (_freq_ &amp;gt; 3)) n =;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Apr 2021 18:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736064#M229302</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-04-21T18:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to know additional value in a variable for a list of sequence</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736066#M229303</link>
      <description>Thanks a lot for the solution, i will try this and will let you know if i need any help further</description>
      <pubDate>Wed, 21 Apr 2021 18:25:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736066#M229303</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2021-04-21T18:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to know additional value in a variable for a list of sequence</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736067#M229304</link>
      <description>Thanks for the response, i will try this as well and will let you know for any support</description>
      <pubDate>Wed, 21 Apr 2021 18:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736067#M229304</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2021-04-21T18:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to know additional value in a variable for a list of sequence</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736359#M229381</link>
      <description>&lt;P&gt;Although all the suggestions were useful.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/77163"&gt;@Oligolas&lt;/a&gt;&amp;nbsp; i had used your suggestion in my program and it worked for me. thanks a lot for your time everyone&lt;/P&gt;</description>
      <pubDate>Thu, 22 Apr 2021 09:54:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-know-additional-value-in-a-variable-for-a-list-of/m-p/736359#M229381</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2021-04-22T09:54:17Z</dc:date>
    </item>
  </channel>
</rss>

