<?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: Base SAS Check a variable for a date value and then import file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577516#M163641</link>
    <description>&lt;P&gt;Tom,&lt;/P&gt;
&lt;P&gt;The date is in this format:"20190726"&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jul 2019 20:07:27 GMT</pubDate>
    <dc:creator>Ivc</dc:creator>
    <dc:date>2019-07-29T20:07:27Z</dc:date>
    <item>
      <title>Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/576926#M163380</link>
      <description>&lt;P&gt;I have a Base SAS program that imports a 'CSV' file using the 'infile' statement without any issue. I ideally would like to check the variable 'dateto' to see if it matches today's date. If so, proceed to import the file if not stop the import. Below is my current code to import the 'csv' file. I would appreciate any help and I am not a SAS expert. Any simple code\process will be helpful.&lt;/P&gt;
&lt;P&gt;I am using SAS version 9.4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*creates a fileref for the external file*/&lt;BR /&gt;Filename ameritot '\\nyadpam\nyadpam_d\apps\CWA_Bondedge_INTMUTUALAMERI_TOT\Bondedge_upload_INTMUTUALAMERITOT.csv';&lt;BR /&gt;/* import the external file*/&lt;BR /&gt;data bondedge_upload_tot;&lt;BR /&gt;%let _EFIERR_ = 0; /* set the ERROR detection macro variable */&lt;BR /&gt;infile ameritot delimiter=',' MISSOVER DSD LRECL=32767&lt;BR /&gt;FirstOBS=2;&lt;BR /&gt;informat Date_To $10. ;&lt;BR /&gt;informat CUSIP $14. ;&lt;BR /&gt;informat Market_Price $10. ;&lt;BR /&gt;informat Portfolio $21. ;&lt;BR /&gt;informat Orig_Face $17. ;&lt;BR /&gt;informat Actual_Par $18. ;&lt;BR /&gt;informat Book_Price $10. ;&lt;BR /&gt;informat Security_Type_Description $14. ;&lt;BR /&gt;format Date_To $10. ;&lt;BR /&gt;format CUSIP $14. ;&lt;BR /&gt;format Market_Price $10. ;&lt;BR /&gt;format Portfolio $21. ;&lt;BR /&gt;format Orig_Face $17. ;&lt;BR /&gt;format Actual_Par $18. ;&lt;BR /&gt;format Book_Price $10. ;&lt;BR /&gt;format Security_Type_Description $14. ;&lt;BR /&gt;input&lt;BR /&gt;Date_To $&lt;BR /&gt;CUSIP $&lt;BR /&gt;Market_Price $&lt;BR /&gt;Portfolio $&lt;BR /&gt;Orig_Face $&lt;BR /&gt;Actual_Par $&lt;BR /&gt;Book_Price $&lt;BR /&gt;Security_Type_Description $&lt;BR /&gt;;&lt;BR /&gt;if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;IC&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 14:58:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/576926#M163380</guid>
      <dc:creator>Ivc</dc:creator>
      <dc:date>2019-07-26T14:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/576928#M163381</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15261"&gt;@Ivc&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a Base SAS program that imports a 'CSV' file using the 'infile' statement without any issue. I ideally would like to check the variable 'dateto' to see if it matches today's date. If so, proceed to import the file if not stop the import. Below is my current code to import the 'csv' file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Seems to me this is circular logic. You can't know the value of DATETO until you import the file; but then you only want to import the file if DATETO is today's date, which you won't know until you import the file. Please explain further.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 15:02:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/576928#M163381</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-26T15:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/576931#M163383</link>
      <description>&lt;P&gt;You don't do yourself any favors by reading that variable as character&lt;/P&gt;
&lt;PRE&gt;informat Date_To $10. ;&lt;/PRE&gt;
&lt;P&gt;Since you don't show anything of what that may look like we can't even really suggest how to turn it into a date value to compare to "today".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;says, there is not going to be any way to avoid reading the file because the only place the date_to exists is in that file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read it. If the "date" doesn't match then you can delete the data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your reason for not wanting to read the file is because it might replace an existing dataset when you don't want it to, then use a different dataset name on the read program, test the value from the data and if it doesn't match today then delete the data set or stop the program.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 15:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/576931#M163383</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-26T15:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/576932#M163384</link>
      <description>Do you expect date_to to be constant throughout the file? If there are multiple values how should that be dealt with?</description>
      <pubDate>Fri, 26 Jul 2019 15:12:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/576932#M163384</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-26T15:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/576937#M163388</link>
      <description>&lt;P&gt;there should be a pattern to the file being updated.&amp;nbsp; Is the task that needs to be ran monthly, daily, hourly?&amp;nbsp; Please be kind to the network interruptions you impose on your companions?&amp;nbsp; It sounds like a job scheduler task to me.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 15:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/576937#M163388</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-07-26T15:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577010#M163426</link>
      <description>&lt;P&gt;Reeza,&lt;/P&gt;
&lt;P&gt;The date will be constant throughout the file. The idea was to test the date in the file, if it fails then the file would not be imported. I guess I may have to go the route of importing and then check the resulting dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 18:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577010#M163426</guid>
      <dc:creator>Ivc</dc:creator>
      <dc:date>2019-07-26T18:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577040#M163445</link>
      <description>Is the date in the filename or anywhere else? you can just read the first observation though, you don't need to read all, then if it matches go read all conditionally. It likely needs macro logic, are you familiar with that?</description>
      <pubDate>Fri, 26 Jul 2019 18:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577040#M163445</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-26T18:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577044#M163446</link>
      <description>&lt;P&gt;Reeza,&lt;/P&gt;
&lt;P&gt;I have not develop the macro skill.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 19:01:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577044#M163446</guid>
      <dc:creator>Ivc</dc:creator>
      <dc:date>2019-07-26T19:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577045#M163447</link>
      <description>What exact version of SAS are you using right now? The later versions have some different rules which affects how this needs to be coded. For example are you on 9.4 M5?&lt;BR /&gt;&lt;BR /&gt;You can check it by using the following and the information is in the log. &lt;BR /&gt;&lt;BR /&gt;proc product_status;run;</description>
      <pubDate>Fri, 26 Jul 2019 19:05:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577045#M163447</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-26T19:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577047#M163448</link>
      <description>&lt;P&gt;Reeza,&lt;/P&gt;
&lt;P&gt;Here is the version info:&lt;/P&gt;
&lt;P&gt;For Base SAS Software ...&lt;/P&gt;
&lt;P&gt;Custom version information: 9.4_M2&lt;/P&gt;
&lt;P&gt;Image version information: 9.04.01M2P072314&lt;/P&gt;
&lt;P&gt;For SAS/ACCESS Interface to ODBC ...&lt;/P&gt;
&lt;P&gt;Custom version information: 9.4_M2&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 19:09:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577047#M163448</guid>
      <dc:creator>Ivc</dc:creator>
      <dc:date>2019-07-26T19:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577054#M163450</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. change the first step to read just the date, because it's the first variable this is doable and easy. Also set the obs=2 to read only the first one or two records. I can't recall the interaction between firstobs and OBS so setting it to 2 is safer. (Orange below)&lt;/P&gt;
&lt;P&gt;2. Read the date in as a SAS date, not a character so you can test it correctly. (Purple)&lt;/P&gt;
&lt;P&gt;3. Create a macro variable from the date to use in the next step (Blue)&lt;/P&gt;
&lt;P&gt;4. Test that the macro variable is created (Pink)&lt;/P&gt;
&lt;P&gt;5. Macro to conditionally read in data (Red)&lt;/P&gt;
&lt;P&gt;6. Execute macro (Green)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH, if not, post back exactly the code you ran and the errors you're getting. Untested because of time and no data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Filename ameritot '\\nyadpam\nyadpam_d\apps\CWA_Bondedge_INTMUTUALAMERI_TOT\Bondedge_upload_INTMUTUALAMERITOT.csv';
/* import the external file*/
data _null_;

infile ameritot delimiter=',' MISSOVER DSD LRECL=32767 FirstOBS=2 &lt;FONT size="4" color="#FF6600"&gt;&lt;STRONG&gt;OBS=2;&lt;/STRONG&gt;&lt;/FONT&gt;
&lt;FONT size="4" color="#800080"&gt;&lt;STRONG&gt;informat Date_To yymmdd10. ;
format Date_To yymmdd10. ;&lt;/STRONG&gt;&lt;/FONT&gt;


input Date_To $
;

&lt;FONT size="4" color="#0000FF"&gt;&lt;STRONG&gt;call symputx("dateFromFile", date_to);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;
run;

&lt;FONT size="4"&gt;&lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;*test macro variable is created and has a value. Will look like a number in the log;
%put &amp;amp;dateFromFile.;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;
&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;%macro readFile(date_to = );&lt;/STRONG&gt;&lt;/FONT&gt;
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;%if &amp;amp;date_to = %sysfunc(today()) %then %do;&lt;/STRONG&gt;&lt;/FONT&gt;

***********************
*Import code goes here*
***********************;


&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;%readFile(date_to = &amp;amp;dateFromFile.);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15261"&gt;@Ivc&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Reeza,&lt;/P&gt;
&lt;P&gt;Here is the version info:&lt;/P&gt;
&lt;P&gt;For Base SAS Software ...&lt;/P&gt;
&lt;P&gt;Custom version information: 9.4_M2&lt;/P&gt;
&lt;P&gt;Image version information: 9.04.01M2P072314&lt;/P&gt;
&lt;P&gt;For SAS/ACCESS Interface to ODBC ...&lt;/P&gt;
&lt;P&gt;Custom version information: 9.4_M2&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 19:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577054#M163450</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-26T19:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577060#M163452</link>
      <description>&lt;P&gt;That is one ugly data step. Looks like it was generated by PROC IMPORT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the optional CANCEL option on the RUN statement prevent the data step from running.&amp;nbsp; That way you can control wheter it runs without having to learn how to generate code conditionally.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just read enough of the file to check it you want to really read it or not and set a macro variable. Might be best to make the default be to NOT run the step and only run it when the file pases the test.&amp;nbsp; Then an empty file will not try to be read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename ameritot '\\nyadpam\nyadpam_d\apps\CWA_Bondedge_INTMUTUALAMERI_TOT\Bondedge_upload_INTMUTUALAMERITOT.csv';

%let run_cancel=CANCEL ;
data _null_;
  infile ameritot firstobs=2 obs=3 dsd ;
  input date_to :$10. ;
  if input(date_to,??anydtdte.) = today() then call symputx('run_cancel',' ');
run;

data bondedge_upload_tot;
  infile ameritot dsd truncover firstobs=2 ;
  length Date_To $10 CUSIP $14 Market_Price $10 Portfolio $21
         Orig_Face $17 Actual_Par $18 Book_Price $10 Security_Type_Description $14
  ;
  input Date_To -- Security_Type_Description;
run &amp;amp;run_cancel ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 19:43:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577060#M163452</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-26T19:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577062#M163454</link>
      <description>The CANCEL option is a nifty little trick, still learning new things &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Fri, 26 Jul 2019 19:39:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577062#M163454</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-26T19:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577063#M163455</link>
      <description>&lt;P&gt;Reeza,&lt;/P&gt;
&lt;P&gt;I am attaching the log and the program I ran.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 19:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577063#M163455</guid>
      <dc:creator>Ivc</dc:creator>
      <dc:date>2019-07-26T19:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577064#M163456</link>
      <description>&lt;P&gt;Here is the log&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 19:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577064#M163456</guid>
      <dc:creator>Ivc</dc:creator>
      <dc:date>2019-07-26T19:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577065#M163457</link>
      <description>&lt;P&gt;SAS logs (and programs) are just text, no need to attach them. Just use the Insert Code button (looks like {i})&amp;nbsp;on the menu bar to get a pop-up window where you can paste the lines of text.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 19:45:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577065#M163457</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-26T19:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577066#M163458</link>
      <description>&lt;P&gt;You appear to be trying to reference a value you have not read yet.&lt;/P&gt;
&lt;PRE&gt;641  call symputx("dateFromFile", date_to);
642
643  input Date_To $
644  ;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jul 2019 19:46:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577066#M163458</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-26T19:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577067#M163459</link>
      <description>Check the revised code in previous post - I cannot open attachment so going off what Tom posted. &lt;BR /&gt;&lt;BR /&gt;Calculations can go after INPUT but need to be before DATALINES, which was my mistake.</description>
      <pubDate>Fri, 26 Jul 2019 19:52:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577067#M163459</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-26T19:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577504#M163636</link>
      <description>&lt;P&gt;Reeza,&lt;/P&gt;
&lt;P&gt;I would like to be able put a -1 or so where I can check a date less than today:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;%if &amp;amp;date_to = %sysfunc(today()) %then %do;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jul 2019 19:43:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577504#M163636</guid>
      <dc:creator>Ivc</dc:creator>
      <dc:date>2019-07-29T19:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS Check a variable for a date value and then import file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577508#M163638</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;date_to = %eval(%sysfunc(today()) - 1) %then %do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Wrap it in %EVAL() to tell SAS to evaluate the value. You can also use INTNX() but in this case subtracting one is easy enough.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15261"&gt;@Ivc&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Reeza,&lt;/P&gt;
&lt;P&gt;I would like to be able put a -1 or so where I can check a date less than today:&lt;/P&gt;
&lt;PRE&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;%if &amp;amp;date_to = %sysfunc(today()) %then %do;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 19:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Base-SAS-Check-a-variable-for-a-date-value-and-then-import-file/m-p/577508#M163638</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-29T19:50:02Z</dc:date>
    </item>
  </channel>
</rss>

