<?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: Can I define global variables to a project across process flows? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-define-global-variables-to-a-project-across-process-flows/m-p/412952#M26553</link>
    <description>&lt;P&gt;Hi, Rita&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad to see you're persevering with SAS!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Prompts are converted into macro variables, which are defined on the SAS server that your code is executed on. I don't have any way to test it, but I believe that as long as your different process flows are using the same SAS server, and it's not being reset, your macro variable definitions should remain active.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure that if you have the option you select that the prompt results are "global" and that they should be "used by all of the programs".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it was me, I'd set up a quick test to confirm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Mon, 13 Nov 2017 16:26:40 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2017-11-13T16:26:40Z</dc:date>
    <item>
      <title>Can I define global variables to a project across process flows?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-define-global-variables-to-a-project-across-process-flows/m-p/412939#M26552</link>
      <description>&lt;P&gt;I have a project that has several different process flows.&amp;nbsp; All process flows are filtered by a common date range.&amp;nbsp; Can I define the date range one time and have it referenced by each of the process flows?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Enterprise Guide GUI and am a novice when it comes to SAS.&amp;nbsp; I am trying to apply techniques/logic used in other programs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help you can provide is appreciated!!&lt;/P&gt;&lt;P&gt;tia &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rita Yee&lt;/P&gt;&lt;P&gt;Project Engineer&lt;/P&gt;&lt;P&gt;FedEx Express&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 15:37:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-define-global-variables-to-a-project-across-process-flows/m-p/412939#M26552</guid>
      <dc:creator>RPYee</dc:creator>
      <dc:date>2017-11-13T15:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I define global variables to a project across process flows?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-define-global-variables-to-a-project-across-process-flows/m-p/412952#M26553</link>
      <description>&lt;P&gt;Hi, Rita&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad to see you're persevering with SAS!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Prompts are converted into macro variables, which are defined on the SAS server that your code is executed on. I don't have any way to test it, but I believe that as long as your different process flows are using the same SAS server, and it's not being reset, your macro variable definitions should remain active.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure that if you have the option you select that the prompt results are "global" and that they should be "used by all of the programs".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it was me, I'd set up a quick test to confirm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 16:26:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-define-global-variables-to-a-project-across-process-flows/m-p/412952#M26553</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-11-13T16:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can I define global variables to a project across process flows?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-define-global-variables-to-a-project-across-process-flows/m-p/412968#M26554</link>
      <description>&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;Thanks for your help Tom! I am so very new to SAS and am trying to find my way around without a map &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;My reports will take the previous week data results and compare them to the average of the previous 13 weeks.&amp;nbsp; We have a date table that assigns day number, week number, month number, etc to each operating day.&amp;nbsp; My first step is to pass the current date to that table to retrieve the current “week number”. &amp;nbsp;&amp;nbsp;I then use that result to calculate the input parameters for the remaining processes, with the “Starting Week Number” = Current week – 14 and the “Ending Week Number” = Current week – 1.&amp;nbsp; Right now, I have to change the filter for the other 5 or 6 process flows.&amp;nbsp; I’d like to run the first process flow and have the remaining process flows reference the results.&amp;nbsp; I am using the same server for all of the process flows, but I have no clue how to reference anything stored there and I honestly don’t think I am writing anything to it.&amp;nbsp; We typically only have “read” capability, so anything returned would be local…&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;If you can think of a better way for me to handle the process, I’m certainly open to suggestions!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="margin: 0px; color: #1f497d; font-family: 'Calibri',sans-serif; font-size: 11pt;"&gt;Rita &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 17:31:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-define-global-variables-to-a-project-across-process-flows/m-p/412968#M26554</guid>
      <dc:creator>RPYee</dc:creator>
      <dc:date>2017-11-13T17:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can I define global variables to a project across process flows?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-define-global-variables-to-a-project-across-process-flows/m-p/413028#M26555</link>
      <description>&lt;P&gt;Hi, Rita&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's hard to tell exactly what you need from your post, so I've written a short program that may give an example of some of the stuff you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created a date prompt named "Date_Prompt", and ticked the "Use prompt value throughout project" box.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This program does some manipulation with the date, and then in a different step uses it to select records. Take a look at the program, and try running it, and that will probably bring up a bunch more questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note there are SAS functions DAY, MONTH, and YEAR that return those respective values from a SAS date value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;

/* Get the value of the prompt...treat it as a character string */
DV = "&amp;amp;Date_Prompt.";

/* Convert the character string date to a SAS date value */
Date_Number = input(DV, date9.);
/* This would have worked also...
Date_Number = input("&amp;amp;Date_Prompt.", date9.);
*/

/* This will be the same number, but with a format applied, so it looks like a date when printed */
Date_Number_Formatted = Date_Number;
format Date_Number_Formatted date.;

/* Write all three values to the log */
putlog DV= Date_Number= Date_Number_Formatted=;

/* Set up a global macro variable to use in another step */
%global Date_To_Match;

/* Set the date to a week earlier than the prompt */
Numeric_Date_To_Match = Date_Number - 7;

/* Write it to the log */
/* Should be one week earlier than you specified in your prompt */
putlog Numeric_Date_To_Match=;

/* Store it in the macro variable */
call symput("Date_To_Match", put(Numeric_Date_To_Match, best15.));

run;

/* Now run a PROC SQL as a different step, using the macro variable we just created */
/* 1Mar2004 will find a match, so enter a date of 8Mar2004 when prompted */
proc sql;
create table work.Extract as
select * from sashelp.stocks
where Date = &amp;amp;Date_To_Match.;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Nov 2017 19:58:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-define-global-variables-to-a-project-across-process-flows/m-p/413028#M26555</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-11-13T19:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can I define global variables to a project across process flows?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-define-global-variables-to-a-project-across-process-flows/m-p/799895#M40335</link>
      <description>Tom, thank you for your very clear help with the code for this question. With a few adjustments, I think I will be able to capture what I need and pass it to name my exported files, even when my query does not turn up any rows.&lt;BR /&gt;Rita, thank you for raising this topic. I've been looking for a solution like this for passing the user entry so that I can reference it during the export.</description>
      <pubDate>Thu, 03 Mar 2022 16:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-define-global-variables-to-a-project-across-process-flows/m-p/799895#M40335</guid>
      <dc:creator>cbrook</dc:creator>
      <dc:date>2022-03-03T16:05:06Z</dc:date>
    </item>
  </channel>
</rss>

