<?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: export data to txt in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735348#M229083</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much for your suggestions!&lt;/P&gt;
&lt;P&gt;I very much appreciate your help!&lt;/P&gt;</description>
    <pubDate>Mon, 19 Apr 2021 19:58:53 GMT</pubDate>
    <dc:creator>superbug</dc:creator>
    <dc:date>2021-04-19T19:58:53Z</dc:date>
    <item>
      <title>export data to txt</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735262#M229048</link>
      <description>&lt;P&gt;I want to export the resulted data to be txt, as picture below each variable takes 2 columns, but I want each variable takes 1 column. How should I modify my code?&amp;nbsp; Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc export data=try outfile='....\data for simultaneous calibration.txt' &lt;BR /&gt;dbms=dlm replace; delimiter=' '; putnames=NO;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="superbug_0-1618842686930.png" style="width: 887px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58314i6C244E316118E2FE/image-dimensions/887x56?v=v2" width="887" height="56" role="button" title="superbug_0-1618842686930.png" alt="superbug_0-1618842686930.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>Mon, 19 Apr 2021 14:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735262#M229048</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-19T14:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: export data to txt</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735265#M229051</link>
      <description>&lt;P&gt;There is no need to use "export" to create a text file. Just write the file directly.&amp;nbsp; Then you can have full control over how the values are written.&lt;/P&gt;
&lt;P&gt;So if your data has two identifiers and then a series of fifty one digit numbers your data step might look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set try ;
  file '....\data for simultaneous calibration.txt' ;
  put id1 id2 (var1-var50) (1.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Apr 2021 14:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735265#M229051</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-19T14:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: export data to txt</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735285#M229053</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much for your response!&lt;/P&gt;
&lt;P&gt;Part of my data looks like following before being exported to .txt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="superbug_0-1618844165557.png" style="width: 590px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58324i8DDE06A6C1BECF89/image-dimensions/590x62?v=v2" width="590" height="62" role="button" title="superbug_0-1618844165557.png" alt="superbug_0-1618844165557.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;as you suggested, I used the following code (a little change of var names as in bold)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;set try ;&lt;BR /&gt;file '...\data for simultaneous calibration_new.txt' ;&lt;BR /&gt;put id1 id2 &lt;STRONG&gt;(JAL000001-JAL000177)&lt;/STRONG&gt; (1.);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the .txt file I got is like the following, which is not desired format,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="superbug_1-1618844431524.png" style="width: 646px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58325i63B9D32937B8759B/image-dimensions/646x42?v=v2" width="646" height="42" role="button" title="superbug_1-1618844431524.png" alt="superbug_1-1618844431524.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the highlighted part in the picture above should stay together like following&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="superbug_2-1618844544004.png" style="width: 636px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58326iE814372CE5E60B07/image-dimensions/636x62?v=v2" width="636" height="62" role="button" title="superbug_2-1618844544004.png" alt="superbug_2-1618844544004.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any other suggestion, please.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 15:04:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735285#M229053</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-19T15:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: export data to txt</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735293#M229058</link>
      <description>&lt;P&gt;We cannot code to photographs.&amp;nbsp; At a minmum provide TEXT of the desired record.&amp;nbsp; But in reality provide the detail specification of which variables should appear in which column of the output line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just learn &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0jks6tlw4a1v1n1ssob6gtpxfth.htm" target="_self"&gt;how to use formats with PUT statement&lt;/A&gt;.&amp;nbsp; Or even&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n1oxxpqzi1du60n1n6b5g3koapga.htm" target="_self"&gt; column mode output with PUT statement&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 15:29:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735293#M229058</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-19T15:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: export data to txt</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735295#M229060</link>
      <description>&lt;P&gt;Unfortunately PICTURES do not show "columns" worth beans.&lt;/P&gt;
&lt;P&gt;Since you have a blank as a delimiter there is a space between values. If you do not want a space between each value then you are not creating delimited data and as such you don't provide delimiters or use DBMS=dlm.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 15:43:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735295#M229060</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-19T15:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: export data to txt</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735348#M229083</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much for your suggestions!&lt;/P&gt;
&lt;P&gt;I very much appreciate your help!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 19:58:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-data-to-txt/m-p/735348#M229083</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-19T19:58:53Z</dc:date>
    </item>
  </channel>
</rss>

