<?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 to read row delimiter in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-row-delimiter-in-SAS/m-p/371298#M88691</link>
    <description>&lt;P&gt;The problem is twofold:&lt;/P&gt;
&lt;P&gt;- SAS only accepts CR, LF or CRLF as line separators in variable-length text files.&lt;/P&gt;
&lt;P&gt;- your file already contains spurious CRLF sequences&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So one would have to first remove the CRLF present, and then replace the "&amp;lt;" with either a single LF or CRLF.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On UNIX I would try to use the tr filter, but I have no idea if that would work.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jun 2017 13:47:56 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-06-28T13:47:56Z</dc:date>
    <item>
      <title>How to read row delimiter in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-row-delimiter-in-SAS/m-p/371290#M88686</link>
      <description>&lt;P&gt;I am trying to read the data from .txt external file through SAS Code,it has '|' as a column delimiter and '&amp;lt;' as a row delimiter.I am not able to read the data in proper way,I am using below mentioned code to read the data from the server.Data is coming in as a data stream without any end of line indicators like CRLF.I tried all the options FLOWOVER,MISSOVER and TRUCOVER but i am not getting the desired result.Can someone let me know how to read the row delimiter here ? Thanks for your help.&lt;BR /&gt;&lt;BR /&gt;DATA WORK.PURCHASE;&lt;BR /&gt;LENGTH&lt;BR /&gt;Filer_TIN $ 11&lt;BR /&gt;Ret_Type $ 1&lt;BR /&gt;Period_Key 8&lt;BR /&gt;TAXABLE_GOODS_VAL 8&lt;BR /&gt;AMT_TAX_VAL 8&lt;BR /&gt;INCL_TAX_VAL 8&lt;BR /&gt;COMP_VAL 8&lt;BR /&gt;TAX_FRE_SALES_VAL 8&lt;BR /&gt;EXEM_SALES_VAL 8&lt;BR /&gt;LABOUR_CHRGES_VAL 8&lt;BR /&gt;OTHER_CHRGES_VAL 8&lt;BR /&gt;GROSS_TOTAL_VAL 8&lt;BR /&gt;FORM_NUM 8&lt;BR /&gt;TYPE_OF_TX 8&lt;BR /&gt;Partner_TIN $ 11;&lt;BR /&gt;FORMAT&lt;BR /&gt;Filer_TIN $CHAR11.&lt;BR /&gt;Ret_Type $CHAR1.&lt;BR /&gt;Period_Key BEST4.&lt;BR /&gt;TAXABLE_GOODS_VAL BEST11.&lt;BR /&gt;AMT_TAX_VAL BEST9.&lt;BR /&gt;INCL_TAX_VAL BEST10.&lt;BR /&gt;COMP_VAL BEST9.&lt;BR /&gt;TAX_FRE_SALES_VAL BEST10.&lt;BR /&gt;EXEM_SALES_VAL BEST8.&lt;BR /&gt;LABOUR_CHRGES_VAL BEST10.&lt;BR /&gt;OTHER_CHRGES_VAL BEST9.&lt;BR /&gt;GROSS_TOTAL_VAL BEST11.&lt;BR /&gt;FORM_NUM BEST3.&lt;BR /&gt;TYPE_OF_TX BEST2.&lt;BR /&gt;Partner_TIN $CHAR11.;&lt;BR /&gt;INFORMAT&lt;BR /&gt;Filer_TIN $CHAR11.&lt;BR /&gt;Ret_Type $CHAR1.&lt;BR /&gt;Period_Key BEST4.&lt;BR /&gt;TAXABLE_GOODS_VAL BEST11.&lt;BR /&gt;AMT_TAX_VAL BEST9.&lt;BR /&gt;INCL_TAX_VAL BEST10.&lt;BR /&gt;COMP_VAL BEST9.&lt;BR /&gt;TAX_FRE_SALES_VAL BEST10.&lt;BR /&gt;EXEM_SALES_VAL BEST8.&lt;BR /&gt;LABOUR_CHRGES_VAL BEST10.&lt;BR /&gt;OTHER_CHRGES_VAL BEST9.&lt;BR /&gt;GROSS_TOTAL_VAL BEST11.&lt;BR /&gt;FORM_NUM BEST3.&lt;BR /&gt;TYPE_OF_TX BEST2.&lt;BR /&gt;Partner_TIN $CHAR11.;&lt;BR /&gt;INFILE '/sas/EIUData/PURCHASE_ANNEX.txt'&lt;BR /&gt;LRECL=102&lt;BR /&gt;ENCODING="UTF-8"&lt;BR /&gt;DLMSTR="|" truncover;&lt;BR /&gt;&lt;BR /&gt;INPUT&lt;BR /&gt;Filer_TIN : $CHAR11.&lt;BR /&gt;Ret_Type : $CHAR1.&lt;BR /&gt;Period_Key : ?? BEST4.&lt;BR /&gt;TAXABLE_GOODS_VAL : ?? COMMA11.&lt;BR /&gt;AMT_TAX_VAL : ?? COMMA9.&lt;BR /&gt;INCL_TAX_VAL : ?? COMMA10.&lt;BR /&gt;COMP_VAL : ?? COMMA9.&lt;BR /&gt;TAX_FRE_SALES_VAL : ?? COMMA10.&lt;BR /&gt;EXEM_SALES_VAL : ?? COMMA8.&lt;BR /&gt;LABOUR_CHRGES_VAL : ?? COMMA10.&lt;BR /&gt;OTHER_CHRGES_VAL : ?? COMMA9.&lt;BR /&gt;GROSS_TOTAL_VAL : ?? COMMA11.&lt;BR /&gt;FORM_NUM : ?? BEST3.&lt;BR /&gt;TYPE_OF_TX : ?? BEST2.&lt;BR /&gt;Partner_TIN : $CHAR11. ;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sample Data :&lt;BR /&gt;&lt;BR /&gt;27020018076 |R|1606|5045.48|277.48|0.00|0.00|0.00|0.00|0.00|0.00|5322.96|231 |10 |27080058880 |&amp;lt;27020018076 |R|1606|947.87|52.13|0.00|0.00|0.00|0.00|&lt;BR /&gt;0.00|0.00|1000.00|231 |10 |27131130266 |&amp;lt;27020018076 |R|1606|1848.34|101.66|0.00|0.00|0.00|0.00|0.00|0.00|1950.00|231 |10 |27220036105&lt;BR /&gt;|&amp;lt;27020018076 |R|1606|8597.17|472.85|0.00|0.00|0.00|0.00|0.00|0.00|9070.02|231 |10 |27220646138 |&amp;lt;27020018076 |R|1606|22800.00|1360.00|0.00|&lt;BR /&gt;0.00|0.00|0.00|0.00|0.00|24160.00|231 |10 |27240041138 |&amp;lt;27020018076 |R|1606|67096.22|4025.02|0.00|0.00|0.00|0.00|0.00|0.00|71121.24|231 |10&lt;BR /&gt;|27260645728 |&amp;lt;27020018076 |R|1606|6493.12|357.12|0.00|0.00|0.00|0.00|0.00|0.00|6850.24|231 |10 |27270301033 |&amp;lt;27020018076 |R|1606|945001.00|&lt;BR /&gt;52605.00|0.00|0.00|0.00|0.00|0.00|0.00|997606.00|231 |10 |27290000710 |&amp;lt;27020018076 |R|1606|3981.04|218.96|0.00|0.00|0.00|0.00|0.00|0.00|4200.00|&lt;BR /&gt;231 |10 |27290279682 |&amp;lt;27020018076 |R|1606|2800.00|168.00|0.00|0.00|0.00|0.00|0.00|0.00|2968.00|231 |10 |27361171219 |&amp;lt;27020018076 |R|1606|&lt;BR /&gt;59052.49|3247.87|0.00|0.00|0.00|0.00|0.00|0.00|62300.36|231 |10 |27390019279 |&amp;lt;27020018076 |R|1606|8583163.22|514989.78|0.00|0.00|0.00|0.00|&lt;BR /&gt;0.00|0.00|9098153.00|231 |10 |27460293314 |&amp;lt;27020018076 |R|1606|440662.27|26439.73|0.00|0.00|0.00|0.00|0.00|0.00|467102.00|231 |10 |&lt;BR /&gt;27490371140 |&amp;lt;27020018076 |R|1606|4146.96|228.08|0.00|0.00|0.00|0.00|0.00|0.00|4375.04|231 |10 |27530294100 |&amp;lt;27020018076 |R|1606|54424.24|&lt;BR /&gt;7347.24|0.00|0.00|0.00|0.00|0.00|0.00|61771.48|231 |10 |27610060189 |&amp;lt;27020018076 |R|1606|3500.50|192.50|0.00|0.00|0.00|0.00|0.00|0.00|3693.00|&lt;BR /&gt;231 |10 |27650269493 |&amp;lt;27020018076 |R|1606|471985.10|28319.10|0.00|0.00|0.00|0.00|0.00|0.00|500304.20|231 |10 |27670990871 |&amp;lt;27020018076 |&lt;BR /&gt;R|1606|2853.81|171.23|0.00|0.00|0.00|0.00|0.00|0.00|3025.04|231 |10 |27690241729 |&amp;lt;27020018076 |R|1606|642012.00|38970.74|0.00|0.00|0.00|0.00|&lt;BR /&gt;&lt;BR /&gt;Kindly find the attached sample data for refrence.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 13:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-row-delimiter-in-SAS/m-p/371290#M88686</guid>
      <dc:creator>Qavi</dc:creator>
      <dc:date>2017-06-28T13:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to read row delimiter in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-row-delimiter-in-SAS/m-p/371295#M88688</link>
      <description>&lt;P&gt;Read it using RECFM=N or S and use both | and &amp;lt; as delimiters. That should work as long as all "lines" have all of the variables.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 13:38:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-row-delimiter-in-SAS/m-p/371295#M88688</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-28T13:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to read row delimiter in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-row-delimiter-in-SAS/m-p/371298#M88691</link>
      <description>&lt;P&gt;The problem is twofold:&lt;/P&gt;
&lt;P&gt;- SAS only accepts CR, LF or CRLF as line separators in variable-length text files.&lt;/P&gt;
&lt;P&gt;- your file already contains spurious CRLF sequences&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So one would have to first remove the CRLF present, and then replace the "&amp;lt;" with either a single LF or CRLF.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On UNIX I would try to use the tr filter, but I have no idea if that would work.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 13:47:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-row-delimiter-in-SAS/m-p/371298#M88691</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-28T13:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to read row delimiter in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-row-delimiter-in-SAS/m-p/371309#M88698</link>
      <description>&lt;P&gt;Why not just pre-process the messed up file and make a normal file out of it?&lt;/P&gt;
&lt;P&gt;This step seems to do the job for your example file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile tmpfile1 recfm=n dsd dlm='|&amp;lt;';
  file tmpfile2 dsd dlm='|';
  length v1-v16 $100 ;
  input v1-v16 ;
  array v v1-v16; do over v; v=translate(v,'  ','0D0A'x); end;
  put v1-v16;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;076|R|1606|5045.48|277.48|0.00|0.00|0.00|0.00|0.00|0.00|5322.96|231|10|27080058880|
076|R|1606|947.87|52.13|0.00|0.00|0.00|0.00|0.00|0.00|1000.00|231|10|27131130266|
076|R|1606|1848.34|101.66|0.00|0.00|0.00|0.00|0.00|0.00|1950.00|231|10|27220036105|
076|R|1606|8597.17|472.85|0.00|0.00|0.00|0.00|0.00|0.00|9070.02|231|10|27220646138|
076|R|1606|22800.00|1360.00|0.00|0.00|0.00|0.00|0.00|0.00|24160.00|231|10|27240041138|
076|R|1606|67096.22|4025.02|0.00|0.00|0.00|0.00|0.00|0.00|71121.24|231|10|27260645728|
076|R|1606|6493.12|357.12|0.00|0.00|0.00|0.00|0.00|0.00|6850.24|231|10|27270301033|
076|R|1606|945001.00|52605.00|0.00|0.00|0.00|0.00|0.00|0.00|997606.00|231|10|27290000710|
076|R|1606|3981.04|218.96|0.00|0.00|0.00|0.00|0.00|0.00|4200.00|231|10|27290279682|
076|R|1606|2800.00|168.00|0.00|0.00|0.00|0.00|0.00|0.00|2968.00|231|10|27361171219|
076|R|1606|59052.49|3247.87|0.00|0.00|0.00|0.00|0.00|0.00|62300.36|231|10|27390019279|
076|R|1606|8583163.22|514989.78|0.00|0.00|0.00|0.00|0.00|0.00|9098153.00|231|10|27460293314|
076|R|1606|440662.27|26439.73|0.00|0.00|0.00|0.00|0.00|0.00|467102.00|231|10|27490371140|
076|R|1606|4146.96|228.08|0.00|0.00|0.00|0.00|0.00|0.00|4375.04|231|10|27530294100|
076|R|1606|54424.24|7347.24|0.00|0.00|0.00|0.00|0.00|0.00|61771.48|231|10|27610060189|
076|R|1606|3500.50|192.50|0.00|0.00|0.00|0.00|0.00|0.00|3693.00|231|10|27650269493|
076|R|1606|471985.10|28319.10|0.00|0.00|0.00|0.00|0.00|0.00|500304.20|231|10|27670990871|
076|R|1606|2853.81|171.23|0.00|0.00|0.00|0.00|0.00|0.00|3025.04|231|10|27690241729|&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jun 2017 14:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-row-delimiter-in-SAS/m-p/371309#M88698</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-28T14:05:58Z</dc:date>
    </item>
  </channel>
</rss>

