Topic
11 replies Latest Post - ‏2012-11-13T13:33:02Z by PWConner
SystemAdmin
SystemAdmin
225 Posts
ACCEPTED ANSWER

Pinned topic Viewing Available RPGLE Procedures/Functions From Within Rational

‏2012-11-12T10:05:37Z |
I've always wanted to gain easy access to a list of procedures/functions that we have exported from our service program objects from within Rational, but until recently I couldn't think of a decent way of doing it - until recently that is.

I now use templates in Rational to achieve this, and I blogged about it here:

http://www.littlebluemonkey.com/rational-developer-access-service-program-procedures-using-templates/
Updated on 2012-11-13T13:33:02Z at 2012-11-13T13:33:02Z by PWConner
  • Bob Genis
    Bob Genis
    18 Posts
    ACCEPTED ANSWER

    Re: Viewing Available RPGLE Procedures/Functions From Within Rational

    ‏2012-11-12T15:12:19Z  in response to SystemAdmin
    Blue Monkey,

    I'm not sure I understand the need. If the Outline view is refreshed, the Content Assist (<cntrl><space>) will read the prototypes in any /copy members and provide access to the procedures/functions, their return value (type) and parameters (size & type--no label). The list is dynamically filtered as you type and you can select the procedure from the list which will add the full name to your code and format ':' for parameters.

    Is there something I'm missing that the templates provide?
    • PWConner
      PWConner
      53 Posts
      ACCEPTED ANSWER

      Re: Viewing Available RPGLE Procedures/Functions From Within Rational

      ‏2012-11-12T15:44:35Z  in response to Bob Genis
      Bob,

      I'm using RDP 8.0.3. When I try content assist with the outline view refreshed the only procedures listed are those in the current source. I'm using /include instead of /copy, also. Is my issue the version or the /include or something else?
      • Bob Genis
        Bob Genis
        18 Posts
        ACCEPTED ANSWER

        Re: Viewing Available RPGLE Procedures/Functions From Within Rational

        ‏2012-11-12T19:13:22Z  in response to PWConner
        In this case, /copy and /include should work the same. I have a mix with /include's nested in /copy's etc. I don't have access to 8.03--I went straight from 7.6 to 8.5. But it worked the same way in both of those versions. (The only difference is that 8.5 automatically refreshes the Outline view.)

        Some things to look for:
        1) Are your procedures listed under the "Prototypes" node of the outline view?
        2) Is your library list defined in order to resolve the /copy members?
        3) Can you right click on the /copy or /include line and receive "/COPY Member; Edit/Browse" menu?

        My only suspicion is that RDP cannot find the /copy source in the Library list. Do compiles work or do you use a specialized compile command that would set/alter the library list outside of RDP?

        Just kicking through the bushes now hoping something comes out... ;-)
        • PWConner
          PWConner
          53 Posts
          ACCEPTED ANSWER

          Re: Viewing Available RPGLE Procedures/Functions From Within Rational

          ‏2012-11-12T21:09:52Z  in response to Bob Genis
          1) No
          2) Yes
          3) Yes

          I am using compiler directives. I wonder if that is causing a problem. Here is a snippet of code around the /include:

          
          d  cdKe4                         6a   
          
          const d  cdKe5                         6a   
          
          const /
          
          if defined(prototype_only) /eof /endIf /define prototype_only /include ct5114 /undefine prototype_only 
          // Command Execution                                                                           dqCmd             pr                  extPgm(
          'QCMDEXC') d command                     2000A   
          
          const options(*VarSize) d cmdLen                        15P 5 
          
          const
          
          • Bob Genis
            Bob Genis
            18 Posts
            ACCEPTED ANSWER

            Re: Viewing Available RPGLE Procedures/Functions From Within Rational

            ‏2012-11-13T02:49:05Z  in response to PWConner
            PW,

            I don't think the precompiler directives are the problem. I have the exact same setup in my /copy members.

            I'll take one more stab. Go to Window;Preferences and clear your cache. Then open your source and refresh the Outline. It is about the cheesiest technique (akin to rebooting) but it has solved problems like this in the past for me.
            • PWConner
              PWConner
              53 Posts
              ACCEPTED ANSWER

              Re: Viewing Available RPGLE Procedures/Functions From Within Rational

              ‏2012-11-13T13:33:02Z  in response to Bob Genis
              Bob,

              I cleared the cache and the same results occurred. My colleague has 8.5. He performed the same test and it worked as you expected. Maybe it's time I upgraded.
    • SystemAdmin
      SystemAdmin
      225 Posts
      ACCEPTED ANSWER

      Re: Viewing Available RPGLE Procedures/Functions From Within Rational

      ‏2012-11-12T19:42:11Z  in response to Bob Genis
      A good point, and one that I wasn't aware of - I should have posted my intentions earlier!

      The outline view is certainly helpful, especially if you don't already have easy access to all your service program exports, but it does have a couple of drawbacks for me:

      1. We have over 100 source members and I don't always know which one includes in the procedure that I want, so I would still have to go back to my 5250 search to find it.

      2. I'm fairly obsessive about streamlining and doing things in the quickest possible way, and for me adding a /copy statement, hitting refresh on the outline view, waiting a few seconds for it to refresh, and then typing the start of the procedure name is not optimal.

      However, for most people, the built in functionality may well be good enough.
      • Bob Genis
        Bob Genis
        18 Posts
        ACCEPTED ANSWER

        Re: Viewing Available RPGLE Procedures/Functions From Within Rational

        ‏2012-11-13T02:45:20Z  in response to SystemAdmin
        Blue Monkey,

        Just a side note. We also have around 100 source members/service programs that make up our API but all of them are /included in a "master include" that is named for the binding directory. I have one BNDDIR statement and one /include that gives me access to the entire suite of procedures. There's only one refresh (actually, in 8.5 the refresh is automatic) and I have them. I let the system do the searching for me and only the referenced service programs are bound to my program.
        • SystemAdmin
          SystemAdmin
          225 Posts
          ACCEPTED ANSWER

          Re: Viewing Available RPGLE Procedures/Functions From Within Rational

          ‏2012-11-13T03:36:29Z  in response to Bob Genis
          Thanks Bob,

          We also use a single binding directory, but not the single /copy or /include.

          We were suffering some performance problems when activation groups were being closed, and we were worried about the static storage generated by data structures and prototypes in our /copy members might be the cause.

          We did go through an exercise of changing the majority of our reference data structures to be based on a single pointer (See below), so that may be enough for us to look at a single /include statement in future - I'll check it out.

          /if not defined(PRREF)
          d PRREF e ds extname(PRREF) prefix(ref_)
          d based(ptr_ref)
          /define PRREF
          /endif
          • Bob Genis
            Bob Genis
            18 Posts
            ACCEPTED ANSWER

            Re: Viewing Available RPGLE Procedures/Functions From Within Rational

            ‏2012-11-13T13:21:14Z  in response to SystemAdmin
            Blue Monkey,

            If you're on V6R1 or better, you might want to check out this article. Specifically the sections on the TEMPLATE keyword for Data Structure definitions as well as the *NOUNREF Compile option.
            • Bob Genis
              Bob Genis
              18 Posts
              ACCEPTED ANSWER

              Re: Viewing Available RPGLE Procedures/Functions From Within Rational

              ‏2012-11-13T13:22:06Z  in response to Bob Genis
              Nuts! Forgot the link...
              http://www.mcpressonline.com/programming/rpg/v6r1-rpg-enhancements.html