<?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 can we write text to an external text file and on output window while using data _null_ in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271783#M54070</link>
    <description>&lt;P&gt;Show the code that you ran that failed to create a text file with one observation per record and the log.&lt;/P&gt;
&lt;P&gt;The approach that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32"&gt;@BrunoMueller&lt;/a&gt; suggests has worked on windows machines since SAS version 6 and Windows 95.&lt;/P&gt;</description>
    <pubDate>Thu, 19 May 2016 17:18:27 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-05-19T17:18:27Z</dc:date>
    <item>
      <title>How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271452#M53999</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can we write text to an external text file and on output window while using data _null_. Please explain with example.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 16:21:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271452#M53999</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-05-18T16:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271471#M54004</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To write to a file you need the FILE and PUT statement. They are used always as a pair. Find below an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more details please have a look at &lt;A href="http://support.sas.com/documentation/cdl/en/lrcon/68089/HTML/default/viewer.htm#p1topuaeb1ikf0n11f6ibw5ftral.htm" target="_blank"&gt;DATA Step Processing&lt;/A&gt; and the doc for the FILE and PUT statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set sashelp.class;
  file "c:\temp\someFile.txt";
  put name age sex;
  file print;
  put name age sex;&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 16:54:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271471#M54004</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-05-18T16:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271608#M54033</link>
      <description>&lt;P&gt;Thanks Bruno,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you tell me to how to get output &lt;STRONG&gt;in external file&lt;/STRONG&gt; in format like this (instead of getting all values in single line):&lt;/P&gt;&lt;PRE class="batch"&gt;Alfred 14 M                                                                                                                         
Alice 13 F                                                                                                                          
Barbara 13 F                                                                                                                        
Carol 14 F                                                                                                                          
Henry 14 M                                                                                                                          
James 12 M                                                                                                                          
Jane 12 F                                                                                                                           
Janet 15 F                                                                                                                          
Jeffrey 13 M                                                                                                                        
John 12 M                                                                                                                           
Joyce 11 F                                                                                                                          
Judy 14 F                                                                                                                           
Louise 12 F                                                                                                                         
Mary 15 F                                                                                                                           
Philip 16 M                                                                                                                         
Robert 12 M                                                                                                                         
Ronald 15 M                                                                                                                         
Thomas 11 M                                                                                                                         
William 15 M   &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 05:48:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271608#M54033</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-05-19T05:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271615#M54034</link>
      <description>&lt;P&gt;The sample code creates the file exactly as you need it, see screenshot below. Maybe you have created the file on a Unix/Linux and the editor you use to view the file can not display the data correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3226iAED660DF4E0BAA80/image-size/original?v=v2&amp;amp;px=-1" alt="Capture.PNG" title="Capture.PNG" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The same code create this file on Linux&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3227i4607C7855D9FD551/image-size/original?v=v2&amp;amp;px=-1" alt="Capture.PNG" title="Capture.PNG" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 06:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271615#M54034</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-05-19T06:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271673#M54045</link>
      <description>&lt;P&gt;So Can't I do anything to get output in required format i.e. every new observation on new line. &amp;nbsp;My OS is Windows 10.&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 10:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271673#M54045</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-05-19T10:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271783#M54070</link>
      <description>&lt;P&gt;Show the code that you ran that failed to create a text file with one observation per record and the log.&lt;/P&gt;
&lt;P&gt;The approach that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32"&gt;@BrunoMueller&lt;/a&gt; suggests has worked on windows machines since SAS version 6 and Windows 95.&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2016 17:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/271783#M54070</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-19T17:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/272231#M54158</link>
      <description>&lt;P&gt;Hi Ballardw,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are the codes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;set sashelp.class;&lt;BR /&gt;file "/folders/myfolders/someFile.txt";&lt;BR /&gt;put name age sex;&lt;BR /&gt;file print;&lt;BR /&gt;put name age sex;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the LOG:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;55&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;56 data _null_;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;57 set sashelp.class;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;58 file "/folders/myfolders/someFile.txt";&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;59 put name age sex;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;60 file print;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;61 put name age sex;run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The file "/folders/myfolders/someFile.txt" is:&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Filename=/folders/myfolders/someFile.txt,&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Owner Name=root,Group Name=vboxsf,&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Access Permission=-rwxrwx---,&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Last Modified=21May2016:12:23:17&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: 19 lines were written to file PRINT.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: 19 records were written to the file "/folders/myfolders/someFile.txt".&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;The minimum record length was 9.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;The maximum record length was 12.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 19 observations read from the data set SASHELP.CLASS.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.17 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.04 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;62&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;63 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;75&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;****************************************;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;However, I am only able to add spaces/tabs by using the following codes:&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;data _null_;&lt;BR /&gt;set sashelp.class;&lt;BR /&gt;file "/folders/myfolders/someFile1.txt";&lt;BR /&gt;put name age sex " "; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *&amp;lt;--- Tab is added;&lt;BR /&gt;file print;&lt;BR /&gt;put name age sex;&lt;BR /&gt;run;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Notes:&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Both times by using file print I am getteing result in required format i.e.&amp;nbsp;&lt;SPAN&gt;one observation per record/line.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;Below are the files generated by these two codes for your reference.. Thanks.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 21 May 2016 07:16:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/272231#M54158</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-05-21T07:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/272245#M54161</link>
      <description>&lt;P&gt;What do you mean by the words "&lt;SPAN&gt;add spaces/tabs"?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you want to write a special character like a tab you can use a hexadecimal literl. &amp;nbsp;'09'X would be a tab.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;put age '09'x name;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you want to write a structured file that uses a special delimiter between fields, like a CSV file, then use the DSD and DLM options on the FILE statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;file&amp;nbsp;"/folders/myfolders/someFile.txt" dsd ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;put name sex ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;would write&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Alfred,M&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;file&amp;nbsp;"/folders/myfolders/someFile.txt" dsd dlm='09'x;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;put name sex ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;would write&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Alfred&amp;lt;tab&amp;gt;M&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2016 15:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/272245#M54161</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-05-21T15:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/272312#M54165</link>
      <description>&lt;P&gt;I meant that only I am able to add tabs ( '07'x etc.) or spaces (" &amp;nbsp; &amp;nbsp; ") between two observations but I am not able to get each new observation in new line.&lt;/P&gt;&lt;P&gt;1. Is there any way to get new observation in new line while writing a text file (using file and put statements)? &amp;nbsp;or can we use new line character line '\n' in C Programs?&lt;/P&gt;&lt;P&gt;2. Besides this can we print variable names as well?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;: However, for csv files I am able to get one observation per line by using:&amp;nbsp;&lt;/P&gt;&lt;P&gt;file "/folders/myfolders/someFile2.csv" dsd;&lt;/P&gt;</description>
      <pubDate>Sun, 22 May 2016 06:37:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/272312#M54165</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-05-22T06:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/272317#M54167</link>
      <description>&lt;P&gt;What makes you think that you files are all one line? &amp;nbsp;The files you posted all have multiple lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Windows and Unix use different standards for how to mark the end of line in a text file. &amp;nbsp;So if you write your files on a Unix machine the end of lines will be marked by single linefeed characters ('0A'x). &amp;nbsp;If you then try to read that file using the Windows program NOTEPAD it will not recognise the single linefeeds as starting new lines since it is expecting to see the two character sequence of carriage return plus a linefeed ('0D0A'x). &amp;nbsp;You can open the file using WORDPAD instead of NOTEPAD at it will look correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add the TERMSTR=CRLF option to your FILE statement and SAS will terminate each line with '0D0A'x, even when running on Unix.&lt;/P&gt;</description>
      <pubDate>Sun, 22 May 2016 14:32:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/272317#M54167</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-05-22T14:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/272318#M54168</link>
      <description>&lt;P&gt;Each PUT statement writes a new line, unless you add a trailing&amp;nbsp;@ sign.&lt;/P&gt;
&lt;P&gt;You use a slash in the PUT statement to begin a new line in a single put statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;put name&amp;nbsp;@ ; put age ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is the same as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;put name age ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;put name ; put age ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is the same as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;put name / age ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 May 2016 14:36:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/272318#M54168</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-05-22T14:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/273806#M54568</link>
      <description>&lt;P&gt;Sorry for late reply from my side, but can you reply to second question / point of my last message viz.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Besides this can we print variable names as well? (while we are printing files (text or csv) by using data _null_)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 May 2016 14:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/273806#M54568</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-05-29T14:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/273807#M54569</link>
      <description>&lt;P&gt;Not sure I understand. Can you explain what you want? Perhaps with example output.&lt;/P&gt;</description>
      <pubDate>Sun, 29 May 2016 15:03:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/273807#M54569</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-05-29T15:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/273810#M54571</link>
      <description>&lt;P&gt;I mean can I get output like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name &amp;nbsp;Gender Age Weight &amp;nbsp; *&amp;lt;----- Can I get variable name as well (in output file);&lt;/P&gt;&lt;P&gt;abc &amp;nbsp; &amp;nbsp; &amp;nbsp; M &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 68 &amp;nbsp; &amp;nbsp;72&lt;/P&gt;&lt;P&gt;xyz &amp;nbsp; &amp;nbsp; &amp;nbsp; F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 62 &amp;nbsp; &amp;nbsp;68&lt;/P&gt;</description>
      <pubDate>Sun, 29 May 2016 16:09:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/273810#M54571</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-05-29T16:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/273811#M54572</link>
      <description>&lt;P&gt;The easiest way is to just use PROC EXPORT to write the file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to do it with data step then you need to add extra code to get the variable names. One way is to do it in an extra step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=sashelp.class(obs=0) ;
  var _all_;
run;
data _null_;
  set &amp;amp;syslast end=eof;
  file 'myfile.txt' ;
  put _name_ @;
  if eof then put ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can add another step to write the data, just remember to use the MOD option on the FILE statement so that it appends instead of creating a new file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set sashelp.class ;
  file 'myfile.txt' mod ;
  put (_all_) (+0) ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 May 2016 16:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/273811#M54572</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-05-29T16:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can we write text to an external text file and on output window while using data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/274302#M54712</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;SPAN&gt;your codes are working well &amp;amp; meet my purpose.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 07:34:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-we-write-text-to-an-external-text-file-and-on-output/m-p/274302#M54712</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-06-01T07:34:27Z</dc:date>
    </item>
  </channel>
</rss>

