TRFCTL Command in OPM CL Programs

TRFCTL Command in OPM CL Programs.
TRFCTL Command in OPM CL Programs, CALL STACK, PGM PROGRAM, Difference between CALL and TRFCTL Command, ibmi, as400 and sql tricks, as400 tutorial, ibmi tutorial
TRFCTL Command in OPM CL Programs

Transfer control command for CL programming

TRFCTL COMMAND is used to call the specified program, pass the control to the called program and remove the calling program from the return CALL STACK. So the control cannot be returned back to the calling program when called program ends.

Example

TRFCTL PGM1 PARM(parm1)
  • Suppose, from command line we called PGM1 and PGM1 calls PGM2, then control transfers to PGM2 from PGM1 and when PGM2 ends the control came back to PGM1. However, this is not the case with TRFCTL command, here when PGM2 TRFCTL PGM3 then control returns to PGM1 since PGM2 is now removed from the call stack.
  • Suppose, from command line we called PGM2 and PGM2 TRFCTL PGM3, then control returns to command line since PGM2 is now removed from the call stack.
  • Note

  • TRFCTL Command valid in OPM CL program.
  • TRFCTL command is not supported in ILE CL.
  • Only PARM can be passed to this program no return value since calling program got removed from the call stack once TRFCTL command gets invoked.
  • Post a Comment

    © AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain