<?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: SAS arrays to keep the multiple columns blank in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-arrays-to-keep-the-multiple-columns-blank/m-p/671961#M201854</link>
    <description>&lt;P&gt;You were quite close...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data plot_data_fin;
set plot_datafin ;
if _n_ =1 then set transposed_gen_mod;
else call missing(of sepsrata:);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 23 Jul 2020 21:05:36 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2020-07-23T21:05:36Z</dc:date>
    <item>
      <title>SAS arrays to keep the multiple columns blank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-arrays-to-keep-the-multiple-columns-blank/m-p/671953#M201848</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a dateset where I need to keep the columns those are named Sepstrata1, Sepstrata2, Sepstrata3 which should have only first record as NON-EMPTY while values from second rows till End rows should go missing. Would need help to make a code to make these columns missing &lt;STRONG&gt;DYNAMICALLY.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;data plot_data_fin;
set plot_datafin ;
if _n_ =1 then set transposed_gen_mod;
array vars{3} sepsrata:;
do i=1 to 3;
if row ~=1 then vars{i}=" ";
end;
run;

All the columns in the picture comes from transposed_gen_mod. While I want other columns to be carrying the last values, except the Sepstrata: ones where I would like to keep only the first record and other rows should go missing.&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47618i6B9D1F48DC5E7D2A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic.png" alt="pic.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 20:32:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-arrays-to-keep-the-multiple-columns-blank/m-p/671953#M201848</guid>
      <dc:creator>sahoositaram555</dc:creator>
      <dc:date>2020-07-23T20:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS arrays to keep the multiple columns blank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-arrays-to-keep-the-multiple-columns-blank/m-p/671961#M201854</link>
      <description>&lt;P&gt;You were quite close...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data plot_data_fin;
set plot_datafin ;
if _n_ =1 then set transposed_gen_mod;
else call missing(of sepsrata:);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jul 2020 21:05:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-arrays-to-keep-the-multiple-columns-blank/m-p/671961#M201854</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-07-23T21:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS arrays to keep the multiple columns blank</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-arrays-to-keep-the-multiple-columns-blank/m-p/671987#M201866</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/109034"&gt;@sahoositaram555&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt; has demonstrated to you is one of the fundamental consequences of conditional set statements (i.e.&amp;nbsp; "&lt;EM&gt;&lt;STRONG&gt;if _n_=1 then set transposed_gen_mod;&lt;/STRONG&gt;&lt;/EM&gt;" ).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The variables retrieved for each execution of a SET (or MERGE) statement are, by default, retained.&amp;nbsp; We usually don't recognize this because SET is usually not conditionally executed, so for each iteration of the data step, the current SET replaces variables retrieved by the same SET in the prior iteration.&amp;nbsp;&amp;nbsp; That's why you are advised to use a "call missing" after observation 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 01:00:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-arrays-to-keep-the-multiple-columns-blank/m-p/671987#M201866</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-07-24T01:00:36Z</dc:date>
    </item>
  </channel>
</rss>

