title: have a batch file call an AS400 macro
body: <p>I am trying to decrease user intervention when doing an upgrade. I have a batch file that does the ftp portion and restores on the AS400 as follows:</p>
  
  <pre><code>@echo off
  
  if EXIST ftpcmd2.dat goto :justRunIt
  
  SET /P userpw= Please enter in QSECOFR password:
  SET /P IPaddr= Please enter in IP address of the AS400:
  
  
   &gt;ftpcmd.dat echo.open %IPaddr%
  &gt;&gt;ftpcmd.dat echo.user
  &gt;&gt;ftpcmd.dat echo.QSECOFR
  &gt;&gt;ftpcmd.dat echo.%userpw%
  &gt;&gt;ftpcmd.dat echo.bin
  &gt;&gt;ftpcmd.dat echo.lcd c:\ahc
  &gt;&gt;ftpcmd.dat echo.cd /qsys.lib/ahcpgm.lib
  &gt;&gt;ftpcmd.dat echo.put PCDIST.savf
  &gt;&gt;ftpcmd.dat echo.quote rcmd CLRLIB LANSASHIP
  &gt;&gt;ftpcmd.dat echo.quote rcmd RSTLIB SAVLIB(LANSASHIP) DEV(*SAVF) SAVF(AHCPGM/PCDIST)
  &gt;&gt;ftpcmd.dat echo.quote rcmd DLTOBJ OBJ(QGPL/LANSAISHP2) OBJTYPE(*FILE)
  &gt;&gt;ftpcmd.dat echo.quote rcmd CRTDUPOBJ OBJ(LANSAISHP2) FROMLIB(LANSASHIP) OBJTYPE(*FILE) TOLIB(QGPL) DATA(*YES)
  &gt;&gt;ftpcmd.dat echo.quote rcmd ENDSBS SBS(RELPGMLIB) OPTION (*IMMED)
  
  
  ftpcmd.dat echo.quit
  
  
  :justRunIt
  ftp -n -s:ftpcmd2.dat
  </code></pre>
  
  <p>When this completes I want to call the AS400 macro to finish the update as follows :</p>
  
  <pre><code>Description =
  "ahc
  [tab field]
  "ahc
  [enter]
  [enter]
  "addlible relpgmlib                     
  [enter]
  "lansa partition(rel) developer(a)
  [enter]
  "5
  [enter]
  "8
  [enter]
  [down]
  [down]
  [down]
  [down]
  [down]
  [down]
  [down]
  [down]
  [down]
  [down]
  [up]
  "lansaishp2
  [tab field]
  [down]
  [down]
  [down]
  "yes
  [enter]
  [down]
  [tab field]
  "wrksbmjob
  [enter]
  [pf5]
  </code></pre>