<?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: Read code from Text file as part of sas code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-code-from-Text-file-as-part-of-sas-code/m-p/847025#M334879</link>
    <description>&lt;P&gt;There seems to be a preceding plus sign in your .txt file. Your code looks fine.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Nov 2022 11:50:11 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-11-30T11:50:11Z</dc:date>
    <item>
      <title>Read code from Text file as part of sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-code-from-Text-file-as-part-of-sas-code/m-p/847023#M334877</link>
      <description>&lt;P&gt;I have a SAS code which will refer to a formula stored in external text file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input data:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;x&lt;/TD&gt;&lt;TD&gt;y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;67&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;70&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;71&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output data:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;x&lt;/TD&gt;&lt;TD&gt;y&lt;/TD&gt;&lt;TD&gt;z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;67&lt;/TD&gt;&lt;TD&gt;77&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;70&lt;/TD&gt;&lt;TD&gt;85&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;71&lt;/TD&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Written SAS Code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;%include "path/file_ln_model.txt";&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Text file (file_ln_model.txt):&lt;/P&gt;&lt;P&gt;z= x+y;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This above sas code throws the following error:&lt;/P&gt;&lt;P&gt;27 +z=x+y;&lt;BR /&gt;_____________&lt;BR /&gt;180&lt;/P&gt;&lt;P&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help to find the error in this code and provide any alternative situations.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 11:42:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-code-from-Text-file-as-part-of-sas-code/m-p/847023#M334877</guid>
      <dc:creator>rahulsaha2127</dc:creator>
      <dc:date>2022-11-30T11:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Read code from Text file as part of sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-code-from-Text-file-as-part-of-sas-code/m-p/847024#M334878</link>
      <description>&lt;P&gt;To me it looks like your file does not contain "z= x+y;", but "+z= x+y;". You can check what you %INCLUDE by using the SOURCE2 option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  %include "path/file_ln_model.txt" /source2; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Nov 2022 11:49:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-code-from-Text-file-as-part-of-sas-code/m-p/847024#M334878</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2022-11-30T11:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Read code from Text file as part of sas code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-code-from-Text-file-as-part-of-sas-code/m-p/847025#M334879</link>
      <description>&lt;P&gt;There seems to be a preceding plus sign in your .txt file. Your code looks fine.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 11:50:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-code-from-Text-file-as-part-of-sas-code/m-p/847025#M334879</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-11-30T11:50:11Z</dc:date>
    </item>
  </channel>
</rss>

