<?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: %nrstr macro call execute issue with macro variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185223#M35167</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What happens if you run exactly what I posted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jun 2014 17:19:24 GMT</pubDate>
    <dc:creator>FriedEgg</dc:creator>
    <dc:date>2014-06-04T17:19:24Z</dc:date>
    <item>
      <title>%nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185216#M35160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;Hope you are well&lt;/P&gt;&lt;P&gt;I am using the below code to run a series of macros if run='Y'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro pgrun(macro,run);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if %upcase("&amp;amp;run") eq "Y"&amp;nbsp; %then %&amp;amp;macro; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend pgrun;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;set driver;&lt;/P&gt;&lt;P&gt;if macro ne '';&lt;/P&gt;&lt;P&gt;call execute('%nrstr(%pgrun) (' !! macro !! ' , ' !! run !! ' );');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As above I am using the %nrstr option so any macros within macros are compiied correctly however I have found&amp;nbsp; with the %nstr if I call a macro with a macro call within it can alter the text&lt;/P&gt;&lt;P&gt; e.g.&amp;nbsp; One macro call is processed as below: &lt;/P&gt;&lt;P&gt;%pgrun (LABCONNECT((6-2-2014 102404 AM ) -13-0103 XFER) , Y );&lt;/P&gt;&lt;P&gt;but this should be&amp;nbsp; %pgrun (LABCONNECT((6-2-2014 102404 AM ) - 13-0103 XFER) , Y ) which is processed if the %nrstr is removed i.e. the space after the '-' has been removed. '(6-2-2014 102404 AM ) - 13-0103 XFER' is the name of a text file I wish to import&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help prevent this occurrence without having not to use the %nrstr option or simply amending the text file name so it is compatible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185216#M35160</guid>
      <dc:creator>mantben</dc:creator>
      <dc:date>2014-06-04T15:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185217#M35161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like the macro processing is modifying the string you are trying to pass.&lt;/P&gt;&lt;P&gt;Probably the easiest fix is modify the LABCONNECT macro to expect the filename to be enclosed in quotes so that you blanks are preserved as is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro labconnect(filename.....);&lt;/P&gt;&lt;P&gt;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile &amp;amp;filename ....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;%mend ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then generate the macro call as :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%pgrun (LABCONNECT("(6-2-2014 102404 AM ) - 13-0103 XFER)" , Y ))&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;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Personally I find it much easier to use PUT statements to write the generated code myself rather than using CALL EXECUTE. It is also much easier to debug as you can run the data step that generates the code and then examine the generated code to make sure that the syntax is correct.&amp;nbsp; Also if you did this then your could eliminate the need for the PGMRUN macro and just put the test of the RUN parameter into the code generating data step.&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;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 16:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185217#M35161</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-06-04T16:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185218#M35162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not the way I would go about designing it, but what you are trying to do should work fine.&amp;nbsp; You problem must be someplace else in your process.&amp;nbsp; %nrstr would definitely not be responsible for deleting a space there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro foo(macro , run);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %if &amp;amp;run=Y %then %&amp;amp;macro;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro labconnect(x);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %put &amp;amp;sysmacroname &amp;amp;=x;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; macro = 'LABCONNECT((6-2-2014 102404 AM ) - 13-0103 XFER)';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run&amp;nbsp;&amp;nbsp; = 'Y';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; call execute( '%nrstr(%foo)( ' !! macro !! ' , ' !! run !! ' )' );&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: CALL EXECUTE generated line.&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + %foo( LABCONNECT((6-2-2014 102404 AM ) - 13-0103 XFER) , Y )&lt;/P&gt;&lt;P&gt;LABCONNECT X=(6-2-2014 102404 AM ) - 13-0103 XFER&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 16:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185218#M35162</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-06-04T16:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185219#M35163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks for the reply&lt;/P&gt;&lt;P&gt;It is a real odd one as not all blanks are ignored and literally If I remove the %nstr the program work fine. I can only assume the macro compling is doing something strange here using %nrstr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 16:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185219#M35163</guid>
      <dc:creator>mantben</dc:creator>
      <dc:date>2014-06-04T16:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185220#M35164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will have to post the contents of your called macro then.&amp;nbsp; I would also confirm that the presumed space is not a special hex character other than an actual space.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 16:44:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185220#M35164</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-06-04T16:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185221#M35165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom&lt;/P&gt;&lt;P&gt;Many thanks for the reply&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below is my code for reading the file in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro labconnect(infile);&lt;/P&gt;&lt;P&gt;data sas.source;&lt;/P&gt;&lt;P&gt;infile "&amp;amp;topdirlg/sas/&amp;amp;infile..txt" dsd dlm='|' lrecl=32767 missover&amp;nbsp; firstobs=2;&lt;/P&gt;&lt;P&gt;input &lt;/P&gt;&lt;P&gt;STUDYID: $15. DOMAIN: $2. USUBJID: $15. DOB: $15. SEX: $1. LBSEQ: $5. LBGRPID: $5. LBREFID: $15. LBSPID: $8. &lt;/P&gt;&lt;P&gt;LBTESTCD: $50. LBTEST: $50. LBCAT: $50.&amp;nbsp; LBSCAT: $50.&amp;nbsp; LBORRES: $200. &lt;/P&gt;&lt;P&gt;LBORRESU: $50. LBORNRLO: $50. LBORNRHI: $50.&lt;/P&gt;&lt;P&gt;LBSTRESC: $200. LBSTRESN: $50. LBSTRESU: $50. LBSTNRLO: $50. LBSTNRHI: $50. LBSTNRC: $50.&lt;/P&gt;&lt;P&gt;LBNRIND: $15. LBSTAT: $50. LBREASND: $200. LBNAM: $50. LBLOINC: $50. LBSPEC: $50. LBSPCCND: $50.&lt;/P&gt;&lt;P&gt;LBMETHOD: $50. LBBLFL: $50. LBFAST: $1. LBDRVFL: $50.&lt;/P&gt;&lt;P&gt;LBTOX: $50. LBTOXGR: $50. VISITNUM: $50. VISIT: $50. VISITDY: $50. LBDTC: $50. LBENDTC: $50. LBDY: $50. LBTPT: $50.&lt;/P&gt;&lt;P&gt;LBTPTNUM: $50. LBELTM: $50. LBTPTREF: $50. LBRFTDTC: $50. COMMENT: $200.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using call execute with ""s though causes issues with options and the call execute:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E 155-205: Line generated by the CALL EXECUTE routine.&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + data sas.source; infile "S:\Lab_Data\NGM130103\Labconnect/sas/"(6-2-2014 102404 AM ) -13-0103 XFER".txt" dsd dlm='|' lrecl=32767&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp; !+missover&amp;nbsp; firstobs=2; input&amp;nbsp; STUDYID: $15. DOMAIN: $2. USUBJID: $15. DOB: $15. SEX: $1. LBSEQ: $5. LBGRPID: $5. LBREFID: $15.&lt;/P&gt;&lt;P&gt;ERROR 23-2: Invalid option name (.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 16:56:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185221#M35165</guid>
      <dc:creator>mantben</dc:creator>
      <dc:date>2014-06-04T16:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185222#M35166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;Thanks again for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I read the data for the programs from a microscoft excel work sheet. In regard to the space I literally cut and pasted the file name from explorer into the excel sheet. I've tried copying the file and renaming manually and still the same issue with %NRSTR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line 356: ERROR: Physical file does not exist, S:\Lab_Data\NGM130103\Labconnect\sas\(6-2-2014 10&lt;/P&gt;&lt;P&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2404 AM ) -13-0103 XFER - Copy.txt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But without %nrstr and same inputted data&lt;/P&gt;&lt;P&gt;NOTE: 63 records were read from the infile "S:\Lab_Data\NGM130103\Labconnect/sas/(6-2-2014 102404 AM ) - 13-0103 XFER - Copy.txt".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The minimum record length was 141.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum record length was 969.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using SAS 9.2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I'm going to bite the bullet and rename the source file....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 17:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185222#M35166</guid>
      <dc:creator>mantben</dc:creator>
      <dc:date>2014-06-04T17:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185223#M35167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What happens if you run exactly what I posted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 17:19:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185223#M35167</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-06-04T17:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185224#M35168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again but looks like it's definitely something buggy with my 9.2 as the mystery space has again disappeared&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; %macro foo(macro , run);&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if &amp;amp;run=Y %then %&amp;amp;macro;&lt;/P&gt;&lt;P&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp; %mend;&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp; %macro labconnect(x);&lt;/P&gt;&lt;P&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %put &amp;amp;sysmacroname &amp;amp;=x;&lt;/P&gt;&lt;P&gt;8&amp;nbsp;&amp;nbsp;&amp;nbsp; %mend;&lt;/P&gt;&lt;P&gt;9&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;P&gt;11&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; macro = 'LABCONNECT((6-2-2014 102404 AM ) - 13-0103 XFER)';&lt;/P&gt;&lt;P&gt;13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run&amp;nbsp;&amp;nbsp; = 'Y';&lt;/P&gt;&lt;P&gt;14&lt;/P&gt;&lt;P&gt;15&lt;/P&gt;&lt;P&gt;16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute( '%nrstr(%foo)( ' !! macro !! ' , ' !! run !! ' )' );&lt;/P&gt;&lt;P&gt;17&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: CALL EXECUTE generated line.&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp; +&amp;nbsp; %foo( LABCONNECT((6-2-2014 102404 AM ) -13-0103 XFER) , Y )&lt;/P&gt;&lt;P&gt;LABCONNECT &amp;amp;=x&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 17:24:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185224#M35168</guid>
      <dc:creator>mantben</dc:creator>
      <dc:date>2014-06-04T17:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185225#M35169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please %nrbquote instead of %nrstr.&amp;nbsp; Looks like this has been resolved in 9.4&lt;/P&gt;&lt;P&gt;&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 foo(macro , run);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %if &amp;amp;run=Y %then %&amp;amp;macro;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro labconnect(x);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %put &amp;amp;sysmacroname &amp;amp;x;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; macro = 'LABCONNECT((6-2-2014 102404 AM ) - 13-0103 XFER)';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run&amp;nbsp;&amp;nbsp; = 'Y';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; call execute( '%nrbquote(%foo( ' !! macro !! ' , ' !! run !! ' ))' );&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 17:33:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185225#M35169</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-06-04T17:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185226#M35170</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;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;Here is one way to allow passing part of physical path as a quoted string.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;You can use the DEQUOTE() function to remove the outer quotes so that you can add the prefix and suffix values.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;%macro labconnect(infile);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;%let infile = &lt;SPAN style="background-color: #ffffff;"&gt; "&amp;amp;topdirlg/sas/%sysfunc(dequote(&amp;amp;infile)).txt" ;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;data sas.source;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; infile &amp;amp;infile dsd dlm='|' lrecl=32767 missover&amp;nbsp; firstobs=2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 17:47:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185226#M35170</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-06-04T17:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185227#M35171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, given your log you will need both recommendations from myself and Tom to fix all of your issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 17:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185227#M35171</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-06-04T17:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: %nrstr macro call execute issue with macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185228#M35172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks again for all your help Tom and &lt;A __default_attr="733023" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it may be time to upgrade my SAS and many thanks for your suggestions have a great rest of the week&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 18:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nrstr-macro-call-execute-issue-with-macro-variables/m-p/185228#M35172</guid>
      <dc:creator>mantben</dc:creator>
      <dc:date>2014-06-04T18:06:50Z</dc:date>
    </item>
  </channel>
</rss>

