<?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 Create V2 based on V1 and where V1 missing, assign the max value of V1 column in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-V2-based-on-V1-and-where-V1-missing-assign-the-max-value/m-p/846143#M41772</link>
    <description>&lt;P&gt;Hello everyone, i have a question regarding the creation of a column based on another, as you can read in the subject.&lt;BR /&gt;Example&lt;/P&gt;
&lt;P&gt;HAVE DATASET:&lt;/P&gt;
&lt;P&gt;V0&amp;nbsp; &amp;nbsp; V1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;23/11/22&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;24/11/22&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;21/11/22&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WANT DATASET:&lt;/P&gt;
&lt;P&gt;V0&amp;nbsp; &amp;nbsp; V1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;V2&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;23/11/22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;23/11/22&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;24/11/22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;24/11/22&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;3&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;24/11/22&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;21/11/22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;21/11/22&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you all, in advance&lt;/P&gt;</description>
    <pubDate>Thu, 24 Nov 2022 13:43:21 GMT</pubDate>
    <dc:creator>Primohunter</dc:creator>
    <dc:date>2022-11-24T13:43:21Z</dc:date>
    <item>
      <title>Create V2 based on V1 and where V1 missing, assign the max value of V1 column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-V2-based-on-V1-and-where-V1-missing-assign-the-max-value/m-p/846143#M41772</link>
      <description>&lt;P&gt;Hello everyone, i have a question regarding the creation of a column based on another, as you can read in the subject.&lt;BR /&gt;Example&lt;/P&gt;
&lt;P&gt;HAVE DATASET:&lt;/P&gt;
&lt;P&gt;V0&amp;nbsp; &amp;nbsp; V1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;23/11/22&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;24/11/22&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;21/11/22&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WANT DATASET:&lt;/P&gt;
&lt;P&gt;V0&amp;nbsp; &amp;nbsp; V1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;V2&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;23/11/22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;23/11/22&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;24/11/22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;24/11/22&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;3&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;24/11/22&lt;/P&gt;
&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;21/11/22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;21/11/22&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you all, in advance&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 13:43:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-V2-based-on-V1-and-where-V1-missing-assign-the-max-value/m-p/846143#M41772</guid>
      <dc:creator>Primohunter</dc:creator>
      <dc:date>2022-11-24T13:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create V2 based on V1 and where V1 missing, assign the max value of V1 column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-V2-based-on-V1-and-where-V1-missing-assign-the-max-value/m-p/846154#M41774</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 V0 V1 :ddmmyy8.;
format V1 ddmmyy8.;
datalines;
1 23/11/22 
2 24/11/22 
3 .        
4 21/11/22 
;

data want;
   set have;
   if V1 then _iorc_ = V1;
   V2 = _iorc_;
   format V2 ddmmyy8.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Result:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;V0  V1        V2
1   23/11/22  23/11/22
2   24/11/22  24/11/22
3   .         24/11/22
4   21/11/22  21/11/22&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Nov 2022 14:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-V2-based-on-V1-and-where-V1-missing-assign-the-max-value/m-p/846154#M41774</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-11-24T14:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create V2 based on V1 and where V1 missing, assign the max value of V1 column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-V2-based-on-V1-and-where-V1-missing-assign-the-max-value/m-p/846170#M41775</link>
      <description>&lt;P&gt;This doesn't seem to find the max value of V1 and use that in V2 when V1 is missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have;
     var v1;
     output out=max max=v1_max;
run;
data want;
    if _n_=1 then set max;
    set have;
    v2=coalesce(v1,v1_max);
    drop _type_ _freq_ v1_max;
    format v2 ddmmyy8.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Nov 2022 14:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Create-V2-based-on-V1-and-where-V1-missing-assign-the-max-value/m-p/846170#M41775</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-24T14:56:14Z</dc:date>
    </item>
  </channel>
</rss>

