<?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 DI and Dates Parameters in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-DI-and-Dates-Parameters/m-p/714447#M27302</link>
    <description>&lt;P&gt;Guys no worries,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found the solution: I had to simply perform the transformation in the pre-code segment of the job before the macro variable assignments&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('start_date', put(&amp;amp;start_date, date9.));
call symputx('end_date', put(&amp;amp;end_date, date9.));
run;

%let load_from = &amp;amp;start_date;
%let load_to&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= &amp;amp;end_date;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="en-US"&gt;It seems that during my effort when I was describing the comment, I found out the workaround!&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="en-US"&gt;Cheers!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jan 2021 22:44:35 GMT</pubDate>
    <dc:creator>vfarmak</dc:creator>
    <dc:date>2021-01-26T22:44:35Z</dc:date>
    <item>
      <title>SAS DI and Dates Parameters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-DI-and-Dates-Parameters/m-p/714438#M27301</link>
      <description>&lt;P&gt;Greetings Everyone!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the following problem:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;I have created an job in SAS DI which receives two parameters of type Date&lt;/LI&gt;
&lt;LI&gt;The job uses many times components such Extract to filter SAS Datasets. In order to filter the SAS Dataset the following construct in the where clause is used "&amp;lt;start_date&amp;gt;"d&lt;/LI&gt;
&lt;LI&gt;The field used in the filter is of type Numeric with format Date9.&lt;/LI&gt;
&lt;LI&gt;When I try to add the following job in a Loop that contains a control table with numeric dates of type DATE9. it simply presents me the following error:&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;ERROR: Invalid date/time/datetime constant "21914"d.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems that the parameter is read, but in the extract component is read as numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To tackle the previous workaround I have tried the following solutions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Add the below line in the precode section of the job with the parameters. The following did not work (see the code below - Example 1)&lt;/LI&gt;
&lt;LI&gt;Use the sysfunc as illustrated in the example 2&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Example 1*/ 
data _null_;
call symputx('business_load_from', put(business_load_from, date9.));
call symputx('business_load_to', put(business_load_to, date9.));
run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Example 2&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let date = %sysfunc(&amp;amp;business_load_from, date9.);
%put &amp;amp;date.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Does anyone has faced the aforementioned problem?&lt;/P&gt;
&lt;P&gt;Any recommendations are welcome.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Vasileios&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 21:58:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-DI-and-Dates-Parameters/m-p/714438#M27301</guid>
      <dc:creator>vfarmak</dc:creator>
      <dc:date>2021-01-26T21:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI and Dates Parameters</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-DI-and-Dates-Parameters/m-p/714447#M27302</link>
      <description>&lt;P&gt;Guys no worries,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found the solution: I had to simply perform the transformation in the pre-code segment of the job before the macro variable assignments&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('start_date', put(&amp;amp;start_date, date9.));
call symputx('end_date', put(&amp;amp;end_date, date9.));
run;

%let load_from = &amp;amp;start_date;
%let load_to&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= &amp;amp;end_date;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="en-US"&gt;It seems that during my effort when I was describing the comment, I found out the workaround!&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;" lang="en-US"&gt;Cheers!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 22:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-DI-and-Dates-Parameters/m-p/714447#M27302</guid>
      <dc:creator>vfarmak</dc:creator>
      <dc:date>2021-01-26T22:44:35Z</dc:date>
    </item>
  </channel>
</rss>

