<?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: How to read text file data into Single column in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-text-file-data-into-Single-column-in-SAS/m-p/895260#M353693</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134610"&gt;@Banu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;This is part of one of the automation. Users will give me one query, and I will need to break that query into all possible queries using where clause column /conditions to verify which query throwing 0 records.&lt;BR /&gt;&lt;BR /&gt;Ex:&lt;BR /&gt;Query1: select * from emp where sal&amp;amp;gt;5000;&lt;BR /&gt;Query2: select * from emp where sal&amp;amp;gt;5000 and deptno=30;&lt;BR /&gt;Once I make the diff queries based on the input query, will submit queries to find whether all queries populating data or not.&lt;BR /&gt;&lt;BR /&gt;As part of this, first I want to read the query into a single column in SAS Dataset.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Reading text from a file is trivial.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Making sense of it as SQL syntax is difficult.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One restriction is that character variables can only store 32K bytes.&amp;nbsp; So your will have a limit on how large a block of code you can put into a single variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile 'codefile' truncover ;
  input codeline $32767.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Sep 2023 13:48:33 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-09-21T13:48:33Z</dc:date>
    <item>
      <title>How to read text file data into Single column in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-text-file-data-into-Single-column-in-SAS/m-p/895252#M353688</link>
      <description>Hi Everyone,&lt;BR /&gt;&lt;BR /&gt;I have a requirement to read a text file which contains SQL query into a single column in SAS Dataset. Could you please help.&lt;BR /&gt;&lt;BR /&gt;For Example, I have a emp.txt file and which contains below query. &lt;BR /&gt;Select * from emp where sal &amp;gt; 5000 and deptno=30;&lt;BR /&gt;&lt;BR /&gt;Above one is simple query, but I have big queries too. Thank you.</description>
      <pubDate>Thu, 21 Sep 2023 13:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-text-file-data-into-Single-column-in-SAS/m-p/895252#M353688</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2023-09-21T13:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to read text file data into Single column in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-text-file-data-into-Single-column-in-SAS/m-p/895255#M353690</link>
      <description>&lt;P&gt;SAS data sets do not usually contain SQL code, they usually contain data. Are you sure that is the requirement? SAS data sets would be a poor choice for a place to store code. Could it be that the requirement is to read SQL code into a SAS program?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 13:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-text-file-data-into-Single-column-in-SAS/m-p/895255#M353690</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-09-21T13:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to read text file data into Single column in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-text-file-data-into-Single-column-in-SAS/m-p/895258#M353691</link>
      <description>This is part of one of the automation. Users will give me one query, and I will need to break that query into all possible queries using where clause column /conditions to verify which query throwing 0 records.&lt;BR /&gt;&lt;BR /&gt;Ex:&lt;BR /&gt;Query1: select * from emp where sal&amp;amp;gt;5000;&lt;BR /&gt;Query2: select * from emp where sal&amp;amp;gt;5000 and deptno=30;&lt;BR /&gt;Once I make the diff queries based on the input query, will submit queries to find whether all queries populating data or not.&lt;BR /&gt;&lt;BR /&gt;As part of this, first I want to read the query into a single column in SAS Dataset.</description>
      <pubDate>Thu, 21 Sep 2023 13:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-text-file-data-into-Single-column-in-SAS/m-p/895258#M353691</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2023-09-21T13:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to read text file data into Single column in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-text-file-data-into-Single-column-in-SAS/m-p/895260#M353693</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/134610"&gt;@Banu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;This is part of one of the automation. Users will give me one query, and I will need to break that query into all possible queries using where clause column /conditions to verify which query throwing 0 records.&lt;BR /&gt;&lt;BR /&gt;Ex:&lt;BR /&gt;Query1: select * from emp where sal&amp;amp;gt;5000;&lt;BR /&gt;Query2: select * from emp where sal&amp;amp;gt;5000 and deptno=30;&lt;BR /&gt;Once I make the diff queries based on the input query, will submit queries to find whether all queries populating data or not.&lt;BR /&gt;&lt;BR /&gt;As part of this, first I want to read the query into a single column in SAS Dataset.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Reading text from a file is trivial.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Making sense of it as SQL syntax is difficult.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One restriction is that character variables can only store 32K bytes.&amp;nbsp; So your will have a limit on how large a block of code you can put into a single variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile 'codefile' truncover ;
  input codeline $32767.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Sep 2023 13:48:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-text-file-data-into-Single-column-in-SAS/m-p/895260#M353693</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-21T13:48:33Z</dc:date>
    </item>
  </channel>
</rss>

