<?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: the contents of SAS data _null_ in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256354#M49126</link>
    <description>&lt;P&gt;Thank you&amp;nbsp; so much , tom.&lt;/P&gt;
&lt;P&gt;I want to say by "deos the job well", I get the right the results, I think, when I do not use my methode , I can not keep the files name in data steps&lt;/P&gt;</description>
    <pubDate>Sun, 13 Mar 2016 00:44:35 GMT</pubDate>
    <dc:creator>LineMoon</dc:creator>
    <dc:date>2016-03-13T00:44:35Z</dc:date>
    <item>
      <title>the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256234#M49064</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the sas option about the using x command -with unix- and data inside data _null_ likes this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;x&amp;nbsp;&amp;nbsp; " cd&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;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data toto;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;It works, but is it correct ?&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 22:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256234#M49064</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-03-11T22:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256254#M49073</link>
      <description>X is a global statement which means that it executes outside the data step. &lt;BR /&gt;The similar call system executes inside the data step.</description>
      <pubDate>Fri, 11 Mar 2016 23:32:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256254#M49073</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-11T23:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256256#M49074</link>
      <description>&lt;P&gt;You want to check OS specific bits but X is a global statement inside a data step like Format, Label, informat, drop and such. It executes as a data step is compiled.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need this conditionally executed then use CALL SYSTEM instead.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2016 23:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256256#M49074</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-03-11T23:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256277#M49085</link>
      <description>&lt;P&gt;For every thing run ok.&lt;/P&gt;
&lt;P&gt;But is it correct to run&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;......................&lt;/P&gt;
&lt;P&gt;..................&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data toto;&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 09:56:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256277#M49085</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-03-12T09:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256290#M49090</link>
      <description>New question = new thread. &lt;BR /&gt;This question is very basic and can be found in the documentation. And why so you ask, what's problem?</description>
      <pubDate>Sat, 12 Mar 2016 13:47:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256290#M49090</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-03-12T13:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256318#M49104</link>
      <description>&lt;P&gt;Because, I have seen two opinions some says that is correct, some says , it is not correct.&lt;/P&gt;
&lt;P&gt;Do you have any documentation for that ?&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 19:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256318#M49104</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-03-12T19:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256327#M49111</link>
      <description>&lt;P&gt;It is easier for the humans that need to read your programs to explicitely end your steps. &amp;nbsp;But if you don't SAS will end them when it sees that you want to start a new one.&lt;/P&gt;
&lt;P&gt;So if you code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data step1;
  &amp;lt;some data step statements&amp;gt;
run;
data _null_;
  x &amp;lt;some OS statement&amp;gt;
  &amp;lt;some data step statements&amp;gt;
data step3;
  &amp;lt;some data step statements&amp;gt;
run;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The SAS will run the first data step, then the X command, then the second (data _null_) step and then the third data step. &amp;nbsp;The extra run statement at the end does nothing.&lt;/P&gt;
&lt;P&gt;To make it clearer to humans you should code it this way.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data step1;
  &amp;lt;some data step statements&amp;gt;
run;
x &amp;lt;some OS statement&amp;gt;
data _null_;
  &amp;lt;some data step statements&amp;gt;
run;
data step3;
  &amp;lt;some data step statements&amp;gt;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 12 Mar 2016 20:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256327#M49111</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-03-12T20:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256343#M49118</link>
      <description>The data _null_ does not add any value to your process. If it doesn't add value why include it in your code?&lt;BR /&gt;&lt;BR /&gt;Keep it clean.</description>
      <pubDate>Sat, 12 Mar 2016 22:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256343#M49118</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-12T22:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256345#M49120</link>
      <description>&lt;P&gt;Thank you for answer, that's quiet well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I observe that ,if I want to do action by sas and unix command( copy : cp....), for exemple, if I want to copy a file and to stock thiers names in sas table, I must have to do :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; x "cd&amp;nbsp; rep";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; filename fle pipe "cp&amp;nbsp; -R &amp;nbsp; V1&amp;nbsp; V2";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data check_files;&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; length file_name&amp;nbsp; $300;&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; infile&amp;nbsp; fle truncover;&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; input fle 1-300;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank for your comments, any documentation are welcomed &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 22:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256345#M49120</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-03-12T22:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256346#M49121</link>
      <description>&lt;P&gt;Thank you for your answer.&lt;/P&gt;
&lt;P&gt;As I said before, I observe that, when I use data _null_ ; x....; &amp;nbsp; data t;&amp;nbsp;&amp;nbsp;&amp;nbsp; run run;&lt;/P&gt;
&lt;P&gt;I can keep the files names in data&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 22:53:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256346#M49121</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-03-12T22:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256347#M49122</link>
      <description>&lt;P&gt;I think you might be under the impression that you can nest steps the same way you might nest DO loops. &amp;nbsp;That doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As to your sample program what are you trying to read into the dataset? &amp;nbsp;What output do you expect the cp command to generate?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps you meant to use the ls command instead.&lt;/P&gt;
&lt;P&gt;Note that you can just put the command(s) into the INFILE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data check_files;
  infile "cd  rep ; ls  -R   V1  V2" pipe truncover;
  length file dname $255 ;
  retain dname ;
  input file $255. ;
  if file=' ' then delete;
  if substr(file,length(file))=':' then do;
      dname=file;
      delete;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 12 Mar 2016 23:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256347#M49122</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-03-12T23:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256350#M49123</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom﻿&lt;/a&gt; : Thank for your answer again.&lt;/P&gt;
&lt;P&gt;I want to copie a directory( D1)&amp;nbsp; into an other directory(D2)&lt;/P&gt;
&lt;P&gt;I know with the command "ls", I do not need my synthax " Data _null_; x&amp;nbsp; ...; data chech;&amp;nbsp;&amp;nbsp; run; run;&lt;/P&gt;
&lt;P&gt;For some commands, to work my command " CP and others commands " to keep the files, I need&amp;nbsp; my synthax "" Data _null_; x&amp;nbsp; ...; data chech;&amp;nbsp;&amp;nbsp; run; run; " but my method does&amp;nbsp; the job well, that's why I ask the question ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 00:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256350#M49123</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-03-13T00:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256351#M49124</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44053"&gt;@LineMoon&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt; : Thank for your answer again.&lt;/P&gt;
&lt;P&gt;I want to copie a directory( D1)&amp;nbsp; into an other directory(D2)&lt;/P&gt;
&lt;P&gt;I know with the command "ls", I do not need my synthax " Data _null_; x&amp;nbsp; ...; data chech;&amp;nbsp;&amp;nbsp; run; run;&lt;/P&gt;
&lt;P&gt;For some commands, to work my command " CP and others commands " to keep the files, I need&amp;nbsp; my synthax "" Data _null_; x&amp;nbsp; ...; data chech;&amp;nbsp;&amp;nbsp; run; run; " but my method does&amp;nbsp; the job well, that's why I ask the question ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not sure what you mean by "does the job well". &amp;nbsp;If you want to execute the copy command you can either just run the command using one of the many methods to run the command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x "cd top_level_directory; cp -R d1 d2" ;

/* OR */

%sysexec "cd top_level_directory; cp -R d1 d2" ;

/*  OR */

data _null_;
  call system("cd top_level_directory; cp -R d1 d2" );
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you can use the PIPE option on a FILENAME or an INFILE statement. But for that to make the command actually run you need attempt to read from the pipe.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile  "cd top_level_directory; cp -R d1 d2"  pipe;
  input;
  put _infile_;
run;

/* OR */

filename cmd pipe "cd top_level_directory; cp -R d1 d2" ;
data _null_;
  infile cmd ;
  input;
  put _infile_;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In no case is it necessary to add an extra 'data _null_;' before everything or and extra 'run;' after everything.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 00:36:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256351#M49124</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-03-13T00:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256353#M49125</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44053"&gt;@LineMoon&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your answer.&lt;/P&gt;
&lt;P&gt;As I said before, I observe that, when I use data _null_ ; x....; &amp;nbsp; data t;&amp;nbsp;&amp;nbsp;&amp;nbsp; run run;&lt;/P&gt;
&lt;P&gt;I can keep the files names in data&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What do you mean by "keep the files names in data"? &amp;nbsp;Unless your Unix system works differenly than most the cp command will not output any file names for you to read into a data set. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps you mean that you want to generate the command to run using data that you have in an existing SAS dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example let's say that the directory names that you want to copy are available as the values of variables in a dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
   source='D1';
   target='D2';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now you can use this data step to generate the proper copy command ('cp -R D1 D2') and execute it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   set example;
   length cmd $1000;
   cmd = catx(' ','cp -R',source,target);
   infile cmd pipe filevar=cmd ;
   input;
   put _infile_;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 00:49:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256353#M49125</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-03-13T00:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256354#M49126</link>
      <description>&lt;P&gt;Thank you&amp;nbsp; so much , tom.&lt;/P&gt;
&lt;P&gt;I want to say by "deos the job well", I get the right the results, I think, when I do not use my methode , I can not keep the files name in data steps&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 00:44:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256354#M49126</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-03-13T00:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256355#M49127</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom﻿&lt;/a&gt;: what's i mean by&amp;nbsp; "keep the files names in data"? &amp;nbsp;&lt;/P&gt;
&lt;P&gt;So , I the ddirectory&lt;/P&gt;
&lt;P&gt;D1/file1.txt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; /ffile2.txt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/file2.xls&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to copy D1 in D2&lt;/P&gt;
&lt;P&gt;After the "copy" , I want to check the files name have been copied from D1 to D2 in data set check likes this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Files&lt;/P&gt;
&lt;P&gt;file1&lt;/P&gt;
&lt;P&gt;file2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filen&lt;/P&gt;
&lt;P&gt;As I said, my method give me the right result for copy, ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 00:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256355#M49127</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-03-13T00:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256356#M49128</link>
      <description>&lt;P&gt;If you want to check whether the copy succeeded it is probably easiest to just read the list of files and compare them.&lt;/P&gt;
&lt;P&gt;Did you try using the unix command &lt;STRONG&gt;diff&lt;/STRONG&gt;. &amp;nbsp;&lt;STRONG&gt;diff -rq D1 D2&lt;/STRONG&gt; will compare directory D1 with directory D2 and report the differences.&lt;/P&gt;
&lt;P&gt;Or just read the output of the &lt;STRONG&gt;ls&lt;/STRONG&gt; (or&lt;STRONG&gt; ls -R&lt;/STRONG&gt;) command into datasets and compare the datasets.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 00:58:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256356#M49128</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-03-13T00:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256414#M49139</link>
      <description>&lt;P&gt;that's correct..We can do that, I have used it before&lt;/P&gt;
&lt;P&gt;But the difference is that, with my method, in one action, I can copy and check the files names..&lt;/P&gt;
&lt;P&gt;In other methos, I think, I need two actions : action1 : copy( with cp) and&amp;nbsp; action2 : listing the contents(with ls)&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 10:28:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256414#M49139</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-03-13T10:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256416#M49141</link>
      <description>&lt;P&gt;Where are you getting the file names now? The cp command you are running will not list the file names. So the data step you are running that is reading form the output of the cp command will read nothing and so have 0 observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try adding the -v option to the copy command. &amp;nbsp;THen the data step that runs the cp command could read the output and parse it. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;To see how that might work let's create a couple and directories with some files and try to copy from one directory to the other.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;gt;mkdir dir1
&amp;gt;mkdir dir2
&amp;gt;touch dir1/file1
&amp;gt;touch dir1/file2
&amp;gt;touch dir1/file3
&amp;gt;touch dir2/file2
&amp;gt;chmod -w dir2/file2
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notice how there should be a problem copying file2 since the target file alread exists and is readonly. &amp;nbsp;Now lets try to copy and see what messages the -v option generates.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;gt;cp -vR dir1/* dir2 
`dir1/file1' -&amp;gt; `dir2/file1'
`dir1/file2' -&amp;gt; `dir2/file2'
cp: cannot create regular file `dir2/file2': Permission denied
`dir1/file3' -&amp;gt; `dir2/file3'
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So now you could make yourself a data step that reads that output and generates a SAS dataset with the messages.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data files ;
  infile 'cp -vR dir1/* dir2' pipe dsd dlm=' ' truncover end=eof;
  length success 8 from to $255 dummy $5 ;
  drop dummy;
  input from dummy to ;
  if eof then success=1 ;
  else do;
    input @@;
    success = (_infile_ ^=: 'cp:') ;
    if not success then input;
  end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 12:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256416#M49141</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-03-13T12:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: the contents of SAS data _null_</title>
      <link>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256421#M49142</link>
      <description>&lt;P&gt;Thank tou Tom&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 14:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/the-contents-of-SAS-data-null/m-p/256421#M49142</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-03-13T14:51:32Z</dc:date>
    </item>
  </channel>
</rss>

