Question

I'm creating a screen designer on iSeries 400 [IBM]

The RPGLE program that I create I'm trying to find out what will be the command to let the user be in the wrksplf after they exit from the program (press F3 that I create indicator)

in CLLE I can just use wrksplf at the end of the program before enddo but I can't find any information how to do that in the other languages like RPGLE or anything else.

Was it helpful?

Solution

As long as you are in an interactive job, you can just call QCMDEXC to invoke the command ...

DQCMDEXC          PR                  EXTPGM('QCMDEXC')    
D prCmdStr                    4096A   CONST                
D prCmdLen                      15P 5 CONST                

 /free
  QCMDEXC('WRKSPLF':25);
 /end-free

OTHER TIPS

ILE programs / procedures can call ILE procedures written in other languages. Calling a compiled CLLE procedure containing a command is more efficient than calling the QCMDEXC interpreter interface to parse and execute it. It also enables you to encapsulate more functionality in the called procedure, in cases where that may be helpful.

You could create a simple CLLE module to perform the WRKSPLF command. Your ILE RPG can CALLP to the CL procedure. You can create your program [CRTPGM] with both the RPG and CL modules. Or you can create your program with the RPG module, and create a service program [CRTSRVPGM] with the CL. This method may be preferable in cases where your CL might be used by other programs in the future.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top