title: Add Datetime Stamp to SAS 9.1.3 Filename?
body: <p>I'll start by saying I have very little experience with SAS.  I'm working with SAS 9.1.3 in Windows.  I have no choice in the matter.</p>
  
  <p>I need to name  SAS Transport (XPT) file with the format "CR845_CLIN2001_LB_Date_Time.xpt". Currently I have a script that names it with just the date (sysdate9).</p>
  
  <p>The lines of code that use the date are as follows - these are the lines that I think need to be changed - they are not all in a block:</p>
  
  <pre><code>libname XPORTOUT xport "\\ACMSHARES2\CLNTRIAL\DataMgt\C1845\DataTransfer\Data\Sent\SAS\CR845_CLIN2001_LB_&amp;sysdate9..xpt";
  
  data LabData.&amp;fileBaseName._&amp;sysdate9 (COMPRESS=YES);
  
  data LB.LB; 
      set LabData.&amp;fileBaseName._&amp;sysdate9; 
  run;
  
  proc contents data = LabData.&amp;fileBaseName._&amp;sysdate9 varnum;
  run;
  </code></pre>
  
  <p>I've tried a couple of things but SAS rejects colons in the time. Can anyone help me out? Thanks in advance!</p>