<?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: editing macro list in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/editing-macro-list/m-p/732677#M28510</link>
    <description>&lt;P&gt;works perfectly!&amp;nbsp;&lt;/P&gt;&lt;P&gt;For learning purposes I was wondering how to have it in the list before the macro is created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select distinct quote(strip(DueDate)," ' ")&lt;BR /&gt;into: alldates1 separated by ','&lt;BR /&gt;from Pivot1;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I did to create the macro list. I was able to figure out how to add the quotes, but I am not too sure how to add the "N".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
    <pubDate>Sat, 10 Apr 2021 05:21:52 GMT</pubDate>
    <dc:creator>judyluu</dc:creator>
    <dc:date>2021-04-10T05:21:52Z</dc:date>
    <item>
      <title>editing macro list</title>
      <link>https://communities.sas.com/t5/New-SAS-User/editing-macro-list/m-p/732670#M28507</link>
      <description>&lt;P&gt;Below I have the results of the macros that I have created.&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put &amp;amp;alldates1.;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;'02/22/2021', '02/23/2021', '02/25/2021', '02/26/2021', '03/01/2021'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put &amp;amp;alldates2.;&lt;BR /&gt;'02/22/2021' '02/23/2021' '02/25/2021' '02/26/2021' '03/01/2021'&lt;/P&gt;&lt;P&gt;I want to make edits to the macros to look like this without having to type them out or make edits to each item on the list:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put &amp;amp;alldates1.;&lt;/P&gt;&lt;P&gt;'02/22/2021'N, '02/23/2021'N, '02/25/2021'N, '02/26/2021'N, '03/01/2021'N&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put &amp;amp;alldates2.;&lt;/P&gt;&lt;P&gt;'02/22/2021'N '02/23/2021'N '02/25/2021'N '02/26/2021'N '03/01/2021'N&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Apr 2021 02:06:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/editing-macro-list/m-p/732670#M28507</guid>
      <dc:creator>judyluu</dc:creator>
      <dc:date>2021-04-10T02:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: editing macro list</title>
      <link>https://communities.sas.com/t5/New-SAS-User/editing-macro-list/m-p/732674#M28509</link>
      <description>&lt;P&gt;It would probably be easier to generate the N when you make the macro variables.&lt;/P&gt;
&lt;P&gt;But a call to TRANWRD() should do it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let have='02/22/2021', '02/23/2021', '02/25/2021', '02/26/2021', '03/01/2021';
%let want=%sysfunc(tranwrd(%superq(have),%str(,),%str(N,)))N ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Apr 2021 04:13:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/editing-macro-list/m-p/732674#M28509</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-10T04:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: editing macro list</title>
      <link>https://communities.sas.com/t5/New-SAS-User/editing-macro-list/m-p/732677#M28510</link>
      <description>&lt;P&gt;works perfectly!&amp;nbsp;&lt;/P&gt;&lt;P&gt;For learning purposes I was wondering how to have it in the list before the macro is created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select distinct quote(strip(DueDate)," ' ")&lt;BR /&gt;into: alldates1 separated by ','&lt;BR /&gt;from Pivot1;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I did to create the macro list. I was able to figure out how to add the quotes, but I am not too sure how to add the "N".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Sat, 10 Apr 2021 05:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/editing-macro-list/m-p/732677#M28510</guid>
      <dc:creator>judyluu</dc:creator>
      <dc:date>2021-04-10T05:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: editing macro list</title>
      <link>https://communities.sas.com/t5/New-SAS-User/editing-macro-list/m-p/732782#M28512</link>
      <description>&lt;P&gt;Just include in the column you are selecting into the macro variable. Also add NOPRINT so your listing is not cluttered with the list of values.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint
select distinct cats(quote(strip(DueDate),"'"),'N')
  into :alldates1 separated by ','
  from Pivot1
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Are you really trying to create a dataset with variable names that look like date strings? You could also use the NLITERAL() function to add the quotes and N when needed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;nliteral(DueDate)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of if DueDate really has some leading spaces you want removed:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;nliteral(left(DueDate))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Why not just keep the dataset in a natural format and produce such a "table" as a REPORT and not a DATASET.&amp;nbsp; PROC REPORT or PROC TABULATE can easily use the value of DATE variable as the header for a column in the report it produces.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Apr 2021 17:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/editing-macro-list/m-p/732782#M28512</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-10T17:50:04Z</dc:date>
    </item>
  </channel>
</rss>

