<?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: Listing contents of a column in an automated SAS email. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Listing-contents-of-a-column-in-an-automated-SAS-email/m-p/639839#M190412</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
	select   distinct age 
		into    :PMOD_LIST1 separated by "0a0d"x
			from    sashelp.class;
quit;

%put NOTE: &amp;amp;=PMOD_LIST1;

filename t temp;
data _null_;
  file t;
  put "&amp;amp;PMOD_LIST1.";
run;

data _null_;
  infile t;
  input;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you won't see "enters" in the log but they are "embedded" in the text (see the log)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But frankly I would do it bit different, e.g. by writing data from data set just into the email.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Tue, 14 Apr 2020 17:02:07 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2020-04-14T17:02:07Z</dc:date>
    <item>
      <title>Listing contents of a column in an automated SAS email.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Listing-contents-of-a-column-in-an-automated-SAS-email/m-p/639810#M190407</link>
      <description>&lt;P&gt;I have some information in my dataset which I have written into a macro variable. When I want to include this information in an automated email but the issue is I want one row per obs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
	select   distinct i_oth 
		into    :PMOD_LIST1 separated by " "
			from    work.data1;
quit;

%put NOTE: &amp;amp;=PMOD_LIST1;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;My issue is that it looks like this;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: PMOD_LIST1=APR_19 Obs=6336566 APR_20 Obs=172 AUG_19 Obs=7308518 DEC_19 Obs=6571416 FEB_19 Obs=6201178 FEB_20 Obs=6045254 
JAN_19 Obs=6707812 JAN_20 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would like it to look like this;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: PMOD_LIST1=
APR_19 Obs=6336 
APR_20 Obs=12677
AUG_19 Obs=73085
DEC_19 Obs=65716 
FEB_19 Obs=62018 
FEB_20 Obs=5678
JAN_19 Obs=67012 
JAN_20 Obs=72269 

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So in a sense my separator is a row. This makes it look better in an email to users. Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 15:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Listing-contents-of-a-column-in-an-automated-SAS-email/m-p/639810#M190407</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2020-04-14T15:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Listing contents of a column in an automated SAS email.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Listing-contents-of-a-column-in-an-automated-SAS-email/m-p/639839#M190412</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
	select   distinct age 
		into    :PMOD_LIST1 separated by "0a0d"x
			from    sashelp.class;
quit;

%put NOTE: &amp;amp;=PMOD_LIST1;

filename t temp;
data _null_;
  file t;
  put "&amp;amp;PMOD_LIST1.";
run;

data _null_;
  infile t;
  input;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you won't see "enters" in the log but they are "embedded" in the text (see the log)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But frankly I would do it bit different, e.g. by writing data from data set just into the email.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 17:02:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Listing-contents-of-a-column-in-an-automated-SAS-email/m-p/639839#M190412</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-04-14T17:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Listing contents of a column in an automated SAS email.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Listing-contents-of-a-column-in-an-automated-SAS-email/m-p/639840#M190413</link>
      <description>&lt;P&gt;Can you describe why a macro variable is preferable to creating a data set and proc print? Or just plain select without NOPRINT for proc sql?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 17:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Listing-contents-of-a-column-in-an-automated-SAS-email/m-p/639840#M190413</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-04-14T17:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Listing contents of a column in an automated SAS email.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Listing-contents-of-a-column-in-an-automated-SAS-email/m-p/640039#M190527</link>
      <description>&lt;P&gt;Thanks for this. Would you be able to describe your solution (writing the column straight into the email) with maybe an example with one of the sashelp datasets, please?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 08:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Listing-contents-of-a-column-in-an-automated-SAS-email/m-p/640039#M190527</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2020-04-15T08:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Listing contents of a column in an automated SAS email.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Listing-contents-of-a-column-in-an-automated-SAS-email/m-p/640046#M190533</link>
      <description>&lt;P&gt;I don't see the need to use a macro-variable at all. You can use a simple data-step to get what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename mail ....;

proc sort data=work.data1(keep= i_oth) out=work.maildata nodupkey;
  by i_oth;
run;

data _null_;
  set work.maildata;
  file mail;
  
  if _n_ = 1 then do;
    put "NOTE: PMOD_LIST1=";
  end;
  
  put i_oth;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Apr 2020 09:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Listing-contents-of-a-column-in-an-automated-SAS-email/m-p/640046#M190533</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-04-15T09:25:06Z</dc:date>
    </item>
  </channel>
</rss>

