<?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: Substituting text in a DOSUBL argument in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Substituting-text-in-a-DOSUBL-argument/m-p/331833#M74639</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;More from SAS-L

I am not sure of this answer, the scoping in DOSUBL is a mystery to me.

It is how SAS has decided to compile DOSUBL?

dosubl concatenates the two strings and and unknown ds variable

"proc datasets library = work nolist; append base = want data =  "
 ds
 " force quit;run;"

 The comipler gets the value of DS from the parent?
 This surprised me? I had been using call symputx.

 The reverse is not true, a new variable in the child is
 not available to the parent, but you can delare
 commom variable names using the variables address.


* this also works;

 %symdel ds;
 data _null_;
  do ds='sashelp.classfit','sashelp.class';
    call symputx('ds',ds);
    rc = dosubl("
       proc datasets library = work nolist;
         append base = want data = &amp;amp;ds force;
       quit;run;
       %symdel ds;
    ");
  end;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 11 Feb 2017 16:14:39 GMT</pubDate>
    <dc:creator>rogerjdeangelis</dc:creator>
    <dc:date>2017-02-11T16:14:39Z</dc:date>
    <item>
      <title>Substituting text in a DOSUBL argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Substituting-text-in-a-DOSUBL-argument/m-p/331818#M74634</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Substituting text in a DOSUBL argument
&lt;BR /&gt;as a side note- SAS please add the 8pt sasfont, would improve postings. Too much space between lines.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks to Quentin McMullen on SAS-L&lt;BR /&gt;&lt;BR /&gt;https://listserv.uga.edu/cgi-bin/wa?A2=SAS-L;39b80cb6.1702b&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Using DOSUBL to Append datasets

HAVE (Two datasets SASHELP.CLASSFIT and SASHELP.CLASS)

Up to 40 obs from SASHELP.CLASSFIT total obs=19

Obs    NAME        SEX  AGE HEIGHT WEIGHT   PREDICT ...

  1    Joyce        F    11   51.3   50.5    56.99
  2    Louise       F    12   56.3     77    76.48
...
 19    Philip       M    16     72    150    137.7


Up to 40 obs from SASHELP.CLASS total obs=19

Obs    NAME        SEX  AGE HEIGHT WEIGHT

  1    Joyce        F    11   51.3   50.5
  2    Louise       F    12   56.3     77
...
 19    Philip       M    16     72    150

WANT
===

Up to 40 obs from WANT total obs=38

Obs    NAME        SEX  AGE HEIGHT WEIGHT   PREDICT ...

  1    Joyce        F    11   51.3   50.5    56.99
  2    Louise       F    12   56.3     77    76.48

 37    Thomas       M    11   51.3   50.5      .
 38    William      M    12   56.3     77      .

WORKING CODE
============

    rc = dosubl("
       proc datasets library = work nolist;
         append base = want data = "||ds||" force;

FULL SOLUTION
============

data _null_;
  do ds='sashelp.classfit','sashelp.class';
    rc = dosubl("
       proc datasets library = work nolist;
         append base = want data = "||ds||" force;
       quit;run;
    ");
  end;
run;quit;


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Feb 2017 14:17:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Substituting-text-in-a-DOSUBL-argument/m-p/331818#M74634</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-02-11T14:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Substituting text in a DOSUBL argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Substituting-text-in-a-DOSUBL-argument/m-p/331819#M74635</link>
      <description>Using DOSUBL to Append datasets&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://listserv.uga.edu/cgi-bin/wa?A2=SAS-L;39b80cb6.1702b" target="_blank"&gt;https://listserv.uga.edu/cgi-bin/wa?A2=SAS-L;39b80cb6.1702b&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks to Quentin McMullen on SAS-L&lt;BR /&gt;and&lt;BR /&gt;espeecially Muthia Kachirayan for posting the question!!</description>
      <pubDate>Sat, 11 Feb 2017 14:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Substituting-text-in-a-DOSUBL-argument/m-p/331819#M74635</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-02-11T14:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Substituting text in a DOSUBL argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Substituting-text-in-a-DOSUBL-argument/m-p/331833#M74639</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;More from SAS-L

I am not sure of this answer, the scoping in DOSUBL is a mystery to me.

It is how SAS has decided to compile DOSUBL?

dosubl concatenates the two strings and and unknown ds variable

"proc datasets library = work nolist; append base = want data =  "
 ds
 " force quit;run;"

 The comipler gets the value of DS from the parent?
 This surprised me? I had been using call symputx.

 The reverse is not true, a new variable in the child is
 not available to the parent, but you can delare
 commom variable names using the variables address.


* this also works;

 %symdel ds;
 data _null_;
  do ds='sashelp.classfit','sashelp.class';
    call symputx('ds',ds);
    rc = dosubl("
       proc datasets library = work nolist;
         append base = want data = &amp;amp;ds force;
       quit;run;
       %symdel ds;
    ");
  end;
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Feb 2017 16:14:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Substituting-text-in-a-DOSUBL-argument/m-p/331833#M74639</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-02-11T16:14:39Z</dc:date>
    </item>
  </channel>
</rss>

