<?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 - Separate .Txt File While Import to EG in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241514#M44766</link>
    <description>Well for starters your record length is 20, and your lines are 18, so try changing that.</description>
    <pubDate>Sat, 02 Jan 2016 21:36:06 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-01-02T21:36:06Z</dc:date>
    <item>
      <title>How to - Separate .Txt File While Import to EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241481#M44760</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found a SAS document related to VIEW then I executed in my SAS EG locale. I think It needs to be 5 rows instead of 4 rows but I couldn’t see the the row which begins with frisbee. On the other hand, my another question is how to take student.txt file as following image, how should I separate it when import to EG. Does anyone here can show me with screenshot ? If you show me over student.txt file so much the better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname myv9lib 'C:\Try';
filename student 'C:\Try\student.txt';
data myv9lib.class(keep=name major credits)
   myv9lib.problems(keep=code date) / view=myv9lib.class;
infile student;
   input name $ 1-10 major $ 12-14 credits 16-18;
select;
when (name=' ' or major=' ' or credits=.)
         do code=01;
            date=datetime();
            output myv9lib.problems;
         end; 
when (0&amp;lt;credits&amp;lt;90)
         do code=02;
            date=datetime();
            output myv9lib.problems;
         end; 
otherwise
       output myv9lib.class;
   end;
run; 
proc print data=myv9lib.class;
run;  

proc print data=myv9lib.problems;
   format date datetime18.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a001278887.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a001278887.htm&lt;/A&gt; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1341i1C89F8CC829F342D/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="student.png" title="student.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jan 2016 22:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241481#M44760</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-01-01T22:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Separate .Txt File While Import to EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241496#M44762</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your every thing perfect except "Missover" option missed in your Infile statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try It... I got the results as you expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First Question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data myv9lib.class1(keep=name major credits)
   myv9lib.problems1(keep=code date) / view=myv9lib.class1;
infile student missover;
   input name $ 1-10 major $ 12-14 credits 16-18;
select;
when (name=' ' or major=' ' or credits=.)
         do code=01;
            date=datetime();
            output myv9lib.problems1;
         end; 
when (0&amp;lt;credits&amp;lt;90)
         do code=02;
            date=datetime();
            output myv9lib.problems1;
         end; 
otherwise
       output myv9lib.class1;
   end;
run; 
proc print data=myv9lib.class1;
run;  

proc print data=myv9lib.problems1;
   format date datetime18.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second Question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class(keep=name major credits);
infile student missover;
   input name $ 1-10 major $ 12-14 credits 16-18;
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Bharath&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 10:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241496#M44762</guid>
      <dc:creator>bharathkumar</dc:creator>
      <dc:date>2016-01-02T10:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Separate .Txt File While Import to EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241503#M44763</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help. About my second question, I have to say that, I want to see an image while we import the file from .txt to EG to understand better.I shared a&amp;nbsp; image as below. I’m not sure what should I do in the following image to get the data set as my previous message's image.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a002645812.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a002645812.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1343i6C8A2C3F179CA10A/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="SecondQuestion.png" title="SecondQuestion.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About the MISSOVER option, I found a website link. Actually, I nearly understood the option but by default how data reads to raw data from .txt ? How did the following output happen? In spite of following writing I couldn’t properly get it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;The DATA step reads the first value (22). Because the value is shorter than the 5 characters expected by the informat&lt;FONT color="#FF6600"&gt;,(This part is ok.) &lt;/FONT&gt;the DATA step attempts to finish filling the value with the next record (333).(&lt;FONT color="#FF6600"&gt;Why 333 ??? It is also shorter than the 5 characters&amp;nbsp;&lt;/FONT&gt;)This value is entered into the PDV and becomes the value of the TestNumber variable for the first observation. &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1344iA1C1EB97F59146D8/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="How.png" title="How.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 15:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241503#M44763</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-01-02T15:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Separate .Txt File While Import to EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241505#M44764</link>
      <description>Based on the code, you're not dealing with a delimited file, you have a fixed file.  Change it from delimited to fixed columns.</description>
      <pubDate>Sat, 02 Jan 2016 16:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241505#M44764</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-02T16:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Separate .Txt File While Import to EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241508#M44765</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Happy new year to you. I've already tried fixed selection but I couldn't get it.I put a image as below. What should I write now ?&amp;nbsp;&amp;nbsp;It is not&amp;nbsp;necessary but I just want to learn it. Can you lead me over the image, please ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1345iC1E83BDDC170857F/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Fixed.png" title="Fixed.png" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 16:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241508#M44765</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-01-02T16:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Separate .Txt File While Import to EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241514#M44766</link>
      <description>Well for starters your record length is 20, and your lines are 18, so try changing that.</description>
      <pubDate>Sat, 02 Jan 2016 21:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241514#M44766</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-02T21:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Separate .Txt File While Import to EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241517#M44767</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I've actually tried 18 also I put a image as below it includes the screen after I wrote 18 in "Fixed Colum" textbox.&amp;nbsp;Do you have a chance to try the srudent.txt ? But it is not necessarily .Thanks though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1346iD015F447526E9FE9/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="18.png" title="18.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 21:46:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241517#M44767</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-01-02T21:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Separate .Txt File While Import to EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241577#M44778</link>
      <description>&lt;P&gt;The columns are of fixed length but they are not all of the same length so you can't just set a value of 18 or 20.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As shown below the EG import wizard lets&amp;nbsp;you set different lengths simply by clicking on the right position in the preview grid. This will result in the correct SAS code being generated. See example below&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/1351i84CE3FD5884765C4/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2016 22:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241577#M44778</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-01-03T22:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to - Separate .Txt File While Import to EG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241767#M44820</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I selected the "Fixed Colum" radio button last time "Record Length" was enable. Now the "Record Length" is unable. I don't understand the reason. &amp;nbsp;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 23:37:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Separate-Txt-File-While-Import-to-EG/m-p/241767#M44820</guid>
      <dc:creator>turcay</dc:creator>
      <dc:date>2016-01-04T23:37:16Z</dc:date>
    </item>
  </channel>
</rss>

