<?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: Multiple programs using multiple Stored Process which always use the same date in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342455#M22671</link>
    <description>&lt;P&gt;The main problem you have here is the internal and external representation of dates in SAS. When you refer to&amp;nbsp;&lt;EM&gt;"17dec2016"d&lt;/EM&gt;, internally it's stored as&amp;nbsp;&lt;EM&gt;20805&lt;/EM&gt;. So when you try to process&amp;nbsp;&lt;EM&gt;"20805"d&lt;/EM&gt;, SAS doesn't like it. &amp;nbsp;The other reason SAS doesn't like it is because you're referring to&amp;nbsp;&lt;EM&gt;weekend&lt;/EM&gt; which is never populated, either as a SAS or macro variable!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, if the answer to your prompt&amp;nbsp;is&amp;nbsp;&lt;EM&gt;17dec2016&lt;/EM&gt;, then you probably should keep it like that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's the case, get rid of your first data step, and modify your second one to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Work.SSW;
	Set Cartel.preagent_tel;
	Keep Week_end_dt EVENT_DT PROGRAMME_NM SERVICE_NM CLUSTER CALLS_ANSWERED_CNT
		CALLS_ABANDONED_CNT TOTAL_ANSWER_TM MBL
		;
	Where week_end_dt = "&amp;amp;excel_date_prompt"d
		and CALL_TYPE = 'External'
		and PROGRAMME_NM IN ("1.1 SSW");

	
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The value of&amp;nbsp;&lt;EM&gt;excel_date_prompt&lt;/EM&gt; will carry across all the steps in your project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If, BTW, the prompt is returning&amp;nbsp;&lt;EM&gt;20805&lt;/EM&gt;, make it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Where week_end_dt = &amp;amp;excel_date_prompt&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Mar 2017 04:04:58 GMT</pubDate>
    <dc:creator>LaurieF</dc:creator>
    <dc:date>2017-03-20T04:04:58Z</dc:date>
    <item>
      <title>Multiple programs using multiple Stored Process which always use the same date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342436#M22669</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data work.save_Prompt;

Prompt = "Weekend";
Value = "&amp;amp;Excel_Date_Prompt."d;
Output;

Format Weekend Date.;

Run;


Data Work.SSW;
	Set Cartel.preagent_tel;
	Keep Week_end_dt EVENT_DT PROGRAMME_NM SERVICE_NM CLUSTER CALLS_ANSWERED_CNT
		CALLS_ABANDONED_CNT TOTAL_ANSWER_TM MBL
		;
	Where week_end_dt = "&amp;amp;Weekend."d
		and CALL_TYPE = 'External'
		and PROGRAMME_NM IN ("1.1 SSW");

	
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is the code I have used so far but I get the following error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;42&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Where week_end_dt = "&amp;amp;Weekend."d&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;WARNING: Apparent symbolic reference WEEKEND not resolved.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR: Invalid date/time/datetime constant "&amp;amp;Weekend."d.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;43&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;and CALL_TYPE = 'External'&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;44&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;and PROGRAMME_NM IN ("1.1 SSW");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR: Syntax error while parsing WHERE clause.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have several programs, in onme project,&amp;nbsp;which use a&amp;nbsp;stored process for which I use to enter the date I need data for. I run these programs c&lt;FONT color="#000000" face="Calibri" size="3"&gt;onsecutively and&amp;nbsp;I have to select the date for each program (Same date for each program)&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EG. Where week_end_dt = "&amp;amp;Excel_Date_Prompt."d&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way of writing a macro that I can use that I only enter the date from the stored process and it then filters to the other programs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this makes sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 03:14:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342436#M22669</guid>
      <dc:creator>DME790</dc:creator>
      <dc:date>2017-03-20T03:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple programs using multiple Stored Process which always use the same date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342455#M22671</link>
      <description>&lt;P&gt;The main problem you have here is the internal and external representation of dates in SAS. When you refer to&amp;nbsp;&lt;EM&gt;"17dec2016"d&lt;/EM&gt;, internally it's stored as&amp;nbsp;&lt;EM&gt;20805&lt;/EM&gt;. So when you try to process&amp;nbsp;&lt;EM&gt;"20805"d&lt;/EM&gt;, SAS doesn't like it. &amp;nbsp;The other reason SAS doesn't like it is because you're referring to&amp;nbsp;&lt;EM&gt;weekend&lt;/EM&gt; which is never populated, either as a SAS or macro variable!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, if the answer to your prompt&amp;nbsp;is&amp;nbsp;&lt;EM&gt;17dec2016&lt;/EM&gt;, then you probably should keep it like that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's the case, get rid of your first data step, and modify your second one to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Work.SSW;
	Set Cartel.preagent_tel;
	Keep Week_end_dt EVENT_DT PROGRAMME_NM SERVICE_NM CLUSTER CALLS_ANSWERED_CNT
		CALLS_ABANDONED_CNT TOTAL_ANSWER_TM MBL
		;
	Where week_end_dt = "&amp;amp;excel_date_prompt"d
		and CALL_TYPE = 'External'
		and PROGRAMME_NM IN ("1.1 SSW");

	
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The value of&amp;nbsp;&lt;EM&gt;excel_date_prompt&lt;/EM&gt; will carry across all the steps in your project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If, BTW, the prompt is returning&amp;nbsp;&lt;EM&gt;20805&lt;/EM&gt;, make it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Where week_end_dt = &amp;amp;excel_date_prompt&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 04:04:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342455#M22671</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2017-03-20T04:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple programs using multiple Stored Process which always use the same date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342463#M22672</link>
      <description>&lt;P&gt;Thanks Laurie&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Work.SSW;
	Set Cartel.preagent_telephony;
	Keep Week_end_dt EVENT_DT PROGRAMME_NM SERVICE_NM CLUSTER CALLS_ANSWERED_CNT
		CALLS_ABANDONED_CNT TOTAL_ANSWER_TM MBL
		;
	Where week_end_dt = "&amp;amp;Excel_Date_Prompt."d
		and CALL_TYPE = 'External'
		and PROGRAMME_NM IN ("1.1 SSW");
	
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is my working code. The problem I have is when I run all the programs in the project each one loads the prompt and I have to select the date again&amp;nbsp; - I would like to stop the Prompt loading for each program. I have used the&lt;/P&gt;&lt;P&gt;&lt;IMG title="Capture.PNG" alt="Capture.PNG" src="https://communities.sas.com/t5/image/serverpage/image-id/7833i2FE1C6471D484213/image-size/original?v=1.0&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this doesn't load any data for me.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 04:37:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342463#M22672</guid>
      <dc:creator>DME790</dc:creator>
      <dc:date>2017-03-20T04:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple programs using multiple Stored Process which always use the same date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342485#M22674</link>
      <description>&lt;P&gt;Ah - sorry. I hope someone else with EG access can help - SAS Studio doesn't have that functionality, and it's been ages since I used EG prompts.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 07:42:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342485#M22674</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2017-03-20T07:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple programs using multiple Stored Process which always use the same date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342645#M22687</link>
      <description>&lt;P&gt;First, a question. You say you're using a "stored process" to set the date, but it looks like you're just using an EG prompt. I'm assuming the latter is the case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I think you're describing works perfectly for me:&lt;/P&gt;
&lt;P&gt;1. Set up a prompt using Prompt Manager.&lt;/P&gt;
&lt;P&gt;2. Create three programs that use the macro variable created by the prompt.&lt;/P&gt;
&lt;P&gt;3. In the Program Properties for the first program, associate it with the prompt.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I run Program 1, it asks for the prompt, and the macro variable in the program has the correct value.&lt;/P&gt;
&lt;P&gt;When I run Program2 and Program3, no prompt, and the macro variable in the program has the correct value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that what you're after?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Tom&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 15:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342645#M22687</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-03-20T15:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple programs using multiple Stored Process which always use the same date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342770#M22700</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My apologies, yes I'm using a prompt to get the date - the stored process is to get the data to Excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you have decscribe is what I'm after - When I run the stored process in Excel I the prompt is shown for each program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there antway around this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dean&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 21:33:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342770#M22700</guid>
      <dc:creator>DME790</dc:creator>
      <dc:date>2017-03-20T21:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple programs using multiple Stored Process which always use the same date</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342787#M22701</link>
      <description>&lt;P&gt;Okay, now it's starting to become clearer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand correctly, you are creating a stored process so that you can run it from Excel. And the issue is to have the value returned from the prompt available for more than one program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My next question. Are you creating Program1, Program2, and Program3 as three separate stored processes, and running them one at a time from Excel?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 22:56:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-programs-using-multiple-Stored-Process-which-always-use/m-p/342787#M22701</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-03-20T22:56:43Z</dc:date>
    </item>
  </channel>
</rss>

