<?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 Reading raw datafiles in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470885#M285691</link>
    <description>&lt;P&gt;“HCA_file.txt” file contains different types of information for each Client_id, State, DoB in header row and different purchases carried out on different dates in transaction row. Import the data into SAS by retaining client_id and State such that i) Only transaction data is imported ii) Only header data is imported&lt;/P&gt;</description>
    <pubDate>Sun, 17 Jun 2018 16:17:43 GMT</pubDate>
    <dc:creator>GAUTAMDVN</dc:creator>
    <dc:date>2018-06-17T16:17:43Z</dc:date>
    <item>
      <title>Reading raw datafiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470885#M285691</link>
      <description>&lt;P&gt;“HCA_file.txt” file contains different types of information for each Client_id, State, DoB in header row and different purchases carried out on different dates in transaction row. Import the data into SAS by retaining client_id and State such that i) Only transaction data is imported ii) Only header data is imported&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 16:17:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470885#M285691</guid>
      <dc:creator>GAUTAMDVN</dc:creator>
      <dc:date>2018-06-17T16:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw datafiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470887#M285692</link>
      <description>&lt;P&gt;Show us your code.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 16:22:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470887#M285692</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-17T16:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw datafiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470889#M285693</link>
      <description>&lt;P&gt;Hi &lt;SPAN&gt;Paige Miller,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm not able to find any relevant logic to write the statements to import the data into SAS because almost in every records there is different type of data but according to the query they've only ID, State, DOB and different purchases.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 16:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470889#M285693</guid>
      <dc:creator>GAUTAMDVN</dc:creator>
      <dc:date>2018-06-17T16:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw datafiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470896#M285694</link>
      <description>&lt;P&gt;It’s a well formatted file. There are two record types, C and H which appear consistent in the example posted. Search conditional input if you have no idea of where to start.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213398"&gt;@GAUTAMDVN&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi &lt;SPAN&gt;Paige Miller,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm not able to find any relevant logic to write the statements to import the data into SAS because almost in every records there is different type of data but according to the query they've only ID, State, DOB and different purchases.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 17:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470896#M285694</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-17T17:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw datafiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470908#M285695</link>
      <description>&lt;P&gt;Hi, please confirm why I'm wrong in the below code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA X1;
INFILE HCA ;
INPUT ID $ @;
IF ID  = 'H' THEN INPUT CLIENT_ID STATE $ DOB : DATE7. ;
ELSE IF ID = 'C' THEN INPUT TRANSACTION_DATE : DATE7. PURCHASE : COMMA11.2;
FORMAT DOB transaction_date DATE9. PURCHASE DOLLAR11.2 ;
RUN ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Jun 2018 19:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470908#M285695</guid>
      <dc:creator>GAUTAMDVN</dc:creator>
      <dc:date>2018-06-17T19:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw datafiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470910#M285696</link>
      <description>&lt;P&gt;What makes you think its wrong in the first place? If you have errors in your log post the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213398"&gt;@GAUTAMDVN&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, please confirm why I'm wrong in the below code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA X1;
INFILE HCA ;
INPUT ID $ @;
IF ID  = 'H' THEN INPUT CLIENT_ID STATE $ DOB : DATE7. ;
ELSE IF ID = 'C' THEN INPUT TRANSACTION_DATE : DATE7. PURCHASE : COMMA11.2;
FORMAT DOB transaction_date DATE9. PURCHASE DOLLAR11.2 ;
RUN ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 19:21:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470910#M285696</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-17T19:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw datafiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470913#M285697</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The code is correct as per attachment but not able to i&lt;SPAN&gt;mport the data into SAS by retaining only client_id and State such that &lt;STRONG&gt;A.&lt;/STRONG&gt; only transaction data is imported &amp;nbsp;&lt;STRONG&gt;B.&amp;nbsp;&lt;/STRONG&gt;only header data is imported&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 19:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470913#M285697</guid>
      <dc:creator>GAUTAMDVN</dc:creator>
      <dc:date>2018-06-17T19:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw datafiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470915#M285698</link>
      <description>&lt;P&gt;The data is being read in correctly. You have not&amp;nbsp;accounted for the fact that you want to retain the header information across the rows. You can look into RETAIN to hold values until you need to reset it. Please post your code and output directly into the forum rather than as attachments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213398"&gt;@GAUTAMDVN&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The code is correct as per attachment but not able to i&lt;SPAN&gt;mport the data into SAS by retaining only client_id and State such that &lt;STRONG&gt;A.&lt;/STRONG&gt; only transaction data is imported &amp;nbsp;&lt;STRONG&gt;B.&amp;nbsp;&lt;/STRONG&gt;only header data is imported&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 19:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470915#M285698</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-17T19:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw datafiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470924#M285699</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The data is being read in correctly. You have not&amp;nbsp;accounted for the fact that you want to retain the header information across the rows. You can look into RETAIN to hold values until you need to reset it. Please post your code and output directly into the forum rather than as attachments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213398"&gt;@GAUTAMDVN&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The code is correct as per attachment but not able to i&lt;SPAN&gt;mport the data into SAS by retaining only client_id and State such that &lt;STRONG&gt;A.&lt;/STRONG&gt; only transaction data is imported &amp;nbsp;&lt;STRONG&gt;B.&amp;nbsp;&lt;/STRONG&gt;only header data is imported&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-06-17 at 1.42.05 PM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21236i0F9BFA9189DAA5C5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-06-17 at 1.42.05 PM.png" alt="Screen Shot 2018-06-17 at 1.42.05 PM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-06-17 at 1.42.22 PM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21237i6F52E2282E141A20/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-06-17 at 1.42.22 PM.png" alt="Screen Shot 2018-06-17 at 1.42.22 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 19:47:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/470924#M285699</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-17T19:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw datafiles</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/530446#M285700</link>
      <description>&lt;P&gt;This should do the job&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data HCA_file (drop = fil);&lt;BR /&gt;infile " " ;&lt;BR /&gt;input fil :$1 @ ;&lt;BR /&gt;if fil = "H" then&lt;BR /&gt;input #1 @3 Id :$6. State :$4. ;&lt;BR /&gt;if fil = "C" then&lt;BR /&gt;input Dates :date9. Transaction :dollar6.2 ;&lt;/P&gt;&lt;P&gt;retain ID state Date;&lt;BR /&gt;if dates = . then delete;&lt;BR /&gt;format Dates date9.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data HCA_file (drop = fil);&lt;BR /&gt;infile " " ;&lt;BR /&gt;input fil :$1 @;&lt;BR /&gt;if fil = "H" then&lt;BR /&gt;input Id :$6. State :$4. DOB :date9.;&lt;BR /&gt;if fil ="C" then delete;&lt;BR /&gt;format dob date9.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jan 2019 12:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-datafiles/m-p/530446#M285700</guid>
      <dc:creator>akki39k</dc:creator>
      <dc:date>2019-01-27T12:15:13Z</dc:date>
    </item>
  </channel>
</rss>

