<?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: PARMBUFF Option in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163931#M31728</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much to everyone for your solutions and reference materials. I appreciate your help, the code works well now!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 Aug 2014 20:11:53 GMT</pubDate>
    <dc:creator>colouser</dc:creator>
    <dc:date>2014-08-16T20:11:53Z</dc:date>
    <item>
      <title>PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163923#M31720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SAS users!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see code below. I'm having trouble referencing the following parameters %printz(10-0120, 10-0220) in place of %printz(courses, schedule).&lt;/P&gt;&lt;P&gt;The parameters I want to use are in the format 10-0120 but SAS reads them as two separate parameters (10 and 0120). Please help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %macro printz/&lt;STRONG&gt;parmbuff&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put Syspbuff contains: &amp;amp;syspbuff;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let num=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let dsname=%scan(&lt;STRONG&gt;&amp;amp;syspbuff&lt;/STRONG&gt;,&amp;amp;num);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do %while(&amp;amp;dsname ne);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print data=sasuser.&amp;amp;dsname;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let num=%eval(&amp;amp;num+1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let dsname=%scan(&lt;STRONG&gt;&amp;amp;syspbuff&lt;/STRONG&gt;,&amp;amp;num);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %mend printz;&lt;/P&gt;&lt;P&gt;%printz(courses, schedule)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 23:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163923#M31720</guid>
      <dc:creator>colouser</dc:creator>
      <dc:date>2014-08-15T23:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163924#M31721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sgf/2014/08/15/macro-quoting-made-easy/" title="http://blogs.sas.com/content/sgf/2014/08/15/macro-quoting-made-easy/"&gt; Macro quoting made easy - SAS Users&lt;/A&gt; (By the way my name is not Quentin)&lt;/P&gt;&lt;P&gt;Why you are needing macro-quoting.... see: &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p0pnc7p9n4h6g5n16g6js048nhfl.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p0pnc7p9n4h6g5n16g6js048nhfl.htm"&gt;SAS(R) 9.4 Macro Language: Reference, Second Edition&lt;/A&gt; (%strn %nrstr) but I guess you are needing &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p0frhtfqvguv78n1owh5wfeopdrj.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p0frhtfqvguv78n1owh5wfeopdrj.htm"&gt;SAS(R) 9.4 Macro Language: Reference, Second Edition&lt;/A&gt; as it is a runtime issue. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 07:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163924#M31721</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-08-16T07:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163925#M31722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, I would not use parmbuff anymore, it is very&amp;nbsp; awkward ,instead using call execute( ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro printz/parmbuff;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put Syspbuff contains: &amp;amp;syspbuff;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let num=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let dsname=%scan(&amp;amp;syspbuff,&amp;amp;num,&lt;STRONG&gt;%str(%(%)%,));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do %while(&amp;amp;dsname ne );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;dsname;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let num=%eval(&amp;amp;num+1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let dsname=%scan(&amp;amp;syspbuff,&amp;amp;num,&lt;STRONG&gt;%str(%(%)%,));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %mend printz;&lt;/P&gt;&lt;P&gt;%printz(10-0120, 10-0220)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 11:48:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163925#M31722</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-08-16T11:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163926#M31723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;The parameters I want to use are in the format 10-0120 but SAS reads them as two separate parameters (10 and 0120). Please help!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to tell %SCAN() what to use as the delimiter, otherwise it will use its default set which on an &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ASCII base system are any of these characters:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; line-height: 1.5em; font-family: 'courier new', courier;"&gt;blank . &amp;lt; ( + &amp;amp; ! $ * ) ; ^ - / , % |&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYSPBUFF will include the parentheses so you probably want your %SCAN() call to use (,) as the delimiters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; dsname=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%scan&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;syspbuff,&amp;amp;num,(,));&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 17:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163926#M31723</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-08-16T17:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163927#M31724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For your actual problem of passing in multiple dataset names you should just use BLANK as the delimiter. Then you do not need to use PARMBUFF option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; printz(dslist);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%local&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; num dsname ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; num=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%to&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(countw(&amp;amp;dslist,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%str&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;( ));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; dsname=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%scan&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;dslist,&amp;amp;num,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%str&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;( ));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; proc print data=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;sasuser.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;amp;dsname;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; printz;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;printz&lt;/EM&gt;&lt;/STRONG&gt;(courses schedule)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 17:36:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163927#M31724</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-08-16T17:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163928#M31725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom did you test you %let dsname syspbuff?&amp;nbsp;&amp;nbsp; ( I am getting an error)&amp;nbsp; Xia's code is correct. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This working, I have put some debugging around it, so you can develop/test a macro as a separate component&lt;/P&gt;&lt;P class="sasSource"&gt; 44&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; options mprint mlogic symbolgen ;&lt;/P&gt;&lt;P class="sasSource"&gt; 45&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P class="sasSource"&gt; 46&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %macro test/parmbuff;&lt;/P&gt;&lt;P class="sasSource"&gt; 47&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let num=1 ;&lt;/P&gt;&lt;P class="sasSource"&gt; 48&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let dsname=%scan(&amp;amp;syspbuff,&amp;amp;num,%nrstr(%(%),) );&lt;/P&gt;&lt;P class="sasSource"&gt; 49&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;dsname;&lt;/P&gt;&lt;P class="sasSource"&gt; 50&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %mend;&lt;/P&gt;&lt;P class="sasSource"&gt; 51&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P class="sasSource"&gt; 52&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %test(102-101 , 130);&lt;/P&gt;&lt;P class="sasSource"&gt; MLOGIC(TEST):&amp;nbsp; Beginning execution.&lt;/P&gt;&lt;P class="sasSource"&gt; MLOGIC(TEST):&amp;nbsp; %LET (variable name is NUM)&lt;/P&gt;&lt;P class="sasSource"&gt; MLOGIC(TEST):&amp;nbsp; %LET (variable name is DSNAME)&lt;/P&gt;&lt;P class="sasSource"&gt; SYMBOLGEN:&amp;nbsp; Macro variable SYSPBUFF resolves to (102-101 , 130)&lt;/P&gt;&lt;P class="sasSource"&gt; SYMBOLGEN:&amp;nbsp; Macro variable NUM resolves to 1&lt;/P&gt;&lt;P class="sasSource"&gt; MLOGIC(TEST):&amp;nbsp; %PUT &amp;amp;dsname&lt;/P&gt;&lt;P class="sasSource"&gt; SYMBOLGEN:&amp;nbsp; Macro variable DSNAME resolves to 102-101&lt;/P&gt;&lt;P class="sasSource"&gt; 102-101&lt;/P&gt;&lt;P class="sasSource"&gt; MLOGIC(TEST):&amp;nbsp; Ending execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoiding the macro approach would make sense. With a little of bad luck there are more strange chars of OS-datasetnamings coming in. &lt;/P&gt;&lt;P&gt;In that case we should ask the OP what he is after for.&lt;/P&gt;&lt;P&gt;The - character is not usable as SAS datasetname unless validmemname=extend has been set &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/67401/HTML/default/viewer.htm#p18cdcs4v5wd2dn1q0x296d3qek6.htm" title="http://support.sas.com/documentation/cdl/en/lrcon/67401/HTML/default/viewer.htm#p18cdcs4v5wd2dn1q0x296d3qek6.htm"&gt;SAS(R) 9.4 Language Reference: Concepts, Third Edition&lt;/A&gt;.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 18:13:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163928#M31725</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-08-16T18:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163929#M31726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why all of the unneeded macro quoting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;%macro&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;STRONG&gt;&lt;EM&gt;test&lt;/EM&gt;&lt;/STRONG&gt; / parmbuff ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; dsname=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%scan&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;(&amp;amp;syspbuff,1,(,));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; syspbuff=&amp;amp;syspbuff dsname=&amp;amp;dsname ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;%mend&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; test ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;STRONG&gt;&lt;EM&gt;test&lt;/EM&gt;&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;-&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;203&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;10&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;-&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;304&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;syspbuff=(1-203,10-304) dsname=1-203&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 18:26:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163929#M31726</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-08-16T18:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163930#M31727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom, good question about the third parameter of the scan function. Is documented as it must be a string.&lt;/P&gt;&lt;P&gt;The char normally having a meaning in macro language are there. To be sure it defined as string following the manual of %str usage.&lt;/P&gt;&lt;P&gt;My question why your coding is working.&amp;nbsp; would you define it als .() or (), it is failing. But why (,) is working?&amp;nbsp; &lt;BR /&gt;Changing the string to ',' will recognize the comma but not the ( ) chars and&amp;nbsp; doing it as '(),' will also give correct results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is the link to Russ Tyndal, avoiding possible intrepretation conflicts as good coding habit. The (,) looks to be working&amp;nbsp; but not finding in the documentation why. It could be that %scan macro handles the text string in a way it does not matter as long the , is not in the way.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I like coding conforming documentation not on trial and error basis. Sorry I have been educated the old way coding.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I was working with remote connect sessions it was even more complicated to realize what happened. &lt;BR /&gt;Using a %let in the macro expecting it remote executed (open code level) experienced it was resolved and lost at compile time. Perfect code wrong moment processed. The %nrstr was needed to delay the statement to execution time. For better maintainability I changed that&amp;nbsp; with using defining nested macro-s knowing they were not execute nested but delayed synchronized at different machines.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An other was using the / in datasetnaming (Unix and %syslput) then a new SAS version added the / for a remote session indication with %syslput. Arghh.....&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...To add...&lt;/P&gt;&lt;P&gt;Agree Tom, most people should fist learn to solve as much as possible without using sas-macro-s.&lt;/P&gt;&lt;P&gt;They are moving too quick into this area.&lt;/P&gt;&lt;P&gt;If you want to develop a macro supporting advanced parameters this usage is an option.&amp;nbsp; It will be hard work and testing to get it correct so you need to be convinced it is worth all effort. I would say it is only the case having a generic one to be used by a lot of people.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I you want to know other exceptional ones, that are:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p0ajr6rtdhuhzbn199hhpkak2v8p.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p0ajr6rtdhuhzbn199hhpkak2v8p.htm"&gt;SAS(R) 9.4 Macro Language: Reference, Second Edition&lt;/A&gt;&amp;nbsp; sysparm&amp;nbsp; if you have some job needing different setting known at the os-level.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/stpug/67499/HTML/default/viewer.htm#p184mqqbi9w6qjn1q0619x19eg02.htm" title="http://support.sas.com/documentation/cdl/en/stpug/67499/HTML/default/viewer.htm#p184mqqbi9w6qjn1q0619x19eg02.htm"&gt;SAS(R) 9.4 Stored Processes: Developer's Guide, Second Edition&lt;/A&gt;&amp;nbsp; one or several of the many automatic variables set by a web-server or other type service&amp;nbsp; &lt;/P&gt;&lt;P&gt;Suppose you want some code able to be processed at a lot of those but needing a little bit variation caused by some behavior.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 19:31:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163930#M31727</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-08-16T19:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163931#M31728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much to everyone for your solutions and reference materials. I appreciate your help, the code works well now!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 20:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163931#M31728</guid>
      <dc:creator>colouser</dc:creator>
      <dc:date>2014-08-16T20:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163932#M31729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wrapping values in parentheses is a basic part of the SAS syntax.&amp;nbsp; For a good example look at data set options.&lt;/P&gt;&lt;P&gt;You can also use quotes.&lt;/P&gt;&lt;P&gt;Try it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Aug 2014 21:40:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163932#M31729</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-08-16T21:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163933#M31730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well Tom that is the difference between us, I do not like to invent my own manual by trial and error. I wan to see it is documented and designed to work that way. In this case there are differences between normal SAS datastep languages and the SAS macro language and there are interactions between those.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you mean SAS tokens... &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p030uw6k2s7wzyn18i9obutg923m.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p030uw6k2s7wzyn18i9obutg923m.htm"&gt;SAS(R) 9.4 Macro Language: Reference, Second Edition&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; And not all is documented, you are sometimes bumping against the odd ones of real mistakes or implementation failures. Just an example:&amp;nbsp; &lt;/P&gt;&lt;P&gt;The comment&amp;nbsp;&amp;nbsp; &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#n17rxjs5x93mghn1mdxesvg78drx.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#n17rxjs5x93mghn1mdxesvg78drx.htm"&gt;SAS(R) 9.4 Macro Language: Reference, Second Edition&lt;/A&gt; is a nice one.&amp;nbsp; /*&amp;nbsp; */&amp;nbsp; may contain semicolons (documented), but if you use that accidently with a macro comment (%* ) you will notice it is not a token but a string. Parsing of tokens can be surprising. By that macro quoting to understand.&lt;/P&gt;&lt;P&gt;I went a couple of times through all of this with some type of errors.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Aug 2014 06:30:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163933#M31730</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-08-17T06:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163934#M31731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;My question why your coding is working.&amp;nbsp; would you define it als .() or (), it is failing. But why (,) is working?&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Changing the string to ',' will recognize the comma but not the ( ) chars and&amp;nbsp; doing it as '(),' will also give correct results.&lt;/SPAN&gt;&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;There are two things going on here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One is how SAS is parsing the function call. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;To the SAS tokenizer certain characters cause groupings to occur. The key ones are quotes and parentheses.&amp;nbsp; So when it sees an opening parentheses it knows to group everything until it sees the matching closing character.&amp;nbsp; And unlike quotes (or /* */ comments) parentheses can be nested and SAS will match the closing parenthesis to the proper opening one.&amp;nbsp; Because of this you can use () to protect delimiters.&amp;nbsp; &lt;STRONG&gt;Note that you only need to start worrying about macro quoting when you want to mask the NORMAL meaning of the characters.&amp;nbsp; Since here we definitely do NOT want to mask the normal meaning macro quoting is not appropriate.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;So the &lt;SPAN style="font-family: 'courier new', courier;"&gt;(,)&lt;/SPAN&gt; is recognized as the third parameter because the normal delimiter (comma in this case) is protected by the &lt;SPAN style="font-family: 'courier new', courier;"&gt;()&lt;/SPAN&gt;.&amp;nbsp; Also the closing parenthesis is not interpreted as ending the function call because it is associated with the opening parenthesis.&amp;nbsp; Note that they do not need to be completely around the outside of the positional parameter argument.&amp;nbsp; So &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;in your example of&amp;nbsp; &lt;SPAN style="font-family: 'courier new', courier;"&gt;.()&lt;/SPAN&gt;&amp;nbsp; there is no problem with parsing the string since the value does not contain the delimiter so all three characters would be passed to the function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The second is that to macro language everything is a string so all characters in the third parameter become part of the list of delimiters.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Aug 2014 15:14:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163934#M31731</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-08-17T15:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163935#M31732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are perhaps expecting too much of documentation.&amp;nbsp; Does it explain how nested parentheses work in arithmetic expressions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Aug 2014 15:15:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163935#M31732</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-08-17T15:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: PARMBUFF Option</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163936#M31733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom, I know the way SAS language handling normally does. That is not the point.&lt;/P&gt;&lt;P&gt;And I know by experience that you may not assume is the same way within the SAS-macro-s. Previous examples given.&lt;/P&gt;&lt;P&gt;The nested parantheses if have seen being defined (concepts/ tokens). As the remarks un numeric precision (you know). &lt;/P&gt;&lt;P&gt;But do you know problematic errors different behavior in existing running programs can be when going for release updates.&lt;BR /&gt; Systems and analyses sometimes based on an observed result but not really well defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Forget a moment this dedicated topic, I will give an more understandable one we can agree.&lt;/P&gt;&lt;P&gt;Using SQL you can do a subset on an ordered dataset. Some programmer just coded the result and it was ordered.&lt;/P&gt;&lt;P&gt;When going for a next release the same code gave other results. Of course seeing that SQL there was no order for the results.&lt;/P&gt;&lt;P&gt;Please coorect that one.....&amp;nbsp;&amp;nbsp;&amp;nbsp; Uhhh like you are doing it was a release fault and a lot of trouble.... &lt;BR /&gt;We can agree that SQL is documented&amp;nbsp; to code a ordered clause when you need the result ordered (I hope).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Aug 2014 15:50:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PARMBUFF-Option/m-p/163936#M31733</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-08-17T15:50:39Z</dc:date>
    </item>
  </channel>
</rss>

