<?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: I need to export data from SAS to .DAT file with only 1 line. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843625#M333521</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/436973"&gt;@Kelkro&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried with the following code and it works perfectly well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It shows one line with a length of 27.894 when&amp;nbsp;the file is viewed in Notepad++, but my Notepad also breaks the file in lines, only&amp;nbsp; it breaks the file in 1139 bytes lines instead of 1025 bytes, but the problem is the certainly the editor, not your excellent code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  do i = 1 to 1000;
    Id = put(i,z8.);
    Name = 'VariableValue';
    Ltype = put(mod(i,3),2.);
    output;
  end;
run;

data _null_;
  file "c:\temp\test.dat" recfm=N dsd dlm='Ñ' lrecl=500000;
  set have end=eof;
  put (_all_)(:) +(-1) @;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 10 Nov 2022 16:35:08 GMT</pubDate>
    <dc:creator>ErikLund_Jensen</dc:creator>
    <dc:date>2022-11-10T16:35:08Z</dc:date>
    <item>
      <title>I need to export data from SAS to .DAT file with only 1 line.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843618#M333517</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have never posted in this community before but I feel like I have tried everything.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been working on a request to get an export from SAS dataset to a .DAT file but it must be 1 line for the automation job to pick it up.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I export it seems like the line in the .DAT file (opens in NOTEPAD) will break to a new line at the 1025 column size.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone have any ideas on how to expand this column size??&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my current code:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;data _null_;
file "test.dat" recfm=N dsd dlm='Ñ' lrecl=500000;
set have end=eof;
put (_all_)(:) +(-1) @;
run;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what i see in the .DAT file export- It will break at the 1025 column .. no spaces there or anything to throw it off as that number continues onto the second line...&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kelkro_1-1668096546710.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77168i2936BA1123336ED0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kelkro_1-1668096546710.png" alt="Kelkro_1-1668096546710.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kelkro_2-1668096563520.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77169i00A4E98EE27EE9A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kelkro_2-1668096563520.png" alt="Kelkro_2-1668096563520.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 18:18:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843618#M333517</guid>
      <dc:creator>Kelkro</dc:creator>
      <dc:date>2022-11-10T18:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: I need to export data from SAS to .DAT file with only 1 line.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843624#M333520</link>
      <description>Notepad has a 1024 line limit. &lt;BR /&gt;View the file with a different editor (Notepad++), check it by reading it back in via SAS or looking for an EOL character.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://superuser.com/questions/431352/how-to-view-text-files-with-line-length-more-than-1024" target="_blank"&gt;https://superuser.com/questions/431352/how-to-view-text-files-with-line-length-more-than-1024&lt;/A&gt;</description>
      <pubDate>Thu, 10 Nov 2022 16:31:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843624#M333520</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-11-10T16:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: I need to export data from SAS to .DAT file with only 1 line.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843625#M333521</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/436973"&gt;@Kelkro&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried with the following code and it works perfectly well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It shows one line with a length of 27.894 when&amp;nbsp;the file is viewed in Notepad++, but my Notepad also breaks the file in lines, only&amp;nbsp; it breaks the file in 1139 bytes lines instead of 1025 bytes, but the problem is the certainly the editor, not your excellent code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  do i = 1 to 1000;
    Id = put(i,z8.);
    Name = 'VariableValue';
    Ltype = put(mod(i,3),2.);
    output;
  end;
run;

data _null_;
  file "c:\temp\test.dat" recfm=N dsd dlm='Ñ' lrecl=500000;
  set have end=eof;
  put (_all_)(:) +(-1) @;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Nov 2022 16:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843625#M333521</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2022-11-10T16:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: I need to export data from SAS to .DAT file with only 1 line.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843648#M333525</link>
      <description>&lt;P&gt;You are just using the wrong tool to LOOK at the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why not just look at it with SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;5    data _null_;
6      file 'c:\downloads\test.dat' recfm=n ;
7      put 200*'----+----0' ;
8    run;

NOTE: UNBUFFERED is the default with RECFM=N.
NOTE: The file 'c:\downloads\test.dat' is:
      Filename=c:\downloads\test.dat,
      RECFM=N,LRECL=256,File Size (bytes)=0,
      Last Modified=10Nov2022:12:54:42,
      Create Time=10Nov2022:12:53:14

NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


9
10   data _null_;
11     infile 'c:\downloads\test.dat';
12     input;
13     list;
14   run;

NOTE: The infile 'c:\downloads\test.dat' is:
      Filename=c:\downloads\test.dat,
      RECFM=V,LRECL=32767,File Size (bytes)=2000,
      Last Modified=10Nov2022:12:54:42,
      Create Time=10Nov2022:12:53:14

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1         ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
     101  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
     201  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
     301  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
     401  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
     501  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
     601  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
     701  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
     801  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
     901  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
    1001  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
    1101  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
    1201  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
    1301  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
    1401  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
    1501  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
    1601  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
    1701  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
    1801  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
    1901  ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0 2000
NOTE: 1 record was read from the infile 'c:\downloads\test.dat'.
      The minimum record length was 2000.
      The maximum record length was 2000.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


&lt;/PRE&gt;
&lt;P&gt;If you want to extra sure the file does not have any end of line characters in it then read it back as fixed length records instead.&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;50   data _null_;
51     infile 'c:\downloads\test.dat' recfm=f lrecl=100 ;
52     input;
53     list;
54   run;

NOTE: The infile 'c:\downloads\test.dat' is:
      Filename=c:\downloads\test.dat,
      RECFM=F,LRECL=100,File Size (bytes)=2000,
      Last Modified=10Nov2022:12:58:30,
      Create Time=10Nov2022:12:53:14

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1         ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
2         ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
3         ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
4         ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
5         ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
6         ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
7         ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
8         ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
9         ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
10        ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
11        ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
12        ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
13        ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
14        ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
15        ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
16        ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
17        ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
18        ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
19        ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
20        ----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0----+----0
NOTE: 20 records were read from the infile 'c:\downloads\test.dat'.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Nov 2022 18:00:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843648#M333525</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-10T18:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: I need to export data from SAS to .DAT file with only 1 line.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843652#M333528</link>
      <description>&lt;P&gt;Thanks! I did check with notepad++ and it does seem to be one one line. Hoping the job can pick it up that way.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 18:06:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843652#M333528</guid>
      <dc:creator>Kelkro</dc:creator>
      <dc:date>2022-11-10T18:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: I need to export data from SAS to .DAT file with only 1 line.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843654#M333529</link>
      <description>&lt;P&gt;Thank you for your help! I really appreciate it!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 18:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-export-data-from-SAS-to-DAT-file-with-only-1-line/m-p/843654#M333529</guid>
      <dc:creator>Kelkro</dc:creator>
      <dc:date>2022-11-10T18:07:46Z</dc:date>
    </item>
  </channel>
</rss>

