<?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: Combining data cells which may hold blanks in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672639#M79273</link>
    <description>Hi !!!!!      I removed the 24 digits as length and both of your codes worked exactly the way I want!  Thank you so very much!!!!!</description>
    <pubDate>Mon, 27 Jul 2020 17:46:04 GMT</pubDate>
    <dc:creator>SannaSanna</dc:creator>
    <dc:date>2020-07-27T17:46:04Z</dc:date>
    <item>
      <title>Combining data cells which may hold blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672617#M79268</link>
      <description>&lt;P&gt;Hello SAS community!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I love and appreciate all the help from this community.&amp;nbsp; I’m seeking help with the following.&amp;nbsp; I have a database containing individuals submitting information during 6 different periods.&amp;nbsp; I am looking to 1) create a new string variable (24 bytes) which combines the data together from all 6 periods (4 bytes each).&amp;nbsp; Maybe a concatenation?&amp;nbsp; However, there may be blanks during a period in which I would like to input as ‘9999’. &amp;nbsp;&amp;nbsp;&amp;nbsp;How can I do this?&amp;nbsp;&amp;nbsp; 2) I would also like to identify the individuals who submit the same receipts during different terms?&amp;nbsp;&amp;nbsp; Examples are the last two individuals (Term1 &amp;amp; Term5) (Term3 and Term6).&amp;nbsp; I would like to create a separate dataset to identify those individuals for further analysis.&amp;nbsp; Can anyone help me?&amp;nbsp; Thank you so much!!&lt;/P&gt;
&lt;TABLE width="457"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="79"&gt;ID1&lt;/TD&gt;
&lt;TD width="58"&gt;Term1&lt;/TD&gt;
&lt;TD width="64"&gt;Term2&lt;/TD&gt;
&lt;TD width="64"&gt;Term3&lt;/TD&gt;
&lt;TD width="64"&gt;Term4&lt;/TD&gt;
&lt;TD width="64"&gt;Term5&lt;/TD&gt;
&lt;TD width="64"&gt;Term6&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;a_78076&lt;/TD&gt;
&lt;TD&gt;7600&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;9875&lt;/TD&gt;
&lt;TD&gt;4388&lt;/TD&gt;
&lt;TD&gt;3709&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;er_866455&lt;/TD&gt;
&lt;TD&gt;5436&lt;/TD&gt;
&lt;TD&gt;9468&lt;/TD&gt;
&lt;TD&gt;4009&lt;/TD&gt;
&lt;TD&gt;4388&lt;/TD&gt;
&lt;TD&gt;7600&lt;/TD&gt;
&lt;TD&gt;3288&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ik_33442&lt;/TD&gt;
&lt;TD&gt;9865&lt;/TD&gt;
&lt;TD&gt;4009&lt;/TD&gt;
&lt;TD&gt;6783&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;9865&lt;/TD&gt;
&lt;TD&gt;3288&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ev_965747&lt;/TD&gt;
&lt;TD&gt;5436&lt;/TD&gt;
&lt;TD&gt;9468&lt;/TD&gt;
&lt;TD&gt;3288&lt;/TD&gt;
&lt;TD&gt;4388&lt;/TD&gt;
&lt;TD&gt;7600&lt;/TD&gt;
&lt;TD&gt;3288&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;Want output and separate dataset for the last two individuals who submitted same receipts:&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="265"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="79"&gt;a_78076&lt;/TD&gt;
&lt;TD width="58"&gt;760099999875438837099999&lt;/TD&gt;
&lt;TD width="64"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;er_866455&lt;/TD&gt;
&lt;TD&gt;543694684009438876003288&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ik_33442&lt;/TD&gt;
&lt;TD&gt;986540096783999998653288&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ev_965747&lt;/TD&gt;
&lt;TD&gt;543694683288438876003288&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 16:58:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672617#M79268</guid>
      <dc:creator>SannaSanna</dc:creator>
      <dc:date>2020-07-27T16:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Combining data cells which may hold blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672619#M79269</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    length long_string $ 24;
    array term $ term1-term6;
    do i=1 to dim(term);
        if missing(term(i)) then term(i)='9999';
    end;
    long_string = cats(of term1-term6);
    drop term1-term6 i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Next, duplicate receipts&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dup_receipts;
    set have;
    array term $ term1-term6;
    length long_string $ 24;
    flag=0;
    do i=1 to dim(term);
        if missing(term(i)) then term(i)='9999';
        if i&amp;lt;dim(term) then do j=(i+1) to dim(term);
             if term(i)=term(j) and term(i)^='9999' then flag=1;
             leave;
        end;
    end;
    long_string = cats(of term1-term6);
    if flag=1 then output;
    drop term1-term6 i j;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which brings up the question, why do you need a string of 24 digits?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 17:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672619#M79269</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-27T17:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Combining data cells which may hold blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672621#M79270</link>
      <description>&lt;P&gt;You may try next code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set have;
      keep ID1 concat;
      array tm {6} term1-term6;
      do i=1 to dim(tm);
           if missing(tm) then tm=9999;
      end;
      caoncat = cat(of term:);
end;
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Jul 2020 17:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672621#M79270</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-07-27T17:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Combining data cells which may hold blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672631#M79271</link>
      <description>Hi.  Thank you for responding.  I made attempt to use your code and I'm erroring out.  My log tells me :  ERROR:  Illegal reference to the array tm,  AND after the 'end' statement there is no matching do/select statement?   Can you re-help?</description>
      <pubDate>Mon, 27 Jul 2020 17:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672631#M79271</guid>
      <dc:creator>SannaSanna</dc:creator>
      <dc:date>2020-07-27T17:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Combining data cells which may hold blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672632#M79272</link>
      <description>Hello!  Thank you for responding.  I am also unable to successfully run the first portion of the code?   Perhaps I do not need string of 24 digits-- could that be the reason for the error message below?  &lt;BR /&gt;&lt;BR /&gt;My log gives me an error of:   WARNING: In a call to the CATS function, the buffer allocated for the result was not long enough to contain the concatenation of all the arguments. The correct&lt;BR /&gt;         result would contain 28 characters, but the actual result might either be truncated to 24 character(s) or be completely blank, depending on the calling&lt;BR /&gt;         environment. The following note indicates the left-most argument that caused truncation.&lt;BR /&gt;NOTE: Argument 7 to function CATS('9999','9999','9999','9999','9999','9999','9999') at line 703 column 19 is invalid.&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Jul 2020 17:39:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672632#M79272</guid>
      <dc:creator>SannaSanna</dc:creator>
      <dc:date>2020-07-27T17:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Combining data cells which may hold blanks</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672639#M79273</link>
      <description>Hi !!!!!      I removed the 24 digits as length and both of your codes worked exactly the way I want!  Thank you so very much!!!!!</description>
      <pubDate>Mon, 27 Jul 2020 17:46:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Combining-data-cells-which-may-hold-blanks/m-p/672639#M79273</guid>
      <dc:creator>SannaSanna</dc:creator>
      <dc:date>2020-07-27T17:46:04Z</dc:date>
    </item>
  </channel>
</rss>

