<?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 raw data file problem in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/raw-data-file-problem/m-p/377480#M3049</link>
    <description>&lt;P&gt;Problem Statement :-&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;“HCA_file.txt” &lt;SPAN&gt;file contains different types of information for each Client_id, State,&lt;/SPAN&gt; DoB in&lt;SPAN&gt; header row and different purchases carried out on different dates in transaction&lt;/SPAN&gt; row.&lt;SPAN&gt; Import the data into SAS by retaining client_id and State such that i) Only&lt;/SPAN&gt; transaction data&lt;SPAN&gt; is imported ii) Only header data is imported&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA :-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Containing Headers Denoted with "D" and Transactions is &amp;nbsp;denoted as "C"&lt;/P&gt;&lt;P&gt;H 1097 VG 07JUL74&lt;BR /&gt;C 01FEB11 $109.5&lt;BR /&gt;H 1099 OT 13FEB79&lt;BR /&gt;C 01Mar11 $45.0&lt;BR /&gt;C 01May11 $45.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;kindly help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jul 2017 17:42:17 GMT</pubDate>
    <dc:creator>jonty</dc:creator>
    <dc:date>2017-07-19T17:42:17Z</dc:date>
    <item>
      <title>raw data file problem</title>
      <link>https://communities.sas.com/t5/SAS-Studio/raw-data-file-problem/m-p/377480#M3049</link>
      <description>&lt;P&gt;Problem Statement :-&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;“HCA_file.txt” &lt;SPAN&gt;file contains different types of information for each Client_id, State,&lt;/SPAN&gt; DoB in&lt;SPAN&gt; header row and different purchases carried out on different dates in transaction&lt;/SPAN&gt; row.&lt;SPAN&gt; Import the data into SAS by retaining client_id and State such that i) Only&lt;/SPAN&gt; transaction data&lt;SPAN&gt; is imported ii) Only header data is imported&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA :-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Containing Headers Denoted with "D" and Transactions is &amp;nbsp;denoted as "C"&lt;/P&gt;&lt;P&gt;H 1097 VG 07JUL74&lt;BR /&gt;C 01FEB11 $109.5&lt;BR /&gt;H 1099 OT 13FEB79&lt;BR /&gt;C 01Mar11 $45.0&lt;BR /&gt;C 01May11 $45.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;kindly help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 17:42:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/raw-data-file-problem/m-p/377480#M3049</guid>
      <dc:creator>jonty</dc:creator>
      <dc:date>2017-07-19T17:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: raw data file problem</title>
      <link>https://communities.sas.com/t5/SAS-Studio/raw-data-file-problem/m-p/377487#M3051</link>
      <description>&lt;P&gt;Since this looks an awful lot like a homework assignment I'm not going to provide a full solution but some hints.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One is read the entire line as text. SAS creates an automatic variable called _INFILE_ when any Input statement is executed.&lt;/P&gt;
&lt;P&gt;You can parse the values from the line conditionally by examining the first character of infile:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if _infile_ =: 'H' then do;&lt;/P&gt;
&lt;P&gt;&amp;lt;something&amp;gt;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;if _infile_ =: 'C' then do;&lt;/P&gt;
&lt;P&gt;&amp;lt;something&amp;gt;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;The Retain statement will indicate variables to keep values from one interation of the data step to the next.&lt;/P&gt;
&lt;P&gt;SCAN can pull out space delimited items from the text.&lt;/P&gt;
&lt;P&gt;An explicit Output statement when the data is type C will result in combined H and C data if the read and parse is done correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 17:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/raw-data-file-problem/m-p/377487#M3051</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-07-19T17:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: raw data file problem</title>
      <link>https://communities.sas.com/t5/SAS-Studio/raw-data-file-problem/m-p/377495#M3052</link>
      <description>&lt;P&gt;no its not a homework.....i am learning SAS on my own and got all these problem statements and data from one of my friend who did this course but he is in Japan now and i am working on these problem to solve it.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 18:13:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/raw-data-file-problem/m-p/377495#M3052</guid>
      <dc:creator>jonty</dc:creator>
      <dc:date>2017-07-19T18:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: raw data file problem</title>
      <link>https://communities.sas.com/t5/SAS-Studio/raw-data-file-problem/m-p/377587#M3061</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/149925"&gt;@jonty&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;no its not a homework.....i am learning SAS on my own and got all these problem statements and data from one of my friend who did this course but he is in Japan now and i am working on these problem to solve it.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Try the ideas that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;posted and either post the resulting working code (and mark it as the solution) or post what you have tried and ask a more detailed question.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 20:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/raw-data-file-problem/m-p/377587#M3061</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-19T20:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: raw data file problem</title>
      <link>https://communities.sas.com/t5/SAS-Studio/raw-data-file-problem/m-p/377621#M3062</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/149925"&gt;@jonty&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;no its not a homework.....i am learning SAS on my own and got all these problem statements and data from one of my friend who did this course but he is in Japan now and i am working on these problem to solve it.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Actually I would say this is self-assigned homework.&lt;FONT color="#999999" style="background-color: rgb(234, 234, 234);"&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm sure that we could post a variety of solutions, some that are on the esoteric side of coding options, between the users here.&lt;/P&gt;
&lt;P&gt;I suggested some keywords you can search in the help that will lead to knowing where to find things that will help learn some SAS basics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I find that I learn much better when attempting something, and frequently not getting right the first time. There are a number of things I can see with that example that might be potential issues but if you get something that works partially then it is likely that explainations on the solution will mean a bit more. Or you may surprise yourself as &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;mentions and get the whole solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The online help is usually quite good in SAS compared to a number of other software vendors. So it is worth while learning to use it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 23:20:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/raw-data-file-problem/m-p/377621#M3062</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-07-19T23:20:25Z</dc:date>
    </item>
  </channel>
</rss>

