<?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: Compare modified date between SAS dataset and CSV files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Compare-modified-date-between-SAS-dataset-and-CSV-files/m-p/404294#M279008</link>
    <description>&lt;P&gt;You can use the FINFO function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0vegoaf5t6s31n1wu1qok4swqye.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0vegoaf5t6s31n1wu1qok4swqye.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to get the paths see the SAS 9.4 macro appendix fir an example.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Oct 2017 14:44:08 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-10-15T14:44:08Z</dc:date>
    <item>
      <title>Compare modified date between SAS dataset and CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-modified-date-between-SAS-dataset-and-CSV-files/m-p/404245#M279004</link>
      <description>&lt;P&gt;Would like to compare the modified date between SAS dataset and csv file and ensure both are correct. Output when there is any difference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS datasets are there in one folder. CSV files are there in another folder for a study---One parent study folder and two sub folders for sas datasets and CSv files. Likewise many parent folders are there (200+).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally csv files are the converted files for the respective dataset. We would like to know the modified date by comparing each and output if there is any difference in date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please help me on this. Thanks very much for your support inadvance.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2017 21:21:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-modified-date-between-SAS-dataset-and-CSV-files/m-p/404245#M279004</guid>
      <dc:creator>Jinu302000</dc:creator>
      <dc:date>2017-10-14T21:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Compare modified date between SAS dataset and CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-modified-date-between-SAS-dataset-and-CSV-files/m-p/404261#M279005</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/171712"&gt;@Jinu302000&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;What are these&amp;nbsp;&lt;EM&gt;modified date&lt;/EM&gt;? Is this a date column in your data or are you talking about the file modification date? If it's the file modification date then how could that ever be the same&amp;nbsp;for the .csv source and the target SAS data set?&lt;/P&gt;</description>
      <pubDate>Sun, 15 Oct 2017 02:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-modified-date-between-SAS-dataset-and-CSV-files/m-p/404261#M279005</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-10-15T02:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Compare modified date between SAS dataset and CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-modified-date-between-SAS-dataset-and-CSV-files/m-p/404279#M279006</link>
      <description>&lt;P&gt;Thanks Patrick for your prompt response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, it is file modification date.&lt;/P&gt;&lt;P&gt;Note:- We are not looking any data in the files columns. We are considering only file modification date present in the folder level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When we execute the program for a requirement, we will get output as sas dataset&amp;nbsp;in one folder and csv file in another folder. The file modified date should be on the same date (we are not considering the time).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's say when we execute a program called Test (SAS system program), then we will get output as Test_JJ.sas in one folder and Test_JJ.csv in another folder as mentioned below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clean case:- File modified date should match with sas dataset and csv file for respective file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;location for sas dataset:-&amp;nbsp;\Customers\Projects\YYY\162111\SAS_dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:-&lt;/P&gt;&lt;P&gt;File&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; date modified&lt;/P&gt;&lt;P&gt;Test_JJ.sas&amp;nbsp; &amp;nbsp; &amp;nbsp;10/10/2017 1:15AM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;location for csv files:- \Customers\Projects\YYY\162111\SAS_text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;File&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;date modified&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Test_JJ.csv&amp;nbsp; &amp;nbsp; &amp;nbsp;10/10/2017&amp;nbsp; 1:17AM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While executing the program, both files will generate on the same date with different time period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dirty case:- If there is any difference in file 'date modified' between SAS dataset and CSV file, then it should output.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:-&lt;/P&gt;&lt;P&gt;location for sas dataset:-&amp;nbsp;\Customers\Projects\YYY\162111\SAS_dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;File&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; date modified&lt;/P&gt;&lt;P&gt;Test_RR.sas&amp;nbsp; &amp;nbsp; &amp;nbsp;14/10/2017 1:15AM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;location for csv files:-&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;\Customers\Projects\YYY\162111\SAS_text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;File&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;date modified&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Test_RR.csv&amp;nbsp; &amp;nbsp; &amp;nbsp;15/10/2017&amp;nbsp; 1:17AM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here date modified is mismatching (14/10/2017 for Test_RR.sas vs 15/10/2017 for Test_RR.csv) for the respective csv and sas file and hence this should output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate if you could help me on this. Thanks very much Patrick for your time on this.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Oct 2017 08:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-modified-date-between-SAS-dataset-and-CSV-files/m-p/404279#M279006</guid>
      <dc:creator>Jinu302000</dc:creator>
      <dc:date>2017-10-15T08:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Compare modified date between SAS dataset and CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-modified-date-between-SAS-dataset-and-CSV-files/m-p/404280#M279007</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/171712"&gt;@Jinu302000&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I guess you will have to create a directory listing and then read the data into a SAS tables. Then compare the records in the tables (i.e. join over filename without extension and compare the dates).&lt;/P&gt;
&lt;P&gt;I'm using Windows so below sample code for Windows using the DIR command. You can do something similar with the UNIX LS command.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let rootPath=c:\temp;
data textFiles SASTables;
  
  infile  "dir /tw &amp;amp;rootPath\*.txt" pipe end=last truncover dlm=' ';
  do until(last);
    input dt ?? :ddmmyy10. _d1:$1. _d1:$1. _d1:$1. name $100.;
    format dt date9.;
    if not missing(dt) then output textFiles;
  end;

  last=0;
  infile  "dir /tw &amp;amp;rootPath\*.sas7bdat" pipe end=last truncover dlm=' ';
  do until(last);
    input dt ?? :ddmmyy10. _d1:$1. _d1:$1. _d1:$1. name $100.;
    format dt date9.;
    if not missing(dt) then output SASTables;
  end;

  drop _:;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 239px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15903i2E3929806C55E40B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;N.B: You will need option XCMD set for this to work. If NOXCMD is set and you can't change it then either run the code in batch where you can pass in options (-XCMD) or Google a bit to find the code which allows you to list a directory with SAS even if you're not allowed to directly issue OS commands.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Oct 2017 09:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-modified-date-between-SAS-dataset-and-CSV-files/m-p/404280#M279007</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-10-15T09:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Compare modified date between SAS dataset and CSV files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-modified-date-between-SAS-dataset-and-CSV-files/m-p/404294#M279008</link>
      <description>&lt;P&gt;You can use the FINFO function.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0vegoaf5t6s31n1wu1qok4swqye.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0vegoaf5t6s31n1wu1qok4swqye.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to get the paths see the SAS 9.4 macro appendix fir an example.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Oct 2017 14:44:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-modified-date-between-SAS-dataset-and-CSV-files/m-p/404294#M279008</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-15T14:44:08Z</dc:date>
    </item>
  </channel>
</rss>

