title: Output to Log the output from CMD in SAS?
body: <p>I am trying to do a Check Sum on a file and I thought using the X command was a good idea. </p>
  
  <pre><code>x 'CertUtil -hashfile U:\Programs\test\example.xml MD5';
  </code></pre>
  
  <p>I have looked all over the web to find out if I can print the output from this to the SAS Log, or even better to ODS PDF, but can't find anything.</p>
  
  <p>I did explore using the DM statement but again I am unsure whether I can use CMD with this.</p>
  
  <p>How do I print the CMD output to the SAS Log?</p>
  
  <blockquote>
    <p></p>
  </blockquote>
  
  <p>FINAL CODE AFTER ANSWER</p>
  
  <pre><code>filename fn pipe "CertUtil -hashfile U:\Programs\test\example.xml MD5";
  
  data _NULL_;
  infile fn MISSOVER DSD TRUNCOVER;
  input 
  VAR1 $200. ;
  put _infile_;
  IF _N_ = 2 THEN CALL SYMPUT("HASH",VAR1);
  run;
  ods pdf text = "CheckSum for example.xml: &amp;HASH";
  </code></pre>