<?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: SAS Exam A00-232 - specific question regarding comma separated list in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/957299#M373712</link>
    <description>&lt;P&gt;The reasons that I omit the NOPRINT option are as follows:&lt;/P&gt;&lt;P&gt;1) while learning, I always want to know what is/are the default output(s) (every possible things including results and log) of a step (without any option);&lt;/P&gt;&lt;P&gt;2) without NOPRINT option, the values of the macro variable created by the SQL step will be displayed directly in the output destination, which means I can easily verify whether the macro values are created and resolved correctly in the SQL step and next steps (e.g., the next step could be a macro that print out rows separately according to each level of a categorical variable) by looking at the results altogether WITHOUT clicking, opening, and checking the log, also this saves labor of writing the %put &amp;amp;xxx statement;&lt;/P&gt;&lt;P&gt;3) however, I understand this SQL step (that creates a macro variable list according to the levels of a categorical variable) always serves as an intermediate step (i.e., the product of this step is to be used in next steps), and therefore, I would NOT omit the NOPRINT option if I want the tables in this output destination to be my final product.&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2025 14:31:41 GMT</pubDate>
    <dc:creator>dxiao2017</dc:creator>
    <dc:date>2025-01-27T14:31:41Z</dc:date>
    <item>
      <title>SAS Exam A00-232 - specific question regarding comma separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/936329#M368062</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is a specific question from&amp;nbsp;A00-232 practice exam located here&amp;nbsp; &lt;A href="https://learn.sas.com/course/view.php?id=9" target="_blank"&gt;https://learn.sas.com/course/view.php?id=9&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;(I might assume that there are different practice test versions for different users)&lt;/P&gt;
&lt;P&gt;"Use SAS dictionary tables, run a PROC SQL query to create a macro variable named COL_LIST which contains a &lt;EM&gt;&lt;STRONG&gt;comma separated list&lt;/STRONG&gt;&lt;/EM&gt; of the columns contained in the CERT.AIR10 data set"&lt;/P&gt;
&lt;P&gt;i) Per SAS, the correct answer is: DATE, AIR &lt;FONT color="#FF0000"&gt;&amp;lt;&amp;lt; with a comma + space delimiter&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366FF"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;gt;&amp;gt;&amp;gt; select name into :col_list separated by ', ' &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;ii) If we are indeed using a &lt;EM&gt;&lt;STRONG&gt;comma separated list, &lt;/STRONG&gt;&lt;/EM&gt;then&amp;nbsp;the correct answer is:&amp;nbsp;DATE,AIR&amp;nbsp;&lt;FONT color="#FF0000"&gt;&amp;lt;&amp;lt; with a comma delimiter ONLY&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;FONT color="#3366FF"&gt;&amp;gt;&amp;gt;&amp;gt; select name into :col_list separated by ','&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;I answered as in ii) but it was marked incorrect.&lt;/P&gt;
&lt;P&gt;Not an issue on a &lt;EM&gt;practice&lt;/EM&gt; exam but it might be an issue on the &lt;EM&gt;actual&lt;/EM&gt; exam.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any observations on my assessment?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;many thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 11:19:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/936329#M368062</guid>
      <dc:creator>Rampsas1</dc:creator>
      <dc:date>2024-07-19T11:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Exam A00-232 - specific question regarding comma separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/936349#M368067</link>
      <description>&lt;P&gt;You are right.&amp;nbsp; Hopefully they QC the questions on the actual exam better.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 13:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/936349#M368067</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-07-19T13:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Exam A00-232 - specific question regarding comma separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/952609#M372287</link>
      <description>&lt;P&gt;Hi, I encountered the same problem while doing that question, for a while I was wondering should I always add a blank after the comma like this ', '&amp;nbsp; while taking the real exam&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 08:48:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/952609#M372287</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2024-12-05T08:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Exam A00-232 - specific question regarding comma separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/952710#M372315</link>
      <description>&lt;P&gt;Or, should the correct answer be like this:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select strip(name)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;into :xxxlist separated by ','&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;from xxxdataset;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;i.e., the blank between values was removed through the strip() function&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 07:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/952710#M372315</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2024-12-06T07:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Exam A00-232 - specific question regarding comma separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/952741#M372329</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/466238"&gt;@dxiao2017&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Or, should the correct answer be like this:&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;select strip(name)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;into :xxxlist separated by ','&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;from xxxdataset;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;i.e., the blank between values was removed through the strip() function&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;NO.&amp;nbsp; SEPARATED BY already removes the leading/trailing spaces.&amp;nbsp; Example:&lt;/P&gt;
&lt;PRE&gt;3    proc sql noprint;
4    select name into :namelist separated by '|'
5    from sashelp.class(obs=3)
6    ;
7    quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


8    %put "&amp;amp;namelist";
"Alfred|Alice|Barbara"

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 13:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/952741#M372329</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-12-06T13:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Exam A00-232 - specific question regarding comma separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/952756#M372341</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;Thanks a lot for the reply!&lt;/P&gt;&lt;P&gt;The example in my post was from the official training course SQL1, I do remember there was difference when you use or do not use the strip() function. I'll find the codes in SQL1 lesson, do some more research, and reply you again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 15:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/952756#M372341</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2024-12-06T15:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Exam A00-232 - specific question regarding comma separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/952761#M372344</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/466238"&gt;@dxiao2017&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;Thanks a lot for the reply!&lt;/P&gt;
&lt;P&gt;The example in my post was from the official training course SQL1, I do remember there was difference when you use or do not use the strip() function. I'll find the codes in SQL1 lesson, do some more research, and reply you again.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just because something is in a training class does not make it correct.&amp;nbsp;There are many reasons why something incorrect can appear in a training class.&amp;nbsp; Teacher's make mistakes. Printers make mistakes.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Better to run your own tests and see what actually happens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The STRIP() function removes the leading/trailing spaces, but the SEPARATED BY option in PROC SQL also does that so the STRIP() is not needed here.&amp;nbsp; But there are places where it would make a difference.&amp;nbsp; For example removing the LEADING spaces will make possible to match strings that only differ by the number of leading spaces.&amp;nbsp; So&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;strip('     ABC  ') = 'ABC' &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Would be true.&lt;/P&gt;
&lt;P&gt;But then again so would&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;left('     ABC  ') = 'ABC' &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which will result in SAS doing this comparison.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'ABC       ' = 'ABC'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which is TRUE since trailing spaces are ignored when comparing strings in SAS.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 17:47:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/952761#M372344</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-12-06T17:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Exam A00-232 - specific question regarding comma separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/955810#M373257</link>
      <description>&lt;P&gt;Hi Tom, Thanks a lot for your clarification, they are really helpful. In my last post I said “I do remember there was difference when you use or do not use the strip() function”. The example is from SAS SQL1: Essentials' course notes, demo s106d02. The codes and results are as follows. The difference is in the output table in the results, not in the list of macro variable values in the log.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dxiao2017_0-1736607154199.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103663iA5707981DBEE62E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dxiao2017_0-1736607154199.png" alt="dxiao2017_0-1736607154199.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dxiao2017_1-1736607169720.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103664i27C0312302FC5EAE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dxiao2017_1-1736607169720.png" alt="dxiao2017_1-1736607169720.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2025 14:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/955810#M373257</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-01-11T14:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Exam A00-232 - specific question regarding comma separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/955812#M373258</link>
      <description>&lt;P&gt;So that is another example of something I would tell users NOT to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are running a SELECT statement in SQL to populate macro variable(s) then make sure to use the NOPRINT option in the PROC SQL statement to prevent PROC SQL from also writing the result to the open output destinations.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Jan 2025 15:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/955812#M373258</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-01-11T15:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Exam A00-232 - specific question regarding comma separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/957299#M373712</link>
      <description>&lt;P&gt;The reasons that I omit the NOPRINT option are as follows:&lt;/P&gt;&lt;P&gt;1) while learning, I always want to know what is/are the default output(s) (every possible things including results and log) of a step (without any option);&lt;/P&gt;&lt;P&gt;2) without NOPRINT option, the values of the macro variable created by the SQL step will be displayed directly in the output destination, which means I can easily verify whether the macro values are created and resolved correctly in the SQL step and next steps (e.g., the next step could be a macro that print out rows separately according to each level of a categorical variable) by looking at the results altogether WITHOUT clicking, opening, and checking the log, also this saves labor of writing the %put &amp;amp;xxx statement;&lt;/P&gt;&lt;P&gt;3) however, I understand this SQL step (that creates a macro variable list according to the levels of a categorical variable) always serves as an intermediate step (i.e., the product of this step is to be used in next steps), and therefore, I would NOT omit the NOPRINT option if I want the tables in this output destination to be my final product.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 14:31:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Exam-A00-232-specific-question-regarding-comma-separated/m-p/957299#M373712</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-01-27T14:31:41Z</dc:date>
    </item>
  </channel>
</rss>

