<?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: x command for copying files not working in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191354#M266125</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The main logic problem with your code is you have created a macro variable with a nice value for using in the name of the directory, but it is not a value that can be easily used in the WHERE clause. In particular if DATE6=2014-07-22 then your directory name D:\WOO\TEST\&amp;amp;date6 will work well, but your IF (date_var = &amp;amp;date6) will not because SAS will interpret 2014-07-22 as (2014-07)-22 which is 08JUN1965 if treated as a date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to limit which file names you process further just put in a WHERE or IF statement in the proper place.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;&amp;nbsp; where file_last_written_date = today()-1 ;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2014 22:49:31 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2014-07-23T22:49:31Z</dc:date>
    <item>
      <title>x command for copying files not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191349#M266120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello friends - please help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am using below code to transfer some previous day text files to different folder - but x command is not working - i am running this code in base sas since x command is valid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename all_txt pipe 'dir "d:\woo\test\*.txt" /tw';&lt;/P&gt;&lt;P&gt;data transfer_yesterday_files;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; attrib&amp;nbsp; buffer format=$2000.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file_last_written_date format=yymmdd10.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file_last_written_time format=time5.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file_name format=$100.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; infile all_txt truncover ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input buffer $2000.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /* Remove some extra info */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if substr(buffer,1,5) in ("Volum","Direc") or index(buffer,"&amp;lt;DIR&amp;gt;")&amp;gt;0 or index(buffer,"Dir(s)")&amp;gt;0 or index(buffer,"File(s)")&amp;gt;0 then delete; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; file_last_written_date=input(put(scan(compbl(buffer),1,' '),$10.),mmddyy10.);&amp;nbsp; /* note dependant on system settings */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; file_last_written_time=input(put(scan(compbl(buffer),2,' '),$5.),time5.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; file_name=trim(scan(compbl(buffer),5,' ')) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if file_name = ' ' then delete ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;tempdate1=intnx('day',today(),0);&lt;/P&gt;&lt;P&gt;tempdate2=intnx('day',today(),-1);&lt;/P&gt;&lt;P&gt;tempdate3=intnx('day',today(),-2);&lt;/P&gt;&lt;P&gt;tempdate4=intnx('day',today(),-3);&lt;/P&gt;&lt;P&gt;tempdate5=intnx('day',today(),-4);&lt;/P&gt;&lt;P&gt;tempdate6=intnx('day',today(),-5);&lt;/P&gt;&lt;P&gt;tempdate7=intnx('day',today(),-6);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call symput('date1',put(tempdate1,yymmdd10.));&lt;/P&gt;&lt;P&gt;call symput('date2',put(tempdate2,yymmdd10.));&lt;/P&gt;&lt;P&gt;call symput('date3',put(tempdate3,yymmdd10.));&lt;/P&gt;&lt;P&gt;call symput('date4',put(tempdate4,yymmdd10.));&lt;/P&gt;&lt;P&gt;call symput('date5',put(tempdate5,yymmdd10.));&lt;/P&gt;&lt;P&gt;call symput('date6',put(tempdate6,yymmdd10.));&lt;/P&gt;&lt;P&gt;call symput('date7',put(tempdate7,yymmdd10.));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%put _user_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;set&amp;nbsp; transfer_yesterday_files;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if file_last_written_date=&amp;amp;date6 then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x copy "d:\woo\test\*.txt d:\woo\test\transfer\&amp;amp;date6"; /*&lt;STRONG&gt;here &amp;amp;date6=2014-07-18 (if we run code today, 2014-07-23) and i have daily batch process which creates previous day folder in same format, &lt;STRONG&gt;2014-07-18&lt;/STRONG&gt;&lt;/STRONG&gt;*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 17:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191349#M266120</guid>
      <dc:creator>woo</dc:creator>
      <dc:date>2014-07-23T17:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: x command for copying files not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191350#M266121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think one problem lies here:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; if file_last_written_date=&amp;amp;date6 ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;It looks like you are trying to compare a data value to the result of subtracting 18 from the difference between 2014 and 7.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Try changing to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; if file_last_written_date=input("&amp;amp;date6",yymmdd10.) ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Other problem is that it looks like your operating system COPY command will copy all of the .txt files and not just the ones with the date you specified.&amp;nbsp; Is that what you want?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 18:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191350#M266121</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-23T18:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: x command for copying files not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191351#M266122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No Tom - you are right - i am not going to copy all text files - just specific text file &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;filename all_txt pipe 'dir "d:\woo\test\*.txt" /tw';&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;data transfer_yesterday_files;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; attrib&amp;nbsp; buffer format=$2000.&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file_last_written_date format=yymmdd10.&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file_last_written_time format=time5.&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file_name format=$100.;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; infile all_txt truncover ;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; input buffer $2000.;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; /* Remove some extra info */&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; if substr(buffer,1,5) in ("Volum","Direc") or index(buffer,"&amp;lt;DIR&amp;gt;")&amp;gt;0 or index(buffer,"Dir(s)")&amp;gt;0 or index(buffer,"File(s)")&amp;gt;0 then delete;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; file_last_written_date=input(put(scan(compbl(buffer),1,' '),$10.),mmddyy10.);&amp;nbsp; /* note dependant on system settings */&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; file_last_written_time=input(put(scan(compbl(buffer),2,' '),$5.),time5.);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; file_name=trim(scan(compbl(buffer),5,' ')) ;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; if file_name = ' ' then delete ;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;data _null_;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;tempdate1=intnx('day',today(),0);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;tempdate2=intnx('day',today(),-1);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;tempdate3=intnx('day',today(),-2);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;tempdate4=intnx('day',today(),-3);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;tempdate5=intnx('day',today(),-4);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;tempdate6=intnx('day',today(),-5);&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;tempdate7=intnx('day',today(),-6);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;call symput('date1',put(tempdate1,yymmdd10.));&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;call symput('date2',put(tempdate2,yymmdd10.));&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;call symput('date3',put(tempdate3,yymmdd10.));&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;call symput('date4',put(tempdate4,yymmdd10.));&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;call symput('date5',put(tempdate5,yymmdd10.));&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;call symput('date6',put(tempdate6,yymmdd10.));&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;call symput('date7',put(tempdate7,yymmdd10.));&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;%put _user_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%macro trans;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;data _null_;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;set&amp;nbsp; transfer_yesterday_files;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp; if file_last_written_date=&amp;amp;date6 then&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; do;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x "mkdir d:\woo\test\&amp;amp;date6";&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x "copy &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;&lt;STRONG&gt;/*i need copy command here which would copy files which are having "file_last_written_date=&amp;amp;date6*/&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x "copy "d:\woo\test\*.txt d:\woo\test\&amp;amp;date6";&lt;/P&gt;&lt;P style="background-color: #ffffff;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN style="color: #ff0000; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x "gzip "/*i need gzip command here which will zip all &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;transferred&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-family: inherit;"&gt; files into newly created folder "&amp;amp;date6" which will be date folder like 2014-07-18*/ &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;%mend;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;%trans;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 18:44:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191351#M266122</guid>
      <dc:creator>woo</dc:creator>
      <dc:date>2014-07-23T18:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: x command for copying files not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191352#M266123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Depends on what version of GZIP you have installed on your Windows machine.&amp;nbsp; Here is one page that suggests that the standard Unix style might work.&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="ftp://ftp.whrc.org/Pre-LBA/software/gziptar/gzip.txt"&gt;ftp://ftp.whrc.org/Pre-LBA/software/gziptar/gzip.txt&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;If you want a little more control over what the compressed file is named you can use the c option and re-direct the output of gzip to a file.&amp;nbsp; An example illustrates this usage:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; C:\&amp;gt;gzip -c thefile.txt &amp;gt; thefile.gz&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;If you use that syntax then you do not need to first COPY the file.&amp;nbsp; You will probably need to know where the command "gzip" is on your computer as you might need to use the fully qualified path to the program to get it run. For example it might be something like "c:\program files\wingzip\gzip.exe"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are working too hard to read in the output of the DIR command.&lt;/P&gt;&lt;P&gt;Once you have it the list of files you could then sort by the last written date and process the files that way. &lt;/P&gt;&lt;P&gt;One way to process the commands is to have them in a character variable and use the INFILE PIPE with FILEVAR= option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; path = c:\downloads ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; transfer_yesterday_files;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;attrib&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; file_name &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=$&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;255&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;attrib&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; file_size &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;comma20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;attrib&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; file_last_written_date &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;yymmdd10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;attrib&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; file_last_written_time &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;time5.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"dir /tw ""&amp;amp;path\*.txt"" "&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; pipe &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;lrecl&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;3000&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; file_last_written_date ??&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;mmddyy10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file_last_written_time ??&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;time10.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file_size :??&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;comma20.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file_name &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;$255.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; file_last_written_date=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;put&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;_infile_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;delete&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;sort&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=transfer_yesterday_files;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; file_last_written_date ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; cmds;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; transfer_yesterday_files;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; file_last_written_date ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; cmd $&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;600&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; dir $&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;300&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;keep&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; cmd ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; dir = cats(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;path\"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,put(file_last_written_date,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal; background: white;"&gt;yymmdd10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;),&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'\'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; first.file_last_written_date &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd=catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'mkdir'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,quote(trim(dir))) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; cmd = catx(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'gzip -c'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,quote(cats(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;"&amp;amp;path\"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,file_name))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;,quote(cats(dir,file_name,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'.gz'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;print&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE cellpadding="5" cellspacing="0" class="table" frame="box" rules="all" summary="Procedure Print: Data Set WORK.CMDS"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;1&lt;/TH&gt;&lt;TD class="l data"&gt;mkdir "c:\downloads\2014-04-28\"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;2&lt;/TH&gt;&lt;TD class="l data"&gt;gzip -c "c:\downloads\cencty.txt" &amp;gt; "c:\downloads\2014-04-28\cencty.txt.gz"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;3&lt;/TH&gt;&lt;TD class="l data"&gt;mkdir "c:\downloads\2014-06-30\"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;4&lt;/TH&gt;&lt;TD class="l data"&gt;gzip -c "c:\downloads\Enhanced Dosage.txt" &amp;gt; "c:\downloads\2014-06-30\Enhanced Dosage.txt.gz"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;5&lt;/TH&gt;&lt;TD class="l data"&gt;mkdir "c:\downloads\2014-07-08\"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;6&lt;/TH&gt;&lt;TD class="l data"&gt;gzip -c "c:\downloads\pfizer_manifest.txt" &amp;gt; "c:\downloads\2014-07-08\pfizer_manifest.txt.gz"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;7&lt;/TH&gt;&lt;TD class="l data"&gt;mkdir "c:\downloads\2014-07-23\"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;8&lt;/TH&gt;&lt;TD class="l data"&gt;gzip -c "c:\downloads\SeriesDataOut.txt" &amp;gt; "c:\downloads\2014-07-23\SeriesDataOut.txt.gz"&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TH class="r rowheader" scope="row"&gt;9&lt;/TH&gt;&lt;TD class="l data"&gt;gzip -c "c:\downloads\SeriesIn.txt" &amp;gt; "c:\downloads\2014-07-23\SeriesIn.txt.gz"&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; cmds ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; cmd pipe &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;filevar&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=cmd &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=eof ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; (not eof); &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;put&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;_infile_&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp; eof=&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 19:18:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191352#M266123</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-23T19:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: x command for copying files not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191353#M266124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is awesome Tom - it worked fine - just few questions if you got some time...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there any way i can stay with date logic to use below mkdir/copy/zip command? why i am asking is because i will have different dates files and i want to treat specific date files only - so basically this process will run daily - for example &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- if this sas code (the one you gave me) run today then it supposed to created folder with yesterday's date and copy yesterday's files into yesterday folder and then zip the files &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;- but what if folder has more than one different date files - how this code will treat it?&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/*i wanted to stay with this code if i can - but it doesn't seems feasible for me*/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;%macro trans;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;data _null_;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;set&amp;nbsp; transfer_yesterday_files;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp; if file_last_written_date=&amp;amp;date6 then&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; do;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x "mkdir d:\woo\test\&amp;amp;date6";&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x "copy &lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;/*i need copy command here which would copy files which are having "file_last_written_date=&amp;amp;date6*/&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x "copy "d:\woo\test\*.txt d:\woo\test\&amp;amp;date6";&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;EM style="font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x "gzip "/*i need gzip command here which will zip all &lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;transferred&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt; files into newly created folder "&amp;amp;date6" which will be date folder like 2014-07-18*/&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;%mend;&lt;/P&gt;&lt;P style="font-style: inherit; font-family: inherit; background-color: #ffffff;"&gt;%trans;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 21:17:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191353#M266124</guid>
      <dc:creator>woo</dc:creator>
      <dc:date>2014-07-23T21:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: x command for copying files not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191354#M266125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The main logic problem with your code is you have created a macro variable with a nice value for using in the name of the directory, but it is not a value that can be easily used in the WHERE clause. In particular if DATE6=2014-07-22 then your directory name D:\WOO\TEST\&amp;amp;date6 will work well, but your IF (date_var = &amp;amp;date6) will not because SAS will interpret 2014-07-22 as (2014-07)-22 which is 08JUN1965 if treated as a date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to limit which file names you process further just put in a WHERE or IF statement in the proper place.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: black;"&gt;&amp;nbsp; where file_last_written_date = today()-1 ;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 22:49:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191354#M266125</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-23T22:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: x command for copying files not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191355#M266126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Let's look at your example code line by line.&amp;nbsp; Note that there is no need for a macro as there is no macro logic happening here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets assume that you created a macro variable named DATE6 with value like 2014-07-22.&lt;/P&gt;&lt;P&gt;And that you want to write into that folder the files from the TRANSFER_YESTERDAY_FILES dataset that were modified on that date.&lt;/P&gt;&lt;P&gt;Note a few things that trip up this type of things.&lt;/P&gt;&lt;P&gt;1) Make sure to use quotes around paths and filenames in your generated windows commands. This will allow you to process directories or files that contain embedded spaces .&lt;/P&gt;&lt;P&gt;2) If you have a literal string in a SAS state that is using double quotes on the outside (so that macro variables are resolved) then you need to double up the embedded double quote characters so that SAS does not interpret them as ending the literal string that you started with a double quote.&lt;/P&gt;&lt;P&gt;3) Use the CALL SYSTEM() command instead of the X command so that you can generate the commands from the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; set transfer_yesterday_files;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; where file_last_written_date = input("&amp;amp;date6",yymmdd8.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;/* You want to use the &lt;STRONG&gt;CALL SYSTEM&lt;/STRONG&gt; command instead of the X command */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;/* inside of a data step. That way you can dynamically generate the command. */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;/* See man pages:&amp;nbsp; SAS(R) 9.2 Companion for UNIX Environments */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;* Make a directory ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call system ("mkdir ""d:\woo\test\&amp;amp;date6"" ");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;* Copy the file from source directory to the new directory ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call system('copy "d:\woo\test\' || trim(file_name) || '"' ||" ""d:\woo\test\&amp;amp;date6\"" ");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;* Use GZIP command to compress it.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;* Note that GZIP is NOT a Windows command so you will need to install it if you do not have it ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;* You should test the syntax on your machine in a command window to make you can do this on your machine. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; call system("gzip ""d:\woo\test\&amp;amp;date6\" || trim(file_name) ||'"');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 23:25:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191355#M266126</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-07-23T23:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: x command for copying files not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191356#M266127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THANKS A LOT TOM for your sizable time and explanation - this will help me for other logic creation too...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Really appreciate your efforts....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2014 00:03:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/x-command-for-copying-files-not-working/m-p/191356#M266127</guid>
      <dc:creator>woo</dc:creator>
      <dc:date>2014-07-24T00:03:28Z</dc:date>
    </item>
  </channel>
</rss>

