<?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 Create a dataset with long strings in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-long-strings/m-p/246016#M45979</link>
    <description>&lt;P&gt;Dear Sas experts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a simple dataset with 2 char variables, one of each is actually a long string with unpredicted length.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data myLine;&lt;BR /&gt;infile datalines delimiter='|';&lt;BR /&gt;input myLine&amp;nbsp;$75. lineType $20.;&lt;BR /&gt;datalines;&lt;BR /&gt;L1. This is my very long line of unpredicted length.&amp;nbsp;| line_one&lt;BR /&gt;&lt;SPAN&gt;L2. &lt;/SPAN&gt;&lt;SPAN&gt;This is my second very long line of unpredicted length.&lt;/SPAN&gt;|&amp;nbsp;line&lt;SPAN&gt;_simple&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;L3. &lt;/SPAN&gt;&lt;SPAN&gt;This is my third, third, third very long line of unpredicted length.&lt;/SPAN&gt;| line_another&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the dataset looks weird, e.g.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;myLine &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;lineType&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is my very long line of unpredicted length.&amp;nbsp;| &lt;/SPAN&gt;&lt;SPAN&gt;line &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; one&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The results really depends on the length of the first column (myLine). The numbers .75 and .20 are arbitrary. When I put no numbers (just $) the lines are cut after 8 symbols, I believe.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What is the right way to allow unlimited length (or at least limited by 200 symbols) for the line and to create reliable column values.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jan 2016 22:58:36 GMT</pubDate>
    <dc:creator>braverju</dc:creator>
    <dc:date>2016-01-25T22:58:36Z</dc:date>
    <item>
      <title>Create a dataset with long strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-long-strings/m-p/246016#M45979</link>
      <description>&lt;P&gt;Dear Sas experts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a simple dataset with 2 char variables, one of each is actually a long string with unpredicted length.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data myLine;&lt;BR /&gt;infile datalines delimiter='|';&lt;BR /&gt;input myLine&amp;nbsp;$75. lineType $20.;&lt;BR /&gt;datalines;&lt;BR /&gt;L1. This is my very long line of unpredicted length.&amp;nbsp;| line_one&lt;BR /&gt;&lt;SPAN&gt;L2. &lt;/SPAN&gt;&lt;SPAN&gt;This is my second very long line of unpredicted length.&lt;/SPAN&gt;|&amp;nbsp;line&lt;SPAN&gt;_simple&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;L3. &lt;/SPAN&gt;&lt;SPAN&gt;This is my third, third, third very long line of unpredicted length.&lt;/SPAN&gt;| line_another&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the dataset looks weird, e.g.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;myLine &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;lineType&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is my very long line of unpredicted length.&amp;nbsp;| &lt;/SPAN&gt;&lt;SPAN&gt;line &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; one&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The results really depends on the length of the first column (myLine). The numbers .75 and .20 are arbitrary. When I put no numbers (just $) the lines are cut after 8 symbols, I believe.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What is the right way to allow unlimited length (or at least limited by 200 symbols) for the line and to create reliable column values.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2016 22:58:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-long-strings/m-p/246016#M45979</guid>
      <dc:creator>braverju</dc:creator>
      <dc:date>2016-01-25T22:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create a dataset with long strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-long-strings/m-p/246017#M45980</link>
      <description>&lt;P&gt;Use informats to specify the maximum length possible. Yes, the default length for a SAS character variable is 8.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data myLine;
informat myline $200. lineTYpe $20.;
infile datalines delimiter='|';
input myLine lineType ;
datalines;
L1. This is my very long line of unpredicted length. | line_one
L2. This is my second very long line of unpredicted length.| line_simple
L3. This is my third, third, third very long line of unpredicted length.| line_another
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Jan 2016 23:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-long-strings/m-p/246017#M45980</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-25T23:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create a dataset with long strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-long-strings/m-p/246051#M45991</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input myLine $75. lineType $20.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is called formatted input. SAS will read exactly the number of characters into a column that are specified, regardless of delimiters.&lt;/P&gt;
&lt;P&gt;If you want to specify maximum lengths for strings, but have variable lengths in the data (and want to honor the delimiters), do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;informat myLine $75. lineType $20.;
input myLine lineType;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jan 2016 06:20:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-long-strings/m-p/246051#M45991</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-01-26T06:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Create a dataset with long strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-long-strings/m-p/247110#M46294</link>
      <description>Thank you! Got it now. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Sun, 31 Jan 2016 15:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-dataset-with-long-strings/m-p/247110#M46294</guid>
      <dc:creator>braverju</dc:creator>
      <dc:date>2016-01-31T15:18:21Z</dc:date>
    </item>
  </channel>
</rss>

