zOs/REXX.O08/TESTBIND

call bind_rebind 'REBIND PACKAGE(DB.DBWK1.(DB2J000003))'
exit
Bind_Rebind:
parse arg bindOpts
  'NEWSTACK'
  /********************************************************************/
  /* QUEUE "DSNE T(123)"       contains tracing options               */
  /********************************************************************/
  queue "DSNE"
  queue BINDOPTS
  queue "END"

  x = outtrap('bindmsg.')
  ADDRESS ATTCHMVS "DSNESM71"            /* call "pre" bind           */
  bind_rc = rc                           /* set rc to DSNESM71 call   */
  x = outtrap('OFF')

  'DELSTACK'
  say 'bind rc' bind_rc D2X(ABS(bind_rc)) 'msgs' bindmsg.0
  do x=1 to bindmsg.0
      say bindmsg.x
      end
  return