<?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: Preserving blank format when exporting to TXT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/oWo/m-p/597418#M172138</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282450"&gt;@bonedog&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hey!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data set in SAS that I have so that a period (.) fills all blank spaces. However, when I export my file as a .txt it randomly removes some of the periods and converts them back to blanks. How can I correct this so all the periods remain? I need the periods so another program will read my set in correctly. My code is below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC EXPORT data = finalpheno
	outfile = 'X:\FlyFiles\pheno.txt' replace;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't understand what you have.&amp;nbsp; You have set your character variables in your SAS dataset to have periods replacing all of the spaces?&amp;nbsp; So a value like 'John Smith' in a 12 character variable will have 'John.Smith..' instead?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you want to write a text file why are you using PROC EXPORT instead of just using a data step with a FILE statement and PUT statement?&amp;nbsp; &amp;nbsp;Your code will generate a tab delimited file.&amp;nbsp; &lt;STRONG&gt;Is that what you want?&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data=sashelp.class(obs=3) outfile='c:\downloads\class.txt' replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;114   data _null_;
115    infile 'c:\downloads\class.txt';
116    input;
117    list;
118   run;

NOTE: The infile 'c:\downloads\class.txt' is:
      Filename=c:\downloads\class.txt,
      RECFM=V,LRECL=32767,File Size (bytes)=92,
      Last Modified=17Oct2019:12:21:52,
      Create Time=17Oct2019:12:21:09

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0

1   CHAR  Name.Sex.Age.Height.Weight 26
    ZONE  46660567046604666670566667
    NUMR  E1D59358917598597849759784

2   CHAR  Alfred.M.14.69.112.5 20
    ZONE  46676604033033033323
    NUMR  1C62549D9149699112E5

3   CHAR  Alice.F.13.56.5.84 18
    ZONE  466660403303323033
    NUMR  1C93596913956E5984

4   CHAR  Barbara.F.13.65.3.98 20
    ZONE  46766760403303323033
    NUMR  212212196913965E3998
NOTE: 4 records were read from the infile 'c:\downloads\class.txt'.
      The minimum record length was 18.
      The maximum record length was 26.
&lt;/PRE&gt;
&lt;P&gt;If you write you own program to generate the file you can generate it in almost any format you can imagine (and describe).&lt;/P&gt;
&lt;P&gt;So please describe exactly, with examples, what format you have (your SAS datset) and what format you want to create (your text file).&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2019 16:24:04 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-10-17T16:24:04Z</dc:date>
    <item>
      <title>oWo</title>
      <link>https://communities.sas.com/t5/SAS-Programming/oWo/m-p/597411#M172134</link>
      <description />
      <pubDate>Thu, 17 Oct 2019 19:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/oWo/m-p/597411#M172134</guid>
      <dc:creator>bonedog</dc:creator>
      <dc:date>2019-10-17T19:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving blank format when exporting to TXT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/oWo/m-p/597414#M172135</link>
      <description>See answer from &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; in this thread: &lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Keep-blanks-when-exporting-to-txt/td-p/336230" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Keep-blanks-when-exporting-to-txt/td-p/336230&lt;/A&gt;</description>
      <pubDate>Thu, 17 Oct 2019 16:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/oWo/m-p/597414#M172135</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2019-10-17T16:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Preserving blank format when exporting to TXT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/oWo/m-p/597418#M172138</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/282450"&gt;@bonedog&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hey!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a data set in SAS that I have so that a period (.) fills all blank spaces. However, when I export my file as a .txt it randomly removes some of the periods and converts them back to blanks. How can I correct this so all the periods remain? I need the periods so another program will read my set in correctly. My code is below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC EXPORT data = finalpheno
	outfile = 'X:\FlyFiles\pheno.txt' replace;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't understand what you have.&amp;nbsp; You have set your character variables in your SAS dataset to have periods replacing all of the spaces?&amp;nbsp; So a value like 'John Smith' in a 12 character variable will have 'John.Smith..' instead?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you want to write a text file why are you using PROC EXPORT instead of just using a data step with a FILE statement and PUT statement?&amp;nbsp; &amp;nbsp;Your code will generate a tab delimited file.&amp;nbsp; &lt;STRONG&gt;Is that what you want?&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data=sashelp.class(obs=3) outfile='c:\downloads\class.txt' replace;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;114   data _null_;
115    infile 'c:\downloads\class.txt';
116    input;
117    list;
118   run;

NOTE: The infile 'c:\downloads\class.txt' is:
      Filename=c:\downloads\class.txt,
      RECFM=V,LRECL=32767,File Size (bytes)=92,
      Last Modified=17Oct2019:12:21:52,
      Create Time=17Oct2019:12:21:09

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0

1   CHAR  Name.Sex.Age.Height.Weight 26
    ZONE  46660567046604666670566667
    NUMR  E1D59358917598597849759784

2   CHAR  Alfred.M.14.69.112.5 20
    ZONE  46676604033033033323
    NUMR  1C62549D9149699112E5

3   CHAR  Alice.F.13.56.5.84 18
    ZONE  466660403303323033
    NUMR  1C93596913956E5984

4   CHAR  Barbara.F.13.65.3.98 20
    ZONE  46766760403303323033
    NUMR  212212196913965E3998
NOTE: 4 records were read from the infile 'c:\downloads\class.txt'.
      The minimum record length was 18.
      The maximum record length was 26.
&lt;/PRE&gt;
&lt;P&gt;If you write you own program to generate the file you can generate it in almost any format you can imagine (and describe).&lt;/P&gt;
&lt;P&gt;So please describe exactly, with examples, what format you have (your SAS datset) and what format you want to create (your text file).&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 16:24:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/oWo/m-p/597418#M172138</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-17T16:24:04Z</dc:date>
    </item>
  </channel>
</rss>

