<?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 create a Variable that have the list of variables with missing values. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832037#M328857</link>
    <description>&lt;P&gt;This is an example simulate my data to check data errors. We have have&amp;nbsp; &amp;nbsp;two questions which gate the next set of Numeric&amp;nbsp; Score for next set of question.&lt;/P&gt;
&lt;P&gt;Q1, Q2 are Yes or No questions. Q3,Q4, Q5---Q100 are numeric scores questions. Q3, Q4, Q5---Q100 and Q Total, only given score when&amp;nbsp; at least Q1 or Q2 Need to be 'Yes'. 'Q total'&amp;nbsp; only Calculated when all the questions are answered.&lt;/P&gt;
&lt;P&gt;So we have the followinng situations where&lt;/P&gt;
&lt;P&gt;Q1='Y' and Q2='Y' but some 'Qx'&amp;nbsp; missing the scores and Q total was created.&amp;nbsp; &amp;nbsp;We need to output the list of all those questions missing the&amp;nbsp; scores as list&amp;nbsp; showing why it's a data error with flags in xlsx file.&lt;/P&gt;
&lt;P&gt;I hope it makes some kind of sense.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2022 19:06:19 GMT</pubDate>
    <dc:creator>SASuserlot</dc:creator>
    <dc:date>2022-09-06T19:06:19Z</dc:date>
    <item>
      <title>How to create a Variable that have the list of variables with missing values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832022#M328850</link>
      <description>&lt;P&gt;I am looking to create an additional variable that show the list of variables that have the missing values. Is it possible?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input id  x1 y1 z1 ;
  cards;
 106 1 . 2
 107 3 . .
 108 . . .
 109 1 2 3
 ;

 run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;Have:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1662488977076.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75026iE917172AC38CBC2A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1662488977076.png" alt="SASuserlot_0-1662488977076.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;Want&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_1-1662489066376.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75027i845C675D353ECFBA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_1-1662489066376.png" alt="SASuserlot_1-1662489066376.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the 'Have' dataset&amp;nbsp; For example: for 106 subject missing values for x1, y1, z1. then I am expecting to create a variable 'missvar'&amp;nbsp; with variable list separated by delimiter of any kind. is this possible to achieve? Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 18:33:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832022#M328850</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2022-09-06T18:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Variable that have the list of variables with missing values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832025#M328851</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 have;
  input id  x1 y1 z1 ;
  cards;
 106 1 . 2
 107 3 . .
 108 . . .
 109 1 2 3
 ;

data want;
   set have;
   array a x1 -- z1;
   length missvar $200;
   
   do over a;
      if a = . then missvar = catx(', ', missvar, vname(a));
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Sep 2022 18:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832025#M328851</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-09-06T18:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Variable that have the list of variables with missing values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832026#M328852</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350312"&gt;@SASuserlot&lt;/a&gt;&amp;nbsp;beware that there is a difference between your have data in the image and your posted data step.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 18:40:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832026#M328852</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-09-06T18:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Variable that have the list of variables with missing values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832030#M328853</link>
      <description>&lt;P&gt;It worked. Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 18:53:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832030#M328853</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2022-09-06T18:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Variable that have the list of variables with missing values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832031#M328854</link>
      <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 18:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832031#M328854</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-09-06T18:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Variable that have the list of variables with missing values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832032#M328855</link>
      <description>&lt;P&gt;I'm curious,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350312"&gt;@SASuserlot&lt;/a&gt;&amp;nbsp;, how does having such a text string such as 'x1,y1,z1' help anything? What will you do with it once you create it?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 18:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832032#M328855</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-06T18:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a Variable that have the list of variables with missing values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832037#M328857</link>
      <description>&lt;P&gt;This is an example simulate my data to check data errors. We have have&amp;nbsp; &amp;nbsp;two questions which gate the next set of Numeric&amp;nbsp; Score for next set of question.&lt;/P&gt;
&lt;P&gt;Q1, Q2 are Yes or No questions. Q3,Q4, Q5---Q100 are numeric scores questions. Q3, Q4, Q5---Q100 and Q Total, only given score when&amp;nbsp; at least Q1 or Q2 Need to be 'Yes'. 'Q total'&amp;nbsp; only Calculated when all the questions are answered.&lt;/P&gt;
&lt;P&gt;So we have the followinng situations where&lt;/P&gt;
&lt;P&gt;Q1='Y' and Q2='Y' but some 'Qx'&amp;nbsp; missing the scores and Q total was created.&amp;nbsp; &amp;nbsp;We need to output the list of all those questions missing the&amp;nbsp; scores as list&amp;nbsp; showing why it's a data error with flags in xlsx file.&lt;/P&gt;
&lt;P&gt;I hope it makes some kind of sense.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 19:06:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-Variable-that-have-the-list-of-variables-with/m-p/832037#M328857</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2022-09-06T19:06:19Z</dc:date>
    </item>
  </channel>
</rss>

