ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Call CL Program after running Command ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Call CL Program after running Command ?

    I reverse engineered a 3rd party command to add defaults.
    Now I would like a way to run a CL Program (or statement) after the command executes, using some of the parameters from the command screen.
    Is this possible ?


    The program that the command runs is CL, but I cannot access the CL code. If I could, I would copy it and add my statements afterwards.

  • #2
    I've never heard of anything like that. Could you write a CL program that calls the existing CL program and then runs your added code?

    Comment


    • #3
      The problem is I need some of the variables entered in the command, available to the CL program that called it.
      And I need the CMD to be prompted with F4 to enter data first, not just called automatically
      Last edited by MFisher; June 6, 2022, 11:26 AM.

      Comment


      • #4
        Since the program that the command runs is CL why not use RTVCLSRC?

        To force prompting place a question mark in front of the command: ?mycmd

        Comment


        • #5
          You might be able to use QCAPCMD. In your CL program, use QCAPCMD to prompt the re-engineered 3rd-party command. Then you can execute the filled-in command using QCMDEXC. Next, extract the filled-in parameter values and do whatever you need to do with them.

          Here's an example of QCAPCMD that might help you get started.

          I am a blessed man. Among the niceties of life that I enjoy are hot and cold running water, central heat and air conditioning, abundant food, and the CL command prompter. Many people are not so fortunate. The CL command prompter provides a functional way to pass properly formatted data to a program so the

          Comment


          • #6
            The third party command points at a program that is called.

            If you know the parameters in the third party command you could code your own program that
            calls the third party program and then continues with your code.
            All you then have to do is to change the program that is called from the command to the name of your program.

            Something like
            CMD --> PGM_3_party

            CMD --> myPGM - calling PGM_3_party - and continue with myProgram


            Of course you have to remember to modify the command after an upgrade.

            Comment


            • #7
              Did you find a solution?

              Comment


              • #8
                I wrote a main CL that:

                - Adds library needed for the 3rd party tool
                - DSPF to enter program name and library for 3rd party tool
                - Executes the new command I created , with leading '?' to prompt display to enter parameters, including parms from DSPF
                - After the command executes from the CL, I prompt for a compile program to compile based on earlier parms

                Not quite what I originally envisioned, but it works for our needs.

                Comment

                Working...
                X