<?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: Convert Program to TXT file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455131#M284260</link>
    <description>&lt;P&gt;Command line:&lt;/P&gt;
&lt;P&gt;copy &amp;lt;path&amp;gt;/*.sas &amp;lt;path&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I mean SAS program files are just plain text programs.&amp;nbsp; I don't see how this can take "hours of work"?&lt;/P&gt;</description>
    <pubDate>Wed, 18 Apr 2018 12:48:26 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-04-18T12:48:26Z</dc:date>
    <item>
      <title>Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455128#M284259</link>
      <description>&lt;P&gt;Does anyone have code that can pull in a bunch of SAS programs from location A and output them as .txt files in location B? Would save hours of work. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 12:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455128#M284259</guid>
      <dc:creator>darb</dc:creator>
      <dc:date>2018-04-18T12:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455131#M284260</link>
      <description>&lt;P&gt;Command line:&lt;/P&gt;
&lt;P&gt;copy &amp;lt;path&amp;gt;/*.sas &amp;lt;path&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I mean SAS program files are just plain text programs.&amp;nbsp; I don't see how this can take "hours of work"?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 12:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455131#M284260</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-18T12:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455138#M284261</link>
      <description>&lt;P&gt;I have hundreds of programs - and the only way I knew how to do it was to open each one and do SAVE AS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not really following the code you provided - if you could provide example paths that'd be helpful...thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455138#M284261</guid>
      <dc:creator>darb</dc:creator>
      <dc:date>2018-04-18T13:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455140#M284262</link>
      <description>&lt;P&gt;It's just the basic copy command of Windows. Use the commandline for it.&lt;/P&gt;
&lt;P&gt;If your programs are stored on a non-Windows server, and you want to move/copy them there, you need to tell us more about your setup.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why do you want to change the extension to .txt?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:04:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455140#M284262</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-18T13:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455141#M284263</link>
      <description>&lt;P&gt;SAS program files are text files.&lt;/P&gt;
&lt;P&gt;Are you asking how to copy files?&lt;/P&gt;
&lt;P&gt;In Windows the command is COPY and in Unix it is cp.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455141#M284263</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-04-18T13:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455143#M284264</link>
      <description>&lt;P&gt;It's required by the FDA&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455143#M284264</guid>
      <dc:creator>darb</dc:creator>
      <dc:date>2018-04-18T13:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455144#M284265</link>
      <description>&lt;P&gt;I am trying to do something like this - but the below code won't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname rna "C:\data";&lt;/P&gt;&lt;P&gt;%macro export_data (file=);&lt;/P&gt;&lt;P&gt;proc export data=rna.&amp;amp;file.&lt;/P&gt;&lt;P&gt;outfile="C:\data.&amp;amp;file..txt"&lt;/P&gt;&lt;P&gt;dbms= tab replace;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend export_data;&lt;/P&gt;&lt;P&gt;%export_data (file= t-14-1-1a-ds);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:10:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455144#M284265</guid>
      <dc:creator>darb</dc:creator>
      <dc:date>2018-04-18T13:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455145#M284266</link>
      <description>&lt;P&gt;So you are not converting &lt;STRONG&gt;&lt;EM&gt;programs&lt;/EM&gt;&lt;/STRONG&gt;, but &lt;EM&gt;&lt;STRONG&gt;datasets&lt;/STRONG&gt;&lt;/EM&gt;!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code won't work because t-14-1-1a-ds is not a valid SAS dataset name. SAS names can only contain letters (of the 26 character alphabet), digits and underlines, and must not start with a digit.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455145#M284266</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-18T13:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455148#M284267</link>
      <description>Oh crap - I thought what I was looking at was someone trying to do the same. I now realize they were converting datasets. Womp. Ok thank you. So I should use command to copy from .sas to .txt?</description>
      <pubDate>Wed, 18 Apr 2018 13:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455148#M284267</guid>
      <dc:creator>darb</dc:creator>
      <dc:date>2018-04-18T13:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455150#M284268</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151031"&gt;@darb&lt;/a&gt; wrote:&lt;BR /&gt;Oh crap - I thought what I was looking at was someone trying to do the same. I now realize they were converting datasets. Womp. Ok thank you. So I should use command to copy from .sas to .txt?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Let's get back to square one and make some things clear:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;programs or datasets?&lt;/LI&gt;
&lt;LI&gt;from where to where?&lt;/LI&gt;
&lt;LI&gt;and why change the extension to .txt, if it's not data but program code?&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455150#M284268</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-18T13:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455154#M284269</link>
      <description>Ok. I have several hundred SAS programs with .SAS extensions. The FDA requires for submissions that SAS program files be submitted with .TXT extensions. So I am looking for a more efficient way to convert all of the .SAS programs in Folder A to .TXT programs in Folder B.</description>
      <pubDate>Wed, 18 Apr 2018 13:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455154#M284269</guid>
      <dc:creator>darb</dc:creator>
      <dc:date>2018-04-18T13:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455155#M284270</link>
      <description>&lt;P&gt;Open a cmd window, navigate to path_a with cd, and do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;copy *.sas c:\path_b\*.txt&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455155#M284270</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-18T13:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455157#M284271</link>
      <description>great, thanks!</description>
      <pubDate>Wed, 18 Apr 2018 13:27:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455157#M284271</guid>
      <dc:creator>darb</dc:creator>
      <dc:date>2018-04-18T13:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455159#M284272</link>
      <description>&lt;P&gt;You can use the operating system command to copy the files.&amp;nbsp; Since you have SAS available it can be used to generate the commands for you, but you could use any programming language.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assume that want tom copy all files with extension .sas from one folder to another folder then you might use code like this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let indir=c:\saspgms ;
%let outdir= c:\txtpgms;
data _null_;
  length infile outfile $256 extension $20 cmd $500 ;
  infile "&amp;amp;indir\*.sas /b" pipe truncover ;
  input infile $256. ;
  extension = scan(infile,-1,'.');
  if upcase(extension)='SAS';
  outfile=cats(tranwrd(substr(infile,1,length(infile)-3),"&amp;amp;indir\","&amp;amp;outdir\"),'txt');
  cmd=catx(' ','copy',quote(trim(infile)),quote(trim(outfile));
  infile copy pipe filevar=cmd ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:28:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455159#M284272</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-04-18T13:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455166#M284273</link>
      <description>&lt;P&gt;I am sorry, where did you get the idea that .sas programs need to be called .txt?&amp;nbsp; It does not make sense, and is counter-productive.&amp;nbsp; Examine the guidance for industry:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.fda.gov/downloads/ForIndustry/DataStandards/StudyDataStandards/UCM241502.pdf" target="_blank"&gt;https://www.fda.gov/downloads/ForIndustry/DataStandards/StudyDataStandards/UCM241502.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In particular page 5 of 12, which states:&lt;/P&gt;
&lt;P&gt;Any requested programs (scripts) generated by an analysis tool should be provided as ASCII text files and should include sufficient documentation to allow a reviewer to understand the submitted programs. If the programs created by the analysis tool use a file extension for ASCII text files other than .txt, the file name should include the native file extension generated by the analysis tool for ASCII text program files, e.g. myRcode.r, mySAScode.sas, etc. If the analysis tool does not save programs in ASCII format, a PDF rendition of the program file should be provided in addition to the program file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS programs should be sent as they are with the file extension .sas.&amp;nbsp; They are plain text files, and are associated with the SAS software.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455166#M284273</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-04-18T13:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455168#M284274</link>
      <description>&lt;P&gt;I had an inkling that this is a result of misunderstanding, or misinterpretation of some guideline.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 13:36:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455168#M284274</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-18T13:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Program to TXT file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455176#M284275</link>
      <description>Well I don't know how many drug submissions you have partook in, but for every single one I have been a part of, the FDA has specifically requested from us .TXT files. And this has been consistent for me across multiple companies. So it would be appreciated if rather questioning the reason I need help, to just providing the help needed. Thanks.</description>
      <pubDate>Wed, 18 Apr 2018 13:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-Program-to-TXT-file/m-p/455176#M284275</guid>
      <dc:creator>darb</dc:creator>
      <dc:date>2018-04-18T13:50:22Z</dc:date>
    </item>
  </channel>
</rss>

