<?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: Reading raw files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/459024#M116535</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144906"&gt;@emrancaan&lt;/a&gt;&amp;nbsp;3 passes for a simple reading is rather not desirable. It would only make it very time consuming&lt;/P&gt;</description>
    <pubDate>Tue, 01 May 2018 16:11:06 GMT</pubDate>
    <dc:creator>MarkWik</dc:creator>
    <dc:date>2018-05-01T16:11:06Z</dc:date>
    <item>
      <title>Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/458988#M116519</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a raw file with data like this:&lt;/P&gt;&lt;P&gt;108263 $946.00 $903.00 $804.00 $674.00 $663.00 $195.00 $922.00 $595.00 $157.00 $415.00 $868.00 $750.00&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;103681 $135.00 $573.00 $642.00 $208.00 $922.00 $592.00 $425.00 $658.00 $131.00 $648.00 $750.00 $515.00&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;116865 $624.00 $679.00 $402.00 $636.00 $358.00 $560.00 $884.00 $514.00 $565.00 $278.00 $117.00 $852.00&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;102998 $747.00 $505.00 $549.00 $942.00 $884.00 $991.00 $480.00 $326.00 $447.00 $617.00 $721.00 $874.00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It represents a clientID and some bills for 12 months.&lt;/P&gt;&lt;P&gt;I need the output to be something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Bill&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Month&lt;BR /&gt;108263&amp;nbsp; $946.00&amp;nbsp; 01&lt;BR /&gt;108263&amp;nbsp; $903.00&amp;nbsp; 02&lt;BR /&gt;108263&amp;nbsp; $804.00&amp;nbsp; 03&lt;BR /&gt;108263&amp;nbsp; $674.00&amp;nbsp; 04&lt;BR /&gt;108263&amp;nbsp; $663.00&amp;nbsp; 05&lt;BR /&gt;108263&amp;nbsp; $195.00&amp;nbsp; 06&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I go about it?&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 14:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/458988#M116519</guid>
      <dc:creator>RichaRashmi</dc:creator>
      <dc:date>2018-05-01T14:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/458994#M116521</link>
      <description>&lt;P&gt;I'd probably read it as is and then use PROC TRANSPOSE to transpose it to a long format.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you can use the trailing&amp;nbsp;@@ in your INPUT statement to keep the line held there using a do loop, especially if you know ahead of time the number of columns.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile 'path to your file.txt' dlm=' ';
informat Value dollar12.2;

input ID @;
do i=1 to 12;
input Value @@;
output;
end;

run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 15:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/458994#M116521</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-01T15:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/458997#M116523</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines truncover;
input id   Bill : comma10. @;
call missing(month);
do while(not missing(bill));
month+1;
output;
input     Bill : comma10. @ ;
end;
datalines;
108263 $946.00 $903.00 $804.00 $674.00 $663.00 $195.00 $922.00 $595.00 $157.00 $415.00 $868.00 $750.00 
103681 $135.00 $573.00 $642.00 $208.00 $922.00 $592.00 $425.00 $658.00 $131.00 $648.00 $750.00 $515.00 
116865 $624.00 $679.00 $402.00 $636.00 $358.00 $560.00 $884.00 $514.00 $565.00 $278.00 $117.00 $852.00 
102998 $747.00 $505.00 $549.00 $942.00 $884.00 $991.00 $480.00 $326.00 $447.00 $617.00 $721.00 $874.00
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 15:13:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/458997#M116523</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-01T15:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/459017#M116530</link>
      <description>&lt;P&gt;An example reading inline data:&lt;/P&gt;
&lt;PRE&gt;data want;
   informat id $8. bill comma12.2;
   format bill dollar12.2;
   input id @;
   do month=1 to 12;
      input bill @;
      output;
   end;
   input;

datalines;
108263 $946.00 $903.00 $804.00 $674.00 $663.00 $195.00 $922.00 $595.00 $157.00 $415.00 $868.00 $750.00 
103681 $135.00 $573.00 $642.00 $208.00 $922.00 $592.00 $425.00 $658.00 $131.00 $648.00 $750.00 $515.00 
116865 $624.00 $679.00 $402.00 $636.00 $358.00 $560.00 $884.00 $514.00 $565.00 $278.00 $117.00 $852.00 
102998 $747.00 $505.00 $549.00 $942.00 $884.00 $991.00 $480.00 $326.00 $447.00 $617.00 $721.00 $874.00
;
run;
&lt;/PRE&gt;
&lt;P&gt;Your program would have an infile statement pointing to the source data file and not have the datalines section.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the month to appear with a leading 0 assign a Z2. format.&lt;/P&gt;
&lt;P&gt;Or perhaps create a actual date with date=mdy(1,month,2017); or appropriate year value and assign a date format.&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 15:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/459017#M116530</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-01T15:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/459021#M116533</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
Input ID $ jan $ feb $  mar $ apr $ may $ jun $ jul $ aug $ sep $ oct $ nov $ dec $;
datalines;
108263 $946.00 $903.00 $804.00 $674.00 $663.00 $195.00 $922.00 $595.00 $157.00 $415.00 $868.00 $750.00
103681 $135.00 $573.00 $642.00 $208.00 $922.00 $592.00 $425.00 $658.00 $131.00 $648.00 $750.00 $515.00
116865 $624.00 $679.00 $402.00 $636.00 $358.00 $560.00 $884.00 $514.00 $565.00 $278.00 $117.00 $852.00
102998 $747.00 $505.00 $549.00 $942.00 $884.00 $991.00 $480.00 $326.00 $447.00 $617.00 $721.00 $874.00
;
run;
proc sort data=have; by id; run; 
Proc transpose data=have out=want;
 by ID ;
 var jan  feb   mar  apr  may  jun  jul  aug  sep  oct  nov  dec ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2018 16:08:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/459021#M116533</guid>
      <dc:creator>emrancaan</dc:creator>
      <dc:date>2018-05-01T16:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/459024#M116535</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144906"&gt;@emrancaan&lt;/a&gt;&amp;nbsp;3 passes for a simple reading is rather not desirable. It would only make it very time consuming&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 16:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/459024#M116535</guid>
      <dc:creator>MarkWik</dc:creator>
      <dc:date>2018-05-01T16:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/459052#M116546</link>
      <description>This is perfect. Thank You!</description>
      <pubDate>Tue, 01 May 2018 18:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/459052#M116546</guid>
      <dc:creator>RichaRashmi</dc:creator>
      <dc:date>2018-05-01T18:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/459214#M116614</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/34445"&gt;@MarkWik&lt;/a&gt;&amp;nbsp;&amp;nbsp; Thanks for your valuable input.&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 08:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-raw-files/m-p/459214#M116614</guid>
      <dc:creator>emrancaan</dc:creator>
      <dc:date>2018-05-02T08:54:30Z</dc:date>
    </item>
  </channel>
</rss>

