<?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: csv-File infile in other format in output file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914849#M360514</link>
    <description>&lt;P&gt;my file look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hoibai_0-1707310818323.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93330iF1BB61CD1227E5D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hoibai_0-1707310818323.png" alt="Hoibai_0-1707310818323.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Feb 2024 13:00:29 GMT</pubDate>
    <dc:creator>Hoibai</dc:creator>
    <dc:date>2024-02-07T13:00:29Z</dc:date>
    <item>
      <title>csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914844#M360510</link>
      <description>&lt;P&gt;&lt;SPAN&gt;how can I separate a csv infile with this format into a outfile in different columns. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Infile: AD:1/1234 AT:22/234567 .....; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Outfile with columns: &lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;AREA&lt;/TD&gt;&lt;TD&gt;NUMBER&lt;/TD&gt;&lt;TD&gt;VALUE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AD&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AT&lt;/TD&gt;&lt;TD&gt;22&lt;/TD&gt;&lt;TD&gt;234567&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;etc&lt;/TD&gt;&lt;TD&gt;etc&lt;/TD&gt;&lt;TD&gt;etc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;etc&lt;/TD&gt;&lt;TD&gt;etc&lt;/TD&gt;&lt;TD&gt;etc&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 12:24:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914844#M360510</guid>
      <dc:creator>Hoibai</dc:creator>
      <dc:date>2024-02-07T12:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914847#M360513</link>
      <description>&lt;P&gt;Like that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile CARDS4 DLM = ":/"; /* use multiple delimiters */
  input AREA $ 2. NUMBER VALUE;
cards4;
AD:1/1234 
AT:22/234567
;;;;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Feb 2024 12:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914847#M360513</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-07T12:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914849#M360514</link>
      <description>&lt;P&gt;my file look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hoibai_0-1707310818323.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93330iF1BB61CD1227E5D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hoibai_0-1707310818323.png" alt="Hoibai_0-1707310818323.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 13:00:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914849#M360514</guid>
      <dc:creator>Hoibai</dc:creator>
      <dc:date>2024-02-07T13:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914851#M360516</link>
      <description>&lt;P&gt;Paste it as text, I'm not going to retype it myself...&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 13:22:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914851#M360516</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-07T13:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914852#M360517</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/463573"&gt;@Hoibai&lt;/a&gt;&amp;nbsp;said:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my file look like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mkeintz_0-1707312826813.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93331i395785C2C7356FC0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mkeintz_0-1707312826813.png" alt="mkeintz_0-1707312826813.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please put your data in the form of a text block (use the&amp;nbsp; &lt;STRONG&gt;&amp;lt;/&amp;gt;&lt;/STRONG&gt; icon), instead of an image.&amp;nbsp; Most of us are not going to transcribe the image of characters you provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And given that the layout of the additional line of data you provided is different, show how it fits your AREA/NUMBER/VALUE data structure.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 13:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914852#M360517</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2024-02-07T13:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914853#M360518</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile CARDS4 DLM = ": /"; /* use multiple delimiters */
  input AREA :$2. NUMBER :best32. VALUE :commax32. @@; /* &amp;lt;- stay in the same line for more data */
  format VALUE best32.;
cards4;
AD:1/1234 AT:22/2345,67 XX:17/123,456
ZZ:1/1234 TT:22/2345,67 FU:17/123,456
;;;;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Feb 2024 13:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914853#M360518</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-07T13:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914858#M360520</link>
      <description>&lt;P&gt;the read file looks like this:&lt;/P&gt;&lt;P&gt;AD:1/1234,20 AT:2/23456,35 AU:3/34567,59 CA:4/56789,05 CH:5/54321,55;&lt;/P&gt;&lt;PRE class=""&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;the output file should be like this:&lt;/P&gt;&lt;P&gt;Columms:&lt;/P&gt;&lt;P&gt;Area&amp;nbsp; &amp;nbsp; number&amp;nbsp; &amp;nbsp; &amp;nbsp;value&lt;/P&gt;&lt;P&gt;AD&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1234,20&lt;/P&gt;&lt;P&gt;AT&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 23456,35&lt;/P&gt;&lt;P&gt;AU&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 34567,59&lt;/P&gt;&lt;P&gt;CA&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;56789,05&lt;/P&gt;&lt;P&gt;CH&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;54321,55&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 13:45:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914858#M360520</guid>
      <dc:creator>Hoibai</dc:creator>
      <dc:date>2024-02-07T13:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914861#M360522</link>
      <description>&lt;P&gt;Looks good, but you don't need the BEST32.&amp;nbsp; First of all using BEST as the name of an INFORMAT is just silly.&amp;nbsp; BEST is the name of a FORMAT.&amp;nbsp; It is used to find the "best" way to display a number in a limited number of characters.&amp;nbsp; The concept of a "BEST" way to convert a string into a number makes no sense.&amp;nbsp; There is only one way to store a number.&amp;nbsp; &amp;nbsp;If you use BEST as an informat SAS will just use the normal numeric informat anyway so why bother?&amp;nbsp; And I see no reason to attach the BEST32. format to the values in the example text.&amp;nbsp; Just let SAS use its default method to display the values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And there is no need to add a width to a numeric informat when using LIST mode (which is what the colon modifier is doing).&amp;nbsp; In LIST MODE the width on the informat is ignored, the whole next "word" in the line is read however long it is.&amp;nbsp; The width on the $ informat does something useful.&amp;nbsp; It gives the compiler the information it needs to GUESS that you wanted the variable AREA to be define as length $2 instead of the default of $8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  input AREA :$2. NUMBER VALUE :commax. @@; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Feb 2024 14:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914861#M360522</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-02-07T14:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914905#M360543</link>
      <description>&lt;P&gt;How do i can import this CSV File into sas? Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 18:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914905#M360543</guid>
      <dc:creator>Hoibai</dc:creator>
      <dc:date>2024-02-07T18:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914908#M360546</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/463573"&gt;@Hoibai&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How do i can import this CSV File into sas? Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's exactly what &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;'s code does. It reads the data into the dataset WANT in library WORK.&lt;/P&gt;
&lt;P&gt;To read from a file instead of inline, use the filename in the INFILE statement in place of CARDS, and omit the CARDS4 block.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 18:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914908#M360546</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-02-07T18:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914976#M360559</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/463573"&gt;@Hoibai&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How do i can import this CSV File into sas? Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;provided already the logic for this. If the first row contains header information then also use in the infile statement firstobs=2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want us to share tested code then the minimum you need to provide is representative sample data in usable form. Either posted via the "insert code" icon or as an attachment.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 22:29:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914976#M360559</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-02-07T22:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914979#M360561</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile '/home/reeza/myfile.csv' DLM = ": /" firstobs=2; /* use multiple delimiters */
*modify to specify the path to your CSV file and change firstobs to indicate the row that the observation is found;
  input AREA :$2. NUMBER :best32. VALUE :commax32. @@; /* &amp;lt;- stay in the same line for more data */
  format VALUE best32.;

;;;;
run;
proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/463573"&gt;@Hoibai&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How do i can import this CSV File into sas? Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 23:19:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/914979#M360561</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-02-07T23:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915006#M360574</link>
      <description>&lt;P&gt;I did that, but the file is empty???&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;infile '/data/products/Table/Q3_2023/checks_202307.csv'&lt;BR /&gt;DLM = ": /" firstobs=2; /* use multiple delimiters */&lt;BR /&gt;*modify to specify the path to your CSV file and change firstobs to indicate the row that the observation is found;&lt;BR /&gt;input AREA :$2. NUMBER :best32. VALUE :commax32. @@; /* &amp;lt;- stay in the same line for more data */&lt;BR /&gt;format VALUE best32.;&lt;/P&gt;&lt;P&gt;;;;;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=want;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Hoibai_0-1707370391157.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/93370iC80E655044D9D8CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Hoibai_0-1707370391157.png" alt="Hoibai_0-1707370391157.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 05:36:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915006#M360574</guid>
      <dc:creator>Hoibai</dc:creator>
      <dc:date>2024-02-08T05:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915008#M360575</link>
      <description>&lt;P&gt;sorry my mistake. It worked :-). Thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 05:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915008#M360575</guid>
      <dc:creator>Hoibai</dc:creator>
      <dc:date>2024-02-08T05:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915009#M360576</link>
      <description>&lt;P&gt;Assuming you did not get an ERROR that the file could not be found then it means that either the file is EMPTY or it has only ONE line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LOOK at the file and see what it actually has.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best way is to LOOK at it using a SAS data step, since your goal is to ultimately use SAS to read the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This step will print the first 3 lines of your file to the SAS log.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile '/data/products/Table/Q3_2023/checks_202307.csv' obs=3;
  input;
  list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How many lines did it find?&lt;/P&gt;
&lt;P&gt;How long were they?&lt;/P&gt;
&lt;P&gt;Did the output from the LIST statement include the two lines of hexcodes underneath any parts of the lines?&amp;nbsp; That will happen when SAS sees an unprintable character code.&amp;nbsp; Such as LF character ('0A'x) or CR character ('0D'x).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One common problem is that the file does NOT contain lines.&amp;nbsp; In which case your little program to look at the file will find only ONE line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is using fixed length records, or it is just a binary file, try using the RECFM=N on the INFILE statement.&amp;nbsp; But you will probably then need to remove the trailing&amp;nbsp;@@ from the INPUT statement to prevent an infinite loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another issue that sometimes comes up is that the file does have lines, but instead of the normal end of line character of LF (used by Unix) or CR and LF (used by Windows, aka DOS) the file is using just CR as the end of line character.&amp;nbsp; That is what the original MacOS from the 1980's used before they converted MacOS to be a flavor of Unix.&amp;nbsp; In that case add TERMSTR=CR to the INFILE statement instead.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 05:48:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915009#M360576</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-02-08T05:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915589#M360760</link>
      <description>&lt;P&gt;I have another question.&lt;/P&gt;&lt;P&gt;my input file looks like this:&lt;/P&gt;&lt;P&gt;AD:1/1234,20 AT:2/23456,35 AU:3/34567,59 CA:4/56789,05 CH:5/54321,55; DE:3/34567,59 ES:12/2341,25;&lt;/P&gt;&lt;P&gt;If there is a semicolon in the line, then the data up to the next semicolon should be output to another file. Is this visible when reading the CSV file?&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;AD:1/1234,20 AT:2/23456,35 AU:3/34567,59 CA:4/56789,05 CH:5/54321,55&lt;/P&gt;&lt;P&gt;Output want;&lt;/P&gt;&lt;P&gt;DE:3/34567,59 ES:12/2341,25&lt;/P&gt;&lt;P&gt;Output want_1&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 15:18:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915589#M360760</guid>
      <dc:creator>Hoibai</dc:creator>
      <dc:date>2024-02-12T15:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915603#M360767</link>
      <description>&lt;P&gt;Please learn how to use the Insert Code and Insert SAS Code pop-up windows.&lt;/P&gt;
&lt;P&gt;Is your data all on one line?&lt;/P&gt;
&lt;PRE&gt;AD:1/1234,20 AT:2/23456,35 AU:3/34567,59 CA:4/56789,05 CH:5/54321,55; DE:3/34567,59 ES:12/2341,25;&lt;/PRE&gt;
&lt;P&gt;Or on separate lines?&lt;/P&gt;
&lt;PRE&gt;AD:1/1234,20 AT:2/23456,35 AU:3/34567,59 CA:4/56789,05 CH:5/54321,55;
DE:3/34567,59 ES:12/2341,25;&lt;/PRE&gt;
&lt;P&gt;Could one "group" span multiple lines?&lt;/P&gt;
&lt;PRE&gt;AD:1/1234,20 AT:2/23456,35 AU:3/34567,59 
CA:4/56789,05 CH:5/54321,55;
DE:3/34567,59 ES:12/2341,25;&lt;/PRE&gt;
&lt;P&gt;How long is the longest line?&amp;nbsp; If you just read the whole file SAS will tell you. Here is a simple example:&lt;/P&gt;
&lt;PRE&gt;1    options parmcards=csv;
2    filename csv temp;
3    parmcards4;
7    ;;;;

8
9    data _null_;
10     infile csv ;
11     input;
12   run;

NOTE: The infile CSV is:
      Filename=C:\Users\ABERNA~1\AppData\Local\Temp\1\SAS Temporary Files\_TD23280_AMRAPY3WVP0VKU0_\#LN00009,
      RECFM=V,LRECL=32767,File Size (bytes)=102,
      Last Modified=12Feb2024:10:39:49,
      Create Time=12Feb2024:10:39:49

NOTE: 3 records were read from the infile CSV.
      The minimum record length was 28.
      The maximum record length was 40.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;As you can see there where 3 lines of data and the longest line was 40 bytes and the shortest was 28 bytes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the lines are short (less then 32k bytes per line) then you can check for the semicolon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your files appears to consist of space delimited values that each consist of three internal values.&amp;nbsp; Let's call these a TRIPLET.&amp;nbsp; So here is a program to create the data with an additional GROUP variable that counts how man semicolon group separators have been seen.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  infile csv dlm=' ' ;
  retain group 1;
  length triplet $40 area $2 number value 8;
  input triplet @@;
  area = scan(triplet,1,':');
  number = input(scan(triplet,2,':/'),commax32.);
  value = input(scan(triplet,3,':/;'),commax32.);
  output;
  if indexc(triplet,';') then group+1;
  drop triplet;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;PRE&gt;Obs    group    area    number      value

 1       1       AD        1       1234.20
 2       1       AT        2      23456.35
 3       1       AU        3      34567.59
 4       1       CA        4      56789.05
 5       1       CH        5      54321.55
 6       2       DE        3      34567.59
 7       2       ES       12       2341.25
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 15:55:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915603#M360767</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-02-12T15:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915605#M360768</link>
      <description>&lt;P&gt;&lt;SPAN&gt;yes, my data is all on one line.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 16:01:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915605#M360768</guid>
      <dc:creator>Hoibai</dc:creator>
      <dc:date>2024-02-12T16:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915614#M360770</link>
      <description>&lt;P&gt;my data line is&amp;nbsp;linesize=32767 bytes long. Your Codes skip&amp;nbsp;&amp;nbsp;a few semicolons.&lt;/P&gt;&lt;P&gt;AD:1/1234,20 AT:2/23456,35 AU:3/34567,59 CA:4/56789,05 CH:5/54321,55;DE:3/34567,59 ES:12/2341,25;AD:1/205,92;DE:25/2039,05;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 16:34:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915614#M360770</guid>
      <dc:creator>Hoibai</dc:creator>
      <dc:date>2024-02-12T16:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: csv-File infile in other format in output file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915617#M360772</link>
      <description>&lt;P&gt;32,767 is the default LRECL.&amp;nbsp; So your actual file might have lines longer than that.&amp;nbsp; You can use LRECL= values up to 10 million or so depending on your machine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if the file is not intended to have lines then just use RECFM=N option on the INFILE statement and SAS will not try to look for lines.&amp;nbsp; Instead it will treat the file as one long stream.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So these lines are different than your previous examples.&amp;nbsp; The spaces between TRIPLETS is missing sometimes.&amp;nbsp; If the issue is that you either have a space or a semicolon between the triplets and not both then something like this should work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  infile csv dlm=':/ ;' recfm=n;
  retain group 1;
  input area :$2. number value :commax. +(-1) sep $1. ;
  output;
  if sep=';' then group+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For your new example file&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options parmcards=csv;
filename csv temp;
parmcards4;
AD:1/1234,20 AT:2/23456,35 AU:3/34567,59 CA:4/56789,05 CH:5/54321,55;DE:3/34567,59 ES:12/2341,25;AD:1/205,92;DE:25/2039,05;
;;;;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is the results&lt;/P&gt;
&lt;PRE&gt;Obs    group    area    number      value     sep

 1       1       AD        1       1234.20
 2       1       AT        2      23456.35
 3       1       AU        3      34567.59
 4       1       CA        4      56789.05
 5       1       CH        5      54321.55     ;
 6       2       DE        3      34567.59
 7       2       ES       12       2341.25     ;
 8       3       AD        1        205.92     ;
 9       4       DE       25       2039.05     ;

&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Feb 2024 16:46:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/csv-File-infile-in-other-format-in-output-file/m-p/915617#M360772</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-02-12T16:46:04Z</dc:date>
    </item>
  </channel>
</rss>

