<?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 can I import this massy Text file into SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103657#M258331</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is the look of all the columns. the header occours mutilple times in the file. and there are hundreds files like this so it is not realistic to manual revise all those files. thanks!!&lt;/P&gt;&lt;P&gt;&lt;IMG alt="textfile.bmp" class="jive-image-thumbnail jive-image" height="207" src="https://communities.sas.com/legacyfs/online/3077_textfile.bmp" width="586" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Feb 2013 19:21:38 GMT</pubDate>
    <dc:creator>Sherri</dc:creator>
    <dc:date>2013-02-08T19:21:38Z</dc:date>
    <item>
      <title>how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103651#M258325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All, how can I load this type text file(see image of part of the file below) in sas without the highlighed rows, they occure multiple times in the file. And there are hundreds of these type of file, I need to load them in to one dataset. Thanks much!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="3069" alt="textfile.bmp" class="jive-image-thumbnail jive-image" height="291" src="https://communities.sas.com/legacyfs/online/3069_textfile.bmp" width="637" /&gt;&lt;/P&gt;&lt;P&gt;I also attached the actual text file below:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 17:45:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103651#M258325</guid>
      <dc:creator>Sherri</dc:creator>
      <dc:date>2013-02-08T17:45:14Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103652#M258326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;infile tfile truncover;&lt;/P&gt;&lt;P&gt;input @1 RecType:$3.;&lt;/P&gt;&lt;P&gt;if RecType = 'DCRPT' then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to 11;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that gets rid of the page header.&amp;nbsp; You would then need to start the next input @1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use proc append to merge all of the datasets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 18:15:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103652#M258326</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-08T18:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103653#M258327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One way would be to exclude even more than you highlighted.&amp;nbsp; If all of your data records are similar to the ones shown in your example, the actual data lines are longer than all of the header records, with the exception of the page number record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, what appears to distinguish the data records from the page number header record, is that the last column of your data records (which I presume is between two specific columns in your actual file) are the only records that contain just a number between those columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As such, I'd write some code that read in the file, but only kept those records which had a valid number in the range of columns where actual cost is recorded.&amp;nbsp; Then, I'd use a datastep to read in the revised file, declaring the variable names in an input statement and declaring all of the desired formats and informats with format and informat statements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 18:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103653#M258327</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-02-08T18:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103654#M258328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If RECTYPE is $3 how can it be equal to 'DCRPT'?&amp;nbsp;&amp;nbsp; :smileyshocked: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think reading all the files as one input stream using wildcard fileref would be much more efficient than hundreds of PROC APPENDs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 18:37:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103654#M258328</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-02-08T18:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103655#M258329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;good catch...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 18:58:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103655#M258329</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-08T18:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103656#M258330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might could use the OS to concatenate prior to the data step.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 18:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103656#M258330</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-08T18:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103657#M258331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is the look of all the columns. the header occours mutilple times in the file. and there are hundreds files like this so it is not realistic to manual revise all those files. thanks!!&lt;/P&gt;&lt;P&gt;&lt;IMG alt="textfile.bmp" class="jive-image-thumbnail jive-image" height="207" src="https://communities.sas.com/legacyfs/online/3077_textfile.bmp" width="586" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 19:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103657#M258331</guid>
      <dc:creator>Sherri</dc:creator>
      <dc:date>2013-02-08T19:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103658#M258332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think anyone (that I noticed at least) was suggesting anything manual.&amp;nbsp; Can you post the notepad file itself rather than the screen shot of it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 19:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103658#M258332</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-02-08T19:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103659#M258333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes. here is the file. thanks much!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 19:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103659#M258333</guid>
      <dc:creator>Sherri</dc:creator>
      <dc:date>2013-02-08T19:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103660#M258334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can, post enough example data to represent most all the relevant issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of worrying about how to get rid of the parts you don't want I would flip that over and concentrate on how to read the parts you do want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 19:50:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103660#M258334</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-02-08T19:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103661#M258335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to exclude the totals at the bottom as well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should the DEPT value be considerd as having been entered on the blank lines below each value? For example do you want DEPT = ICU/CCU-TR for the PRODUCT value of CRRT/SLED on the second row of the detail lines?&lt;/P&gt;&lt;P&gt;The date column in the body of the data looks like it is incrementing a day of period 1 through 6 with a date. Should only the record that appears with those values have them, all records until the next read value have the same day number and date or exclude entirely?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 22:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103661#M258335</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-02-08T22:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103662#M258336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes. i want to exclude the totals at the bottom. Thanks much! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 22:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103662#M258336</guid>
      <dc:creator>Sherri</dc:creator>
      <dc:date>2013-02-08T22:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103663#M258337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Other than changing the location of your files in the filename statement the following should come awfully close.&amp;nbsp; I made two copies of your test data and put them in a directory labeled "c:\art\test".&amp;nbsp; The following code read in both files and parsed the records for the desired data.&amp;nbsp; It skips the last records of the file, which appear to be summary records:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename mydata "c:\art\test\*.txt";&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile mydata lrecl=131 pad truncover;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat dept product $char10.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat charge_description $24.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat ordering_md type $12.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat type $2.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat day anydtdte8.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format day date9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat class $char16.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat ip_volume charge_quantity 4.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format ip_volume charge_quantity 4.1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat actual_cost total_charge comma9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format actual_cost total_charge comma9.2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input @;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if input(substr(_infile_,123),?? comma9.) and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(_infile_,10,15) ne "CHARGE QUANTITY" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dept 2-11&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @13 product &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @24 charge_description &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @49 ordering_md &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type 64-65&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; day 67-75&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class 76-92&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @94 ip_volume&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @103 charge_quantity&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @112 actual_cost&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @123 total_charge&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else input;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 23:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103663#M258337</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-02-08T23:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103664#M258338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great! it runs just perfectly!! thank you so much Arthur and everyone!&lt;/P&gt;&lt;P&gt;I just have one more question: the first column "Dept" is not populated for every single record. how can I fill the empty field with the value of the record above until the new value and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And lastly add a column for patient ID. Patient ID stays the same within each file since one file is for one patient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sorry I have some many questions. I really appreciate your help!! many thanks again!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2013 01:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103664#M258338</guid>
      <dc:creator>Sherri</dc:creator>
      <dc:date>2013-02-09T01:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103665#M258339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename mydata "c:\art\test\*.txt";&lt;/P&gt;&lt;P&gt;data want (drop=dept_in);&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile mydata lrecl=131 pad truncover eov=newfile;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat patient dept dept_in product $char10.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat charge_description $24.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat ordering_md type $12.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat type $2.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat day anydtdte8.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format day date9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat class $char16.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat ip_volume charge_quantity 4.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format ip_volume charge_quantity 4.1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat actual_cost total_charge comma9.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format actual_cost total_charge comma9.2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; retain patient dept;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input @;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if newfile then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newfile=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else counter+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if counter eq 3 then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @ "ENCOUNTER " patient;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if input(substr(_infile_,123),?? comma9.) and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(_infile_,10,15) ne "CHARGE QUANTITY" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dept_in 2-11&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @13 product &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @24 charge_description &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @49 ordering_md &amp;amp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type 64-65&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; day 67-75&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class 76-92&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @94 ip_volume&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @103 charge_quantity&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @112 actual_cost&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @123 total_charge&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not missing(strip(dept_in)) then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dept=dept_in;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else input;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2013 01:46:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103665#M258339</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-02-09T01:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103666#M258340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much Arthur!!! it runs exactly the way I want.you've helped me tremendously!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2013 02:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103666#M258340</guid>
      <dc:creator>Sherri</dc:creator>
      <dc:date>2013-02-09T02:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103667#M258341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arthur, I was trying to do the same thing for "type" and "day" like you did for "dept", which is filling the empty cell with the value of the record about it untill the new value and so on. But without success. can you show me what the correct code should be? Thanks very much again for your help!&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2013 19:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103667#M258341</guid>
      <dc:creator>Sherri</dc:creator>
      <dc:date>2013-02-11T19:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103668#M258342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have time to test any of this, this week, but here is a changed version of the code that does the same thing for type and day.&amp;nbsp; I've put /* &amp;lt;- */ comments to the right of each line that I either changed or added:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;filename mydata "c:\art\test\*.txt";&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;data want (drop=dept_in type_in day_in);&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;lt;- */&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; infile mydata lrecl=131 pad truncover eov=newfile;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; informat patient dept dept_in product $char10.;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; informat charge_description $24.;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; informat ordering_md type $12.;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; informat type type_in $2.;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* &amp;lt;- */&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; informat day day_in anydtdte8.;&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;lt;- */&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; format day date9.;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; informat class $char16.;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; informat ip_volume charge_quantity 4.;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; format ip_volume charge_quantity 4.1;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; informat actual_cost total_charge comma9.;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; format actual_cost total_charge comma9.2;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; retain patient dept type day;&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;&amp;nbsp; /* &amp;lt;- */&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; input @;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; if newfile then do;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; counter=1;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newfile=0;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; else counter+1;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; if counter eq 3 then do;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @ "ENCOUNTER " patient;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; else if input(substr(_infile_,123),?? comma9.) and&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; substr(_infile_,10,15) ne "CHARGE QUANTITY" then do;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dept_in 2-11&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @13 product &amp;amp;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @24 charge_description &amp;amp;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @49 ordering_md &amp;amp;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type_in 64-65&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;&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;lt;- */&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; day_in 67-75&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;&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;lt;- */&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class 76-92&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @94 ip_volume&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @103 charge_quantity&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @112 actual_cost&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @123 total_charge&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not missing(strip(dept_in)) then &lt;SPAN style="font-family: inherit; font-style: inherit; font-size: 10pt; line-height: 1.5em;"&gt;dept=dept_in;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: inherit; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not missing(strip(type_in)) then&lt;SPAN style="font-family: inherit; font-style: inherit; font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; type=type_in;&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;lt;- */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: inherit; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not missing(day_in) then&amp;nbsp; day=day_in;&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;lt;- */&lt;/P&gt;&lt;P style="font-family: inherit; font-style: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;&amp;nbsp; else input;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit;"&gt;run&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/message/153456/edit" style="font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2013 19:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103668#M258342</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-02-11T19:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: how can I import this massy Text file into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103669#M258343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see I overlooked the retain command. you are just great!! I really appreciate your help Arthur!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2013 20:24:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-can-I-import-this-massy-Text-file-into-SAS/m-p/103669#M258343</guid>
      <dc:creator>Sherri</dc:creator>
      <dc:date>2013-02-11T20:24:26Z</dc:date>
    </item>
  </channel>
</rss>

