<?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 create a variable for use in a job in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711953#M219396</link>
    <description>&lt;PRE id="tw-target-text" class="tw-data-text tw-text-large XcVN5d tw-ta" dir="ltr" data-placeholder="Vertaling"&gt;&lt;SPAN&gt;I have included Kurt's solution in "SQL execute" transformation. &lt;BR /&gt;In the job, this transformation is performed first. This solution works. &lt;BR /&gt;However, if the job crashes, the variable is no longer available and the first step must be performed again.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS DIS execute.PNG" style="width: 214px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53576i329C4BDF3C7358A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS DIS execute.PNG" alt="SAS DIS execute.PNG" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 17 Jan 2021 13:11:50 GMT</pubDate>
    <dc:creator>Cugel</dc:creator>
    <dc:date>2021-01-17T13:11:50Z</dc:date>
    <item>
      <title>How to create a variable for use in a job</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711158#M219013</link>
      <description>&lt;PRE class="tw-data-text tw-text-large XcVN5d tw-ta"&gt;&lt;SPAN&gt;I want to create a variable that I can then use in any where statement. Something like this&lt;BR /&gt;
DATA CREATE_JOB_SPECIFIC_VARS;&lt;BR /&gt;%let year_filter_1 = 2019;&lt;BR /&gt;%let year_filter_2 = extract(year from sysdate)-5;&lt;BR /&gt;RUN;&lt;BR /&gt;
The intention is to create the variable in a "sql execute" or "user written" statement.&lt;BR /&gt;When I create the variable as mentioned in the example, the variable seems to have no content over time.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TEST_JOB EXAMPLE.JPG" style="width: 626px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53462iE0450D64002779C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="TEST_JOB EXAMPLE.JPG" alt="TEST_JOB EXAMPLE.JPG" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jan 2021 15:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711158#M219013</guid>
      <dc:creator>Cugel</dc:creator>
      <dc:date>2021-01-13T15:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a variable for use in a job</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711168#M219019</link>
      <description>&lt;P&gt;You do not need that data step around the macro statements; macro code is resolved before any other code is handed off to the data step compiler or any procedures.&lt;/P&gt;
&lt;P&gt;This creates and shows your macro variables:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let year_filter_1 = 2019;
%let year_filter_2 = %eval(%sysfunc(year(%sysfunc(today())))-5);
%put &amp;amp;=year_filter_1;
%put &amp;amp;=year_filter_2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt; 73         %let year_filter_1 = 2019;
 74         %let year_filter_2 = %eval(%sysfunc(year(%sysfunc(today())))-5);
 75         %put &amp;amp;=year_filter_1;
 YEAR_FILTER_1=2019
 76         %put &amp;amp;=year_filter_2;
 YEAR_FILTER_2=2016
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 15:58:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711168#M219019</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-01-13T15:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a variable for use in a job</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711243#M219065</link>
      <description>Hi Kurt, Thanks for your help.&lt;BR /&gt;I am a SAS novice and it is not entirely clear to me where I can best include the code lines in the job. In the "sql execute" or in the "user written" statement.&lt;BR /&gt;Or somewhere else in the job ?. I am not yet very familiar with the structure of SAS macros.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Jan 2021 18:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711243#M219065</guid>
      <dc:creator>Cugel</dc:creator>
      <dc:date>2021-01-13T18:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a variable for use in a job</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711247#M219067</link>
      <description>&lt;P&gt;What tool are you using to build that work flow?&amp;nbsp; Is it Enterprise Guide?&amp;nbsp; SAS/Studio? Something else?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 18:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711247#M219067</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-13T18:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a variable for use in a job</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711248#M219068</link>
      <description>Hi Tom&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for your help, we are using SAS Data Integration Studio 4.903.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Jan 2021 18:43:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711248#M219068</guid>
      <dc:creator>Cugel</dc:creator>
      <dc:date>2021-01-13T18:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a variable for use in a job</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711953#M219396</link>
      <description>&lt;PRE id="tw-target-text" class="tw-data-text tw-text-large XcVN5d tw-ta" dir="ltr" data-placeholder="Vertaling"&gt;&lt;SPAN&gt;I have included Kurt's solution in "SQL execute" transformation. &lt;BR /&gt;In the job, this transformation is performed first. This solution works. &lt;BR /&gt;However, if the job crashes, the variable is no longer available and the first step must be performed again.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS DIS execute.PNG" style="width: 214px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53576i329C4BDF3C7358A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="SAS DIS execute.PNG" alt="SAS DIS execute.PNG" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Jan 2021 13:11:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-a-variable-for-use-in-a-job/m-p/711953#M219396</guid>
      <dc:creator>Cugel</dc:creator>
      <dc:date>2021-01-17T13:11:50Z</dc:date>
    </item>
  </channel>
</rss>

