Calling Authority Broker from a Program

The LSWPPRF command can be called directly from programs.

Consider the following very simple example:

  1. The user types in the PWRQRY command, and then supplies a User name that they wish to run Queries as.
  2. The program does a LSWPPRF.
  3. The program executes the IBM WRKQRY command – resulting in the user running query in a swapped environment.
  4. When the user exits the WRKQRY screen, an LRLSPRF is performed, and then the program ends.
  5. The user is returned to their original application.

Sample code for this example (without error checking) is as follows:

Command PWRQRY

CMD PROMPT('PowerTech Controlled Query')

PARM KWD(QUERYUSER) TYPE(*NAME) LEN(10) MIN(1) +

CHOICE('User Name') PROMPT('Query User Name')

 

Program PWRQRY

PGM PARM( &QryUser )

DCL &QryUser *Char 10

 

LSWPPRF TOUSER( &QryUser ) +

REASON( 'Start of PowerTech controlled Query process' ) +

CALLTICKET( *NONE )

WRKQRY

LRLSPRF TOUSER( &QryUser )

 

ENDPGM

 

Copyright © HelpSystems, LLC.
All trademarks and registered trademarks are the property of their respective owners.
4.18 | 201802261131