<?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 Spool Option and Include Statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Spool-Option-and-Include-Statement/m-p/70359#M20239</link>
    <description>Good Afternoon,&lt;BR /&gt;
&lt;BR /&gt;
I have recently stumbled over using the Spool Option in tandem with the Include statement which would assist in reducing the amount of code I have.  An example of what I have is below.&lt;BR /&gt;
&lt;BR /&gt;
OPTIONS SPOOL;&lt;BR /&gt;
&lt;BR /&gt;
DATA TEST;&lt;BR /&gt;
SET SASHELP.CLNMSG;&lt;BR /&gt;
WHERE LEVEL = "N";&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
DATA TEST1;&lt;BR /&gt;
%INC 4:5;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
It appears very simpe, but I get nothing in dataset TEST1.&lt;BR /&gt;
&lt;BR /&gt;
Does anyone have an idea about what I am doing wrong?  I have trawled the internet, but can't find anything of use. &lt;BR /&gt;
&lt;BR /&gt;
Your help is greatly appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Scott</description>
    <pubDate>Thu, 10 Sep 2009 03:01:27 GMT</pubDate>
    <dc:creator>Scottcom4</dc:creator>
    <dc:date>2009-09-10T03:01:27Z</dc:date>
    <item>
      <title>Spool Option and Include Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Spool-Option-and-Include-Statement/m-p/70359#M20239</link>
      <description>Good Afternoon,&lt;BR /&gt;
&lt;BR /&gt;
I have recently stumbled over using the Spool Option in tandem with the Include statement which would assist in reducing the amount of code I have.  An example of what I have is below.&lt;BR /&gt;
&lt;BR /&gt;
OPTIONS SPOOL;&lt;BR /&gt;
&lt;BR /&gt;
DATA TEST;&lt;BR /&gt;
SET SASHELP.CLNMSG;&lt;BR /&gt;
WHERE LEVEL = "N";&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
DATA TEST1;&lt;BR /&gt;
%INC 4:5;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
It appears very simpe, but I get nothing in dataset TEST1.&lt;BR /&gt;
&lt;BR /&gt;
Does anyone have an idea about what I am doing wrong?  I have trawled the internet, but can't find anything of use. &lt;BR /&gt;
&lt;BR /&gt;
Your help is greatly appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Scott</description>
      <pubDate>Thu, 10 Sep 2009 03:01:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Spool-Option-and-Include-Statement/m-p/70359#M20239</guid>
      <dc:creator>Scottcom4</dc:creator>
      <dc:date>2009-09-10T03:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Spool Option and Include Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Spool-Option-and-Include-Statement/m-p/70360#M20240</link>
      <description>Hi:&lt;BR /&gt;
  Here's the doc:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a000218370.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a000218370.htm&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  The difference between your example and the example in the doc is that they do not show the included code from one data step program inside a second (different) data step program. You might wish to work with Tech Support on this question. &lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 10 Sep 2009 04:29:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Spool-Option-and-Include-Statement/m-p/70360#M20240</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-09-10T04:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Spool Option and Include Statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Spool-Option-and-Include-Statement/m-p/70361#M20241</link>
      <description>&lt;P&gt;Run your program in BATCH. It appears that %INC line numbers is not supported in Windows DMS where I tested it. As I recall INCing line number ranges was originally for interactive line mode SAS sessions, where it is a sort of poor mans recall. &lt;BR /&gt;&lt;BR /&gt;It also appears that interactive line mode is not supported in windows os.&lt;/P&gt;
&lt;P&gt;Example with %INC using line numbers.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;1          OPTIONS SPOOL=1 GENERIC=1 STIMER=0;
2          
3          DATA TEST;
4             SET SASHELP.CLNMSG;
5             WHERE LEVEL = "N";
6             RUN;

NOTE: The data set WORK.TEST has 160 observations and 6 variables.

7          
8          DATA TEST1;
9             %inc 4:5 / source2;
NOTE: %INCLUDE (level 1) previous line numbers.
10        +   SET SASHELP.CLNMSG;
11        +   WHERE LEVEL = "N";
NOTE: %INCLUDE (level 1) ending.
12            run;

NOTE: The data set WORK.TEST1 has 160 observations and 6 variables.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;%LIST example to show lines submitted 1-13 the listed lines appear before the %LIST statement that produces the output.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  1 OPTIONS SPOOL=1 GENERIC=1 STIMER=0;
  2 
  3 DATA TEST;
  4    SET SASHELP.CLNMSG;
  5    WHERE LEVEL = "N";
  6    RUN;
  7 
  8 DATA TEST1;
  9    %inc 4:5 / source2;
  10    SET SASHELP.CLNMSG;
  11    WHERE LEVEL = "N";
  12    run;
  13 
13         
14         
15         %list 1-13; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2026 21:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Spool-Option-and-Include-Statement/m-p/70361#M20241</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2026-05-26T21:42:44Z</dc:date>
    </item>
  </channel>
</rss>

