title: AS400 PCOMM LOOP
body: <p>I wish to create at macro loop in PCOMM AS400 VBscript.</p>
  
  <p>The loop must repeat until a designated number is reached and skip</p>
  
  <p>every other number or (step 2) Example: 11 to 273  or 10 to 272</p>
  
  <p>In the ten digit line of code, only the three digit part of the number must change each time; 61106(011-273)AA </p>
  
  <p>There is more to the macro before and after but, all would be repeated each time the above is the only number I need to be variable.</p>
  
  <p>Any help in creating a working for next/loop in VBscript would be appreciated.</p>
  
  <p>I have already researched tried and failed to get this to work.
  ANY HELP WOULD BE GREATLY APPRECIATED.</p>
  
  <pre><code>    `
  
  PCOMM SCRIPT HEADER]
  LANGUAGE=VBSCRIPT
  DESCRIPTION=
  [PCOMM SCRIPT SOURCE]
  OPTION EXPLICIT
  autECLSession.SetConnectionByName(ThisSessionName)
  
  REM This line calls the macro subroutine
  subSub1_
  
  sub subSub1_()
  autECLSession.autECLOIA. WaitForAppAvailable
  
  autECLSession.autECLPS.SendKeys "[pf6]"
  +
  autECLSession.autECLPS.SendKeys For XXX = 011 To 273 Step Two "61106XXXAA"
  
  
  autECLSession.autECLPS.SendKeys "[ENTER]"
  
  Next
  
  End Sub
  </code></pre>
  
  <p>Script has been shortened to highlight the area in question.</p>