<?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: Summarizing long file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-long-file/m-p/877370#M346609</link>
    <description>&lt;P&gt;Sounds Like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  Flag = NOT (FEXT='csv' and FEXT2 ='XLS' and FNM1=FNM2) ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Flag will be 0 when a record meets the 'normal' condition, and will be 1 when a record is not normal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is like an assertion.&amp;nbsp; You write an expression you expect to be true, and flag the records where it is not true.&lt;/P&gt;</description>
    <pubDate>Wed, 24 May 2023 19:34:43 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2023-05-24T19:34:43Z</dc:date>
    <item>
      <title>Summarizing long file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-long-file/m-p/877355#M346603</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a long dataset that contains file "pairs." Some pairs have identical names, others have similar but not exactly the same.&amp;nbsp; I have the date, name, and ext for each file:&lt;/P&gt;
&lt;P&gt;FNM1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FDT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FEXT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FNM2&amp;nbsp; &amp;nbsp; &amp;nbsp; FDT2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FEXT2&lt;/P&gt;
&lt;P&gt;abc&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1/1/19&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; csv&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; abc&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1/1/20&amp;nbsp; &amp;nbsp; &amp;nbsp;XLS&lt;/P&gt;
&lt;P&gt;abc&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1/1/19&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; csv&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; abc_d&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2/1/20&amp;nbsp; &amp;nbsp; CSV&lt;/P&gt;
&lt;P&gt;def&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2/1/19&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; csv&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; def&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3/1/20&amp;nbsp; &amp;nbsp; &amp;nbsp;XLS&lt;/P&gt;
&lt;P&gt;ghi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3/1/19&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; csv&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ghi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4/1/20&amp;nbsp; &amp;nbsp; &amp;nbsp;XLS&lt;/P&gt;
&lt;P&gt;ghi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3/1/19&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; csv&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ghi&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5/1/20&amp;nbsp; &amp;nbsp; XLSX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I'm trying to do is flag weird cases for examination. A "normal" case that I would expect to see would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F1 is a CSV&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; F2 is an XLS with the same name (dates don't really matter here)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If anything else is going on, I'd like to flag for examination, so for example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1) F1 and F2 are both CSVs (these would have slightly different names)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2) F1 is CSV and F2 is XLSX (same name)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So basically what I'm looking to do is build an output so I can examine all cases that are not the "normal" case that I outlined above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any&amp;nbsp; help is much appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 19:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarizing-long-file/m-p/877355#M346603</guid>
      <dc:creator>Walternate</dc:creator>
      <dc:date>2023-05-24T19:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing long file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-long-file/m-p/877366#M346605</link>
      <description>&lt;P&gt;And the output should look like what exactly?&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 19:22:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarizing-long-file/m-p/877366#M346605</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-24T19:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing long file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-long-file/m-p/877369#M346608</link>
      <description>&lt;P&gt;Based on provided condition, this code will flag it.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
	length case $10;
	if strip(upcase(fnm1)) eq strip(upcase(fnm2)) then do;
		if upcase(strip(fext)) eq 'CSV' and upcase(strip(fext2)) eq 'XLS' then Case='Normal';
		else if upcase(strip(fext)) eq 'CSV' and upcase(strip(fext2)) eq 'XLSX' then Case='Not normal';
	end;
	else Case='Not normal';
proc print;run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 May 2023 19:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarizing-long-file/m-p/877369#M346608</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2023-05-24T19:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: Summarizing long file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summarizing-long-file/m-p/877370#M346609</link>
      <description>&lt;P&gt;Sounds Like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  Flag = NOT (FEXT='csv' and FEXT2 ='XLS' and FNM1=FNM2) ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Flag will be 0 when a record meets the 'normal' condition, and will be 1 when a record is not normal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is like an assertion.&amp;nbsp; You write an expression you expect to be true, and flag the records where it is not true.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 19:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summarizing-long-file/m-p/877370#M346609</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-05-24T19:34:43Z</dc:date>
    </item>
  </channel>
</rss>

