<?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 export missing value in txt file without space in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639543#M21684</link>
    <description>&lt;P&gt;Add DSD option on the FILE statement.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Apr 2020 18:28:57 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2020-04-13T18:28:57Z</dc:date>
    <item>
      <title>How to export missing value in txt file without space</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639541#M21683</link>
      <description>&lt;P&gt;HI All,&lt;/P&gt;&lt;P&gt;I have a dataset ,which I need to export in pipe delimited format with headers and footers.&lt;/P&gt;&lt;P&gt;Headers and footers are a string basically. My problem is when I'm using dsd option, I am getting my headers and footers wrapped in quotation and without dsd the datarows with null / missing values are getting exported with a space.&lt;/P&gt;&lt;P&gt;1. situation example:&lt;/P&gt;&lt;P&gt;"FT|Supplier_name|13042020|1.0|0|"&lt;/P&gt;&lt;P&gt;ID1|ID2|ID3|||ID6| and so on&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Situation example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FT|Supplier_name|13042020|1.0|0|&lt;/P&gt;&lt;P&gt;ID1|ID2|ID3| | |ID6| and so on..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
file report notitle delimiter='|';
length lbl $200;
lbl=cats('HD|Supplier_name|',put(today(),ddmmyyn8.),'|1.0|0|');
if _n_=1 then put lbl;
do until(eof);
set have end=eof;
put ID1-ID123;
end;
lbl=cats('FT|Suplier_name|',put(today(),ddmmyyn8.),'|',&amp;amp;obs.);
put lbl;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Apr 2020 18:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639541#M21683</guid>
      <dc:creator>Trishjais</dc:creator>
      <dc:date>2020-04-13T18:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to export missing value in txt file without space</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639543#M21684</link>
      <description>&lt;P&gt;Add DSD option on the FILE statement.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 18:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639543#M21684</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2020-04-13T18:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to export missing value in txt file without space</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639553#M21688</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for replying.&lt;/P&gt;&lt;P&gt;Actually I have tried with dsd option, see situation 1. Its&amp;nbsp; double quoting my header and footer string.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 19:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639553#M21688</guid>
      <dc:creator>Trishjais</dc:creator>
      <dc:date>2020-04-13T19:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to export missing value in txt file without space</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639567#M21691</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/242585"&gt;@Trishjais&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Thanks for replying.&lt;/P&gt;
&lt;P&gt;Actually I have tried with dsd option, see situation 1. Its&amp;nbsp; double quoting my header and footer string.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Write the header one value at a time. Don't try to write all of the headers as if they were one string.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 19:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639567#M21691</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-13T19:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to export missing value in txt file without space</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639572#M21692</link>
      <description>&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename report temp;
data have;
  input id1-id3;
cards;
1 2 3
4 5 6
;

data _null_;
  file report dsd dlm='|';
  length lbl $200;
  if  _n_=1 then do;
     do lbl='HD','Supplier_name',put(today(),ddmmyyn8.),'1.0','0';
         put lbl @;
     end;
     put;
  end;
  if eof then do;
    _n_=_n_-1;
    do lbl='FT','Supplier_name',put(today(),ddmmyyn8.);
       put lbl @;
     end;
     put _n_ ;
   end;
   set have end=eof;
   put ID1-ID3;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;PRE&gt;1335  data _null_;
1336    infile report;
1337    input;
1338    put _infile_;
1339  run;

NOTE: The infile REPORT is:

      Filename=...\#LN00056,
      RECFM=V,LRECL=32767,File Size (bytes)=76,
      Last Modified=13Apr2020:15:44:09,
      Create Time=13Apr2020:15:44:09

HD|Supplier_name|13042020|1.0|0
1|2|3
4|5|6
FT|Supplier_name|13042020|2
NOTE: 4 records were read from the infile REPORT.
      The minimum record length was 5.
      The maximum record length was 31.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds

&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Apr 2020 19:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639572#M21692</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-04-13T19:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to export missing value in txt file without space</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639577#M21693</link>
      <description>Thanks Tom, That worked like a charm. didn' t know that one header value a a time would do this.&lt;BR /&gt;Much appreciated.&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Apr 2020 20:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-export-missing-value-in-txt-file-without-space/m-p/639577#M21693</guid>
      <dc:creator>Trishjais</dc:creator>
      <dc:date>2020-04-13T20:25:57Z</dc:date>
    </item>
  </channel>
</rss>

