Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Check Number of Parameters in CLLE

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

  • Check Number of Parameters in CLLE

    Here are a couple of articles that may help. Basically, you try to access the optional variable and monitor MCH3601 if nothing was passed. Use that to increment a counter. Original article: http://www.itjungle.com/fhg/fhg081104-story02.html Followup from Barbara Morris: http://www.itjungle.com/fhg/fhg092204-story03.html

  • #2
    Check Number of Parameters in CLLE

    Thanks for the info, I tried it and it worked.

    Comment


    • #3
      Check Number of Parameters in CLLE

      tiki wrote:
      Thanks for the info, I tried it and it worked.
      tiki, did you read the second article? It basically says that the first article is dangerously wrong, and it proves it. So you should not count on that MCH3601 technique. It will fail to work someday; Murphy's law says that it will fail to work at the worst possible time. (Perhaps it will fail when you are giving a demo to your boss, or maybe it will fail the day after it goes into production.) I would add an RPG wrapper to the CL. Add an extra &numparms parm at the beginning of the CL parms. Instead of calling the CL, you call the RPG wrapper. The RPG wrapper calls through to the CL, passing %parms as the first parameter.
      Code

      Comment


      • #4
        Check Number of Parameters in CLLE

        Sorry, Barbara, I guess I should have pointed that out in my posting. Thanks for the better solution. This reminds me of the episode of MASH where they're trying to follow instructions for disarming a bomb, and they're reading the instructions one-by-one, and the instructions are "Do A. Do B. Do C. BUT FIRST,...."

        Comment


        • #5
          Check Number of Parameters in CLLE

          How can I check the number of Parms Passed by RPG program to the CL with options(*nopass). I have an RPG with 6 Parms and 2 have option(*nopass). I can easily verify it in another called RPG ( If %Parms > 4) but I dont know how this will be handled in CLLE. The program worked just fine but I need to verify how many parameters are passed into the program so that I can validated the data passed. Thanks, Tiki

          Comment


          • #6
            Check Number of Parameters in CLLE

            Barbara, Perhaps I'm missing something, but the first article is related to external program calls while the second article procedure calls. Both articles appear to me to be correct within their context. The external call should not pick up an errant pointer -- the MCH3601 would work -- due to how *PGM linkages are implemented. A procedure call however could pick up an unintended pointer from the stack -- the MCH3601 test would not be reliable. Bruce

            Comment


            • #7
              Check Number of Parameters in CLLE

              bvining wrote: > > Perhaps I'm missing something, but the first article is related to > external program calls while the second article procedure calls. Both > articles appear to me to be correct within their context. The > external call should not pick up an errant pointer -- the MCH3601 > would work -- due to how *PGM linkages are implemented. A procedure > call however could pick up an unintended pointer from the stack -- > the MCH3601 test would not be reliable. > Oops, I think it was me missing something. I forgot that this thread was about a program call. (I probably got side-tracked by "CL Procedures" in the title of the first article.)

              Comment

              Working...
              X