title: How do I copy a member with a REXX/CLIST batch program (no ISPF)?
body: <p>Under z/OS, I want to write a REXX or CLIST script to copy one sequential data set to another and then run another script (REXX). The other script expects a specific SDS to exist and I want to be able to copy one of many options to that member before running the second script. This is from TSO so I don't have access to any of the fancy ISPF stuff.</p>
  
  <p>So, basically:</p>
  
  <pre><code>Copy 'level1.level2.name.type1' to 'level1.level2.name'
  runother p1 p2 p3
  </code></pre>
  
  <p>The <code>runother</code> Rexx script uses 'level1.level2.name' to do its own magic - I'm just providing a different one for each of my possibilities.</p>
  
  <p>So I need a script called 'xx42' which copies 'level1.level2.name.42' and I can then modify that for values other than 42. Even better would be to parameterize that script so I could just use </p>
  
  <pre><code>xx 42 p1 p2 p3
  </code></pre>
  
  <p>or</p>
  
  <pre><code>xx 27 p1 p2 p3
  </code></pre>
  
  <p>rather than having a script for each value. This would copy the given SDS then pass parameters <code>p1</code>, <code>p2</code> and <code>p3</code> through to <code>runother</code>.</p>