<?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: Difference between SAS DIS and Batch in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/570564#M11972</link>
    <description>If the 'obs=max' post solved your issue, please mark that message as the solution. So that others know exactly message resolved your issue, if they encounter it as well.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Tue, 02 Jul 2019 13:54:32 GMT</pubDate>
    <dc:creator>tsap</dc:creator>
    <dc:date>2019-07-02T13:54:32Z</dc:date>
    <item>
      <title>Difference between SAS DIS and Batch</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/569109#M11760</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to send an email from sas using the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;SELECT email&lt;BR /&gt;INTO :email_address separated by '" "'&lt;BR /&gt;FROM WORK.EXAMPLE_TABLE&lt;BR /&gt;WHERE group='example';&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA WORK.LIST_MAIL;&lt;BR /&gt;FORMAT emailaddr $50.;&lt;BR /&gt;INFORMAT emailaddr $50.;&lt;BR /&gt;INPUT emailaddr;&lt;BR /&gt;CARDS;&lt;BR /&gt;&amp;amp;email_address&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL NOPRINT;&lt;BR /&gt;SELECT CAT('"',STRIP(emailaddr),'"') AS QtdEmail INTO :EmailAddrList Separated by ' '&lt;BR /&gt;FROM WORK.LIST_MAIL;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put &amp;amp;EmailAddrList;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;file sendit email&lt;BR /&gt;to=(&amp;amp;EmailAddrList)&lt;BR /&gt;subject="Example 1"&lt;BR /&gt;put "It's an example";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the code in SAS Data Integration Studio (DIS) the email is sent but when I run the code via batch the email isn't sent. On DIS, variable&amp;nbsp;EmailAddrList is equal to "someone@example.com" and on batch variable&amp;nbsp;EmailAddrList is equal&amp;nbsp;"&amp;amp;email_address", so this is the reason why SAS can't sent the email via batch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how I solve it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 14:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/569109#M11760</guid>
      <dc:creator>susana_alves</dc:creator>
      <dc:date>2019-06-26T14:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between SAS DIS and Batch</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/569145#M11766</link>
      <description>&lt;P&gt;Try updating your logic to look like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.Have;
FORMAT 		GROUP $1.	email $50.; 
INFORMAT	GROUP $1.	email $50.; 
INPUT  		GROUP		email;
CARDS;      
A AdamApple@gmail.com
A BillBobington@yahoo.com
B ChuckCooper@hotmail.com
;


PROC SQL;
SELECT 
CATS('"',email,'"') AS 	QtdEmail 	INTO :EmailAddrList Separated by ' '
FROM WORK.HAVE
WHERE group='A';
QUIT;
%PUT &amp;amp;=EmailAddrList.;


DATA _NULL_;
	file sendit email
	to		= (&amp;amp;EmailAddrList.)
	subject	= "Example 1"
	put "It's an example";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To me it looks like you have excess logic that could potentially be causing some issues when running it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See if the new logic provided above works for both SAS DIS and Batch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 16:24:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/569145#M11766</guid>
      <dc:creator>tsap</dc:creator>
      <dc:date>2019-06-26T16:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between SAS DIS and Batch</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/569378#M11795</link>
      <description>&lt;P&gt;Thanks for your help, but it did not work. The problem is that in the select statement there are no rows selected, but the table has data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;2743 SELECT email&lt;BR /&gt;2744 INTO :email_address separated by '" "'&lt;BR /&gt;2745 FROM WORK.EXAMPLE_TABLE&lt;BR /&gt;2746 WHERE group='example';&lt;BR /&gt;NOTE: No rows were selected.&lt;BR /&gt;2747 QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When I run the job via SAS DIS, the select statement selects rows, but when I run the same code via batch, it selects nothing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you have any idea why this happens and how do I solve it?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 10:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/569378#M11795</guid>
      <dc:creator>susana_alves</dc:creator>
      <dc:date>2019-06-27T10:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between SAS DIS and Batch</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/569401#M11801</link>
      <description>&lt;P&gt;Are there any other errors/warnings/notes throughout the rest of the log when you run the code in Batch?&lt;BR /&gt;&lt;BR /&gt;Are you running with these options set? options mlogic mprint symblogen&lt;/P&gt;&lt;P&gt;(to get the most information out of your log).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While the updated code is more efficient, the same issue appears to be present, which is why your original post stated you were getting a value of &amp;amp;email_address.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The initial query (when run in batch) was getting 0 rows. So the macro variable &amp;amp;email_address. that was supposed to be created, wasn't. Then in the next step that macro isn't able to resolve since it wasn't created (no rows to populate it), so a table is created with the literal text '&amp;amp;email_address.'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where for some reason, when run in DIS the initial query does get rows and does populate the &amp;amp;email_address. macro variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 12:45:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/569401#M11801</guid>
      <dc:creator>tsap</dc:creator>
      <dc:date>2019-06-27T12:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between SAS DIS and Batch</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/569438#M11816</link>
      <description>&lt;P&gt;Try adding this to your query for running in batch mode:&lt;/P&gt;&lt;P&gt;options obs = max ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
OBS=MAX;
SELECT email
INTO :email_address separated by '" "'
FROM WORK.EXAMPLE_TABLE
WHERE group='example';
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;To see why I'm making this suggestion, check out this link: &lt;A href="https://www.lexjansen.com/pharmasug/2010/CC/CC05.pdf" target="_self"&gt;https://www.lexjansen.com/pharmasug/2010/CC/CC05.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 14:18:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/569438#M11816</guid>
      <dc:creator>tsap</dc:creator>
      <dc:date>2019-06-27T14:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between SAS DIS and Batch</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/570543#M11970</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 13:14:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/570543#M11970</guid>
      <dc:creator>susana_alves</dc:creator>
      <dc:date>2019-07-02T13:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between SAS DIS and Batch</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/570564#M11972</link>
      <description>If the 'obs=max' post solved your issue, please mark that message as the solution. So that others know exactly message resolved your issue, if they encounter it as well.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 02 Jul 2019 13:54:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Difference-between-SAS-DIS-and-Batch/m-p/570564#M11972</guid>
      <dc:creator>tsap</dc:creator>
      <dc:date>2019-07-02T13:54:32Z</dc:date>
    </item>
  </channel>
</rss>

