<?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: Number of rows increased after the identification of columns for stacked 1-row data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Number-of-rows-increased-after-the-identification-of-columns-for/m-p/954748#M372861</link>
    <description>You only posted the import step. Please post the log of the step that increases the observation count by copy/pasting it into a window opened with the &amp;lt;/&amp;gt; button.</description>
    <pubDate>Mon, 30 Dec 2024 10:02:24 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2024-12-30T10:02:24Z</dc:date>
    <item>
      <title>Number of rows increased after the identification of columns for stacked 1-row data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-rows-increased-after-the-identification-of-columns-for/m-p/954743#M372860</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I imported the stacked 1-row data (1.8 Mn rows) into SAS and ran the below script to define the respective value for each column, I noticed that the output data is having 936 rows more than the imported data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I just follow the script that my colleague left to me before she has her maternity leave, please help advice on whether there is any problem&amp;nbsp; on the script? Thank you.&lt;/P&gt;&lt;P&gt;(@ has been replaced by (a))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data input_file;&lt;BR /&gt;infile 'imported_file' truncover lrecl = 923;&lt;BR /&gt;input&lt;BR /&gt;(a)1 case_no $13.&lt;BR /&gt;(a)14 acct $17&lt;BR /&gt;(a)31 patient_id $34.&lt;BR /&gt;(a)65 ptype $1&lt;BR /&gt;(a)66 adate ddmmyy10&lt;BR /&gt;(a)76 ddate ddmmyy10.&lt;BR /&gt;(a)86 alos $4.&lt;BR /&gt;(a)90 bdate ddmmyy10.&lt;BR /&gt;(a)100 agey $3.&lt;BR /&gt;(a)103 aged $3.&lt;BR /&gt;(a)106 filler1 $&lt;BR /&gt;(a)109 sex $1.&lt;BR /&gt;(a)110 dstat $2.&lt;BR /&gt;(a)112 bwt $4.&lt;BR /&gt;(a)116 diag01 $10. (a)126 diag02 $10. (a)136 diag03 $10. (a)146 diag04 $10. (a)156 diag05 $10.&amp;nbsp;(a)166 diag06 $10. (a)176 diag07 $10. (a)186 diag08 $10. (a)196 diag09 $10. (a)206 diag10 $10. (a)216 diag11 $10. (a)226 diag12 $10. (a)236 diag13 $10. (a)246 diag14 $10. (a)256 diag15 $10. (a)266 diag16 $10. (a)276 diag17 $10. (a)286 diag18 $10. (a)296 diag19 $10. (a)306 diag20 $10.&amp;nbsp;(a)316 diag21 $10. (a)326 diag22 $10. (a)336 diag23 $10. (a)346 diag24 $10. (a)356 diag25 $10. (a)366 diag26 $10. (a)376 diag27 $10. (a)386 diag28 $10. (a)396 diag29 $10. (a)406 diag30 $10. (a)416 oper01 $10. (a)426 oper02 $10. (a)436 oper03 $10. (a)446 oper04 $10. (a)456 oper05 $10.&amp;nbsp;(a)466 oper06 $10. (a)476 oper07 $10. (a)486 oper08 $10. (a)496 oper09 $10. (a)506 oper10 $10.&amp;nbsp;(a)516 oper11 $10. (a)526 oper12 $10. (a)536 oper13 $10. (a)546 oper14 $10. (a)556 oper15 $10.&amp;nbsp;(a)566 oper16 $10. (a)576 oper17 $10. (a)586 oper18 $10. (a)596 oper19 $10. (a)606 oper20 $10.&amp;nbsp;(a)616 oper21 $10. (a)626 oper22 $10. (a)636 oper23 $10. (a)646 oper24 $10. (a)656 oper25 $10. (a)666 oper26 $10. (a)676 oper27 $10. (a)686 oper28 $10. (a)696 oper29 $10. (a)706 oper30 $10.&lt;BR /&gt;(a)716 GrouperVersion $17.&lt;BR /&gt;(a)733 drg $6.&lt;BR /&gt;(a)739 Pat_ROM $1.&lt;BR /&gt;(a)740 Pat_SOI $1.&lt;BR /&gt;(a)741 Gstatus $2.&lt;BR /&gt;(a)743 RW $7.&lt;BR /&gt;(a)750 ELOS $5.&lt;BR /&gt;(a)755 EhighTrim $3.&lt;BR /&gt;(a)758 ElowTrim $3.&lt;BR /&gt;(a)761 dxv1_30 $30.&lt;BR /&gt;(a)791 Dx_ROM $30.&lt;BR /&gt;(a)821 Dx_SOI $30.&lt;BR /&gt;(a)851 px_vflag $30.&lt;BR /&gt;(a)881 u_pttype $1.&lt;BR /&gt;(a)882 px_class $30.&lt;BR /&gt;(a)912 newline$2.&lt;BR /&gt;;&lt;BR /&gt;format adate ddate bdate ddmmyy10.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 02:31:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-rows-increased-after-the-identification-of-columns-for/m-p/954743#M372860</guid>
      <dc:creator>IceFire</dc:creator>
      <dc:date>2024-12-30T02:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Number of rows increased after the identification of columns for stacked 1-row data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-rows-increased-after-the-identification-of-columns-for/m-p/954748#M372861</link>
      <description>You only posted the import step. Please post the log of the step that increases the observation count by copy/pasting it into a window opened with the &amp;lt;/&amp;gt; button.</description>
      <pubDate>Mon, 30 Dec 2024 10:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-rows-increased-after-the-identification-of-columns-for/m-p/954748#M372861</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-12-30T10:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Number of rows increased after the identification of columns for stacked 1-row data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-rows-increased-after-the-identification-of-columns-for/m-p/954799#M372884</link>
      <description>&lt;P&gt;Below is the log from SAS system. The total rows for "import_file" is 1855371&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ODS _ALL_ CLOSE;&lt;BR /&gt;OPTIONS DEV=PNG;&lt;BR /&gt;GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;FILENAME EGSR TEMP;&lt;BR /&gt;ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR&lt;BR /&gt;STYLE=HTMLBlue&lt;BR /&gt;STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HTMLBlue.css")&lt;BR /&gt;NOGTITLE&lt;BR /&gt;NOGFOOTNOTE&lt;BR /&gt;GPATH=&amp;amp;sasworklocation&lt;BR /&gt;ENCODING=UTF8&lt;BR /&gt;options(rolap="on")&amp;nbsp;;&lt;BR /&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;BR /&gt;GOPTIONS ACCESSIBLE;&lt;BR /&gt;data input_file;&lt;BR /&gt;infile '&lt;SPAN&gt;imported_file&lt;/SPAN&gt;' truncover lrecl = 923;&lt;BR /&gt;input&lt;BR /&gt;&lt;SPAN&gt;(a)1 case_no $13.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)14 acct $17&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)31 patient_id $34.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)65 ptype $1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)66 adate ddmmyy10&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)76 ddate ddmmyy10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)86 alos $4.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)90 bdate ddmmyy10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)100 agey $3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)103 aged $3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)106 filler1 $&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)109 sex $1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)110 dstat $2.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)112 bwt $4.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)116 diag01 $10. (a)126 diag02 $10. (a)136 diag03 $10. (a)146 diag04 $10. (a)156 diag05 $10.&amp;nbsp;(a)166 diag06 $10. (a)176 diag07 $10. (a)186 diag08 $10. (a)196 diag09 $10. (a)206 diag10 $10. (a)216 diag11 $10. (a)226 diag12 $10. (a)236 diag13 $10. (a)246 diag14 $10. (a)256 diag15 $10. (a)266 diag16 $10. (a)276 diag17 $10. (a)286 diag18 $10. (a)296 diag19 $10. (a)306 diag20 $10.&amp;nbsp;(a)316 diag21 $10. (a)326 diag22 $10. (a)336 diag23 $10. (a)346 diag24 $10. (a)356 diag25 $10. (a)366 diag26 $10. (a)376 diag27 $10. (a)386 diag28 $10. (a)396 diag29 $10. (a)406 diag30 $10. (a)416 oper01 $10. (a)426 oper02 $10. (a)436 oper03 $10. (a)446 oper04 $10. (a)456 oper05 $10.&amp;nbsp;(a)466 oper06 $10. (a)476 oper07 $10. (a)486 oper08 $10. (a)496 oper09 $10. (a)506 oper10 $10.&amp;nbsp;(a)516 oper11 $10. (a)526 oper12 $10. (a)536 oper13 $10. (a)546 oper14 $10. (a)556 oper15 $10.&amp;nbsp;(a)566 oper16 $10. (a)576 oper17 $10. (a)586 oper18 $10. (a)596 oper19 $10. (a)606 oper20 $10.&amp;nbsp;(a)616 oper21 $10. (a)626 oper22 $10. (a)636 oper23 $10. (a)646 oper24 $10. (a)656 oper25 $10. (a)666 oper26 $10. (a)676 oper27 $10. (a)686 oper28 $10. (a)696 oper29 $10. (a)706 oper30 $10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)716 GrouperVersion $17.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)733 drg $6.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)739 Pat_ROM $1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)740 Pat_SOI $1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)741 Gstatus $2.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)743 RW $7.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)750 ELOS $5.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)755 EhighTrim $3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)758 ElowTrim $3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)761 dxv1_30 $30.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)791 Dx_ROM $30.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)821 Dx_SOI $30.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)851 px_vflag $30.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)881 u_pttype $1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)882 px_class $30.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(a)912 newline$2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;format adate ddate bdate ddmmyy10.;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: The infile '&lt;SPAN&gt;imported_file&lt;/SPAN&gt;' is:&lt;BR /&gt;Filename=&lt;SPAN&gt;imported_file&lt;/SPAN&gt;,&lt;BR /&gt;Access Permission=-rw-r--r--,&lt;BR /&gt;Last Modified=27Dec2024:17:59:32,&lt;BR /&gt;File Size (bytes)=1642040648&lt;/P&gt;&lt;P&gt;NOTE: 1856307 records were read from the infile '&lt;SPAN&gt;imported_file&lt;/SPAN&gt;'.&lt;BR /&gt;The minimum record length was 881.&lt;BR /&gt;The maximum record length was 911.&lt;BR /&gt;NOTE: The data set WORK.&lt;SPAN&gt;input_file&lt;/SPAN&gt; has 1856307 observations and 90 variables.&lt;BR /&gt;NOTE: Compressing data set WORK.&lt;SPAN&gt;input_file&lt;/SPAN&gt; decreased size by 83.77 percent.&lt;BR /&gt;Compressed is 4243 pages; un-compressed would require 26146 pages.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 6.45 seconds&lt;BR /&gt;cpu time 6.17 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;GOPTIONS NOACCESSIBLE;&lt;BR /&gt;%LET _CLIENTTASKLABEL=;&lt;BR /&gt;%LET _CLIENTPROCESSFLOWNAME=;&lt;BR /&gt;%LET _CLIENTPROJECTPATH=;&lt;BR /&gt;%LET _CLIENTPROJECTPATHHOST=;&lt;BR /&gt;%LET _CLIENTPROJECTNAME=;&lt;BR /&gt;%LET _SASPROGRAMFILE=;&lt;BR /&gt;%LET _SASPROGRAMFILEHOST=;&lt;BR /&gt;&amp;nbsp;;*';*";*/;quit;run;&lt;BR /&gt;ODS _ALL_ CLOSE;&lt;BR /&gt;&lt;BR /&gt;QUIT; RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 01:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-rows-increased-after-the-identification-of-columns-for/m-p/954799#M372884</guid>
      <dc:creator>IceFire</dc:creator>
      <dc:date>2024-12-31T01:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Number of rows increased after the identification of columns for stacked 1-row data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-rows-increased-after-the-identification-of-columns-for/m-p/954800#M372885</link>
      <description>&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/471879"&gt;@IceFire&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Below is the log from SAS system. The total rows for &lt;EM&gt;&lt;STRONG&gt;"import_file"&lt;/STRONG&gt;&lt;/EM&gt; is 1855371&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How do you know that the total row count is 1,855,371, given that your log below reports 1,856,307 records?&amp;nbsp; (I presume that&lt;EM&gt;&lt;STRONG&gt;"import_file"&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;above refers to the same file as &lt;EM&gt;&lt;STRONG&gt;"imported_file"&lt;/STRONG&gt;&lt;/EM&gt; below).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;NOTE: The infile '&lt;SPAN&gt;imported_file&lt;/SPAN&gt;' is:&lt;BR /&gt;Filename=&lt;SPAN&gt;imported_file&lt;/SPAN&gt;,&lt;BR /&gt;Access Permission=-rw-r--r--,&lt;BR /&gt;Last Modified=27Dec2024:17:59:32,&lt;BR /&gt;File Size (bytes)=1642040648&lt;/P&gt;
&lt;P&gt;NOTE: &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;1856307&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt; records were read from the infile '&lt;EM&gt;&lt;STRONG&gt;imported_file'&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 04:35:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-rows-increased-after-the-identification-of-columns-for/m-p/954800#M372885</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-12-31T04:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Number of rows increased after the identification of columns for stacked 1-row data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Number-of-rows-increased-after-the-identification-of-columns-for/m-p/954813#M372897</link>
      <description>&lt;P&gt;Usually the reason for finding more LINES in a text file than you thought were written to the file is because one or more of the variables written to the file contained end of line characters in them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes you can solve this easily in SAS by using the TERMSTR= option of the INFILE statement.&amp;nbsp; But that only works when the real end of lines are marked by CRLF combination and the embedded character strings only contain single CR or single LF characters.&amp;nbsp; In that case you can use TERMSTR=CRLF on the INFILE statement.&amp;nbsp; Try it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile 'imported_file' truncover lrecl = 923 termstr=crlf ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Another possibility suggested by you use of the LRECL= option set to such a strange number is that perhaps you did the same thing when writing the file but some of the lines being written needed more than 923 characters.&amp;nbsp; That would have caused SAS to move to a new line when writing those values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the LENGTH= infile option if you want to try and do some analysis on the lengths of the lines in your text file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data lengths;
  infile 'imported_file' length=ll;
  input;
  row+1;
  length=ll;
run;
proc means n min max mean;
  var length;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 14:28:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Number-of-rows-increased-after-the-identification-of-columns-for/m-p/954813#M372897</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-12-31T14:28:47Z</dc:date>
    </item>
  </channel>
</rss>

