<?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 execute a proc compare in a Kernel Script on a Unix server in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/973900#M46140</link>
    <description>&lt;P&gt;PROC COMPARE compare SAS data sets, not flat files.&lt;/P&gt;
&lt;P&gt;To be able to compare those files, you need to import them back again into SAS.&lt;/P&gt;
&lt;P&gt;You could try to add a PROC COMPARE step for the data sets that is the basis for the files, depending on how they are created of course.&lt;/P&gt;
&lt;P&gt;Maybe you could look at UNIX commands as &lt;EM&gt;diff&lt;/EM&gt; and &lt;EM&gt;comm&lt;/EM&gt; instead?&lt;/P&gt;</description>
    <pubDate>Tue, 02 Sep 2025 14:26:26 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2025-09-02T14:26:26Z</dc:date>
    <item>
      <title>How to execute a proc compare in a Kernel Script on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/973899#M46139</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to run the following Kernel script and it works perfectly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;#!/bin/bash
rm -f path1/log/*.log
rm -f path1/data/*.sas7bdat
rm -f path1/output/*.txt
cd path1/saspgm/
sas -sysparm '20250131#' path1/saspgm/HYFI_INTExpSF.sas -log path1/log/Hyfiprep_202501.log
sas -sysparm '20250228#' path1/saspgm/HYFI_INTExpSF.sas -log path1/log/Hyfiprep_202502.log
sas -sysparm '20250331#' path1/saspgm/HYFI_INTExpSF.sas -log path1/log/Hyfiprep_202503.log
sas -sysparm '20250430#' path1/saspgm/HYFI_INTExpSF.sas -log path1/log/Hyfiprep_202504.log
sas -sysparm '20250531#' path1/saspgm/HYFI_INTExpSF.sas -log path1/log/Hyfiprep_202505.log
sas -sysparm '20250630#' path1/saspgm/HYFI_INTExpSF.sas -log path1/log/Hyfiprep_202506.log
sas -sysparm '20250731#' path1/saspgm/HYFI_INTExpSF.sas -log path1/log/Hyfiprep_202507.log&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When all the HYFI_INTExpSF.sas are executed, many output file are produced like:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;path1/output/HyFIPrems202501.txt
path1/output/HyFIPrems202502.txt
path1/output/HyFIPrems202503.txt
path1/output/HyFIPrems202504.txt
path1/output/HyFIPrems202505.txt
path1/output/HyFIPrems202506.txt
path1/output/HyFIPrems202507.txt&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Similar file already exist like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;path2/output/HyFIPrems202501.txt
path2/output/HyFIPrems202502.txt
path2/output/HyFIPrems202503.txt
path2/output/HyFIPrems202504.txt
path2/output/HyFIPrems202505.txt
path2/output/HyFIPrems202506.txt
path2/output/HyFIPrems202507.txt&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then when the output files are generated, I would like to execute a proc compare like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sas proc compare base=&lt;CODE class=" language-sas"&gt;path1/output/HyFIPrems202501.txt&amp;nbsp;compare&amp;nbsp;=path2/output/HyFIPrems202501.txt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;run;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;How&amp;nbsp;to&amp;nbsp;declare&amp;nbsp;two&amp;nbsp;libname&amp;nbsp;in&amp;nbsp;a&amp;nbsp;Kernel&amp;nbsp;Script&amp;nbsp;and&amp;nbsp;excute&amp;nbsp;successive&amp;nbsp;proc&amp;nbsp;compare&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 14:16:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/973899#M46139</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2025-09-02T14:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute a proc compare in a Kernel Script on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/973900#M46140</link>
      <description>&lt;P&gt;PROC COMPARE compare SAS data sets, not flat files.&lt;/P&gt;
&lt;P&gt;To be able to compare those files, you need to import them back again into SAS.&lt;/P&gt;
&lt;P&gt;You could try to add a PROC COMPARE step for the data sets that is the basis for the files, depending on how they are created of course.&lt;/P&gt;
&lt;P&gt;Maybe you could look at UNIX commands as &lt;EM&gt;diff&lt;/EM&gt; and &lt;EM&gt;comm&lt;/EM&gt; instead?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 14:26:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/973900#M46140</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2025-09-02T14:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute a proc compare in a Kernel Script on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/973901#M46141</link>
      <description>If you are generating text files (*.txt), they you would be better off using Linux native tools for comparing these text file, such as &lt;BR /&gt;$diff file1 file2&lt;BR /&gt;&lt;BR /&gt;Hope this helps</description>
      <pubDate>Tue, 02 Sep 2025 14:26:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/973901#M46141</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2025-09-02T14:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute a proc compare in a Kernel Script on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/973907#M46142</link>
      <description>I agree with you that the diff function could be use. But my colleages are famillar with proc compare</description>
      <pubDate>Tue, 02 Sep 2025 15:25:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/973907#M46142</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2025-09-02T15:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute a proc compare in a Kernel Script on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/973927#M46143</link>
      <description>&lt;P&gt;What you show is a shell script.&amp;nbsp;&lt;A href="https://github.com/multikernel/kernelscript" target="_blank" rel="noopener"&gt;Kernelscript&lt;/A&gt;&amp;nbsp;is something completely different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maxims 14 &amp;amp; 15:&lt;/P&gt;
&lt;P&gt;14: Use the Right Tool&lt;/P&gt;
&lt;P&gt;Which, in this case, is the UNIX utility &lt;FONT face="courier new,courier"&gt;diff&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;15: Know Your Playing Field&lt;/P&gt;
&lt;P&gt;In this case, UNIX and the gazillion of powerful tools coming with it, of which &lt;FONT face="courier new,courier"&gt;diff&lt;/FONT&gt; is one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Great programmers have already thrown their skills into giving you a superb text comparison tool; use it.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2025 19:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/973927#M46143</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-09-02T19:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute a proc compare in a Kernel Script on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/974004#M46144</link>
      <description>&lt;P&gt;As Linus pointed out, proc compare does not compare flat txt file,it just compare sas dataset.&lt;/P&gt;
&lt;P&gt;So firstly you need to change these txt file into sas dataset and then invoke PROC COMPARE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data a;
infile 'path1/output/HyFIPrems202501.txt' length=len;
input x $varying200. len;
run;

data b;
infile 'path2/output/HyFIPrems202501.txt' length=len;
input x $varying200. len;
run;

proc compare base=a compare=b transpose brief;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Sep 2025 07:30:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/974004#M46144</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-09-03T07:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to execute a proc compare in a Kernel Script on a Unix server</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/974012#M46145</link>
      <description>&lt;P&gt;We can't know what your&amp;nbsp;SAS scripts like HYFI_INTExpSF.sas are actually doing but if the create text files then it's highly likely that they use a SAS table as source to create these text files.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As others already mentioned Proc Compare works on SAS tables and not text files. If your current scripts create these text files as a 1:1 export from SAS tables AND if these SAS tables are permanent, then you could of course write another SAS script that uses Proc Compare and compares the source SAS tables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 08:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-execute-a-proc-compare-in-a-Kernel-Script-on-a-Unix/m-p/974012#M46145</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2025-09-03T08:42:01Z</dc:date>
    </item>
  </channel>
</rss>

