Topic
6 replies Latest Post - ‏2013-05-20T16:40:34Z by gunner3200
gunner3200
gunner3200
57 Posts
ACCEPTED ANSWER

Pinned topic RDz 8.5.1 COBOL Source Formatting

‏2013-05-17T17:37:38Z |

I have just recently loaded a copy of RDz 8.5.1 onto my machine, upgrading from 7.6.2.1.

In looking through documentation of new features I see that there is a "Source Formatting" feature for COBOL.  I'd like to try it out but when I'm in a COBOL program and hightlight code, right click>>>source  I don't see any option to do Source Formatting.

What am I missing in my setup of RDz?

Updated on 2013-05-17T17:41:10Z at 2013-05-17T17:41:10Z by gunner3200
  • walexand
    walexand
    133 Posts
    ACCEPTED ANSWER

    Re: RDz 8.5.1 COBOL Source Formatting

    ‏2013-05-17T19:22:13Z  in response to gunner3200

    Source Formatting is supported in the COBOL editor.   Close out of the System z LPEX editor, then select the program and right click and choose Open With > COBOL editor.  Then highlight some code, right click and you should be able to choose Source > Format.

    There are Preferences associated with this function as well. You can find them under Window > Preferences > COBOL > Editor > Formatter.

    Updated on 2013-05-17T19:23:51Z at 2013-05-17T19:23:51Z by walexand
    • gunner3200
      gunner3200
      57 Posts
      ACCEPTED ANSWER

      Re: RDz 8.5.1 COBOL Source Formatting

      ‏2013-05-17T20:35:32Z  in response to walexand

      Thanks, that was it.  Now if I could get it to actually do something.  I open a COBOL program up, highlight a section of code, right click>>>source>>>formatter click...  Nothing changes.

      • walexand
        walexand
        133 Posts
        ACCEPTED ANSWER

        Re: RDz 8.5.1 COBOL Source Formatting

        ‏2013-05-17T20:43:44Z  in response to gunner3200

        Interesting.  try this...

        On the Preference page I referred to previously make sure that the "Enable indentation of procedure divisions" checkbox is selected.

        Find a multi-line IF ELSE END-IF statement and modify all the lines so they start in column12.   Then select all the lines in the statement and run Source > Format.   Your IF statement should now be beautified!

        • gunner3200
          gunner3200
          57 Posts
          ACCEPTED ANSWER

          Re: RDz 8.5.1 COBOL Source Formatting

          ‏2013-05-17T21:00:32Z  in response to walexand

          Sorry, but the "Enable indentation of procedure divisions" is the default and was checked.  I double checked and tried again.  Focusing just on an IF statment and it's associated lines.  Nothing is changing.   I even changed several lines to make sure things weren't lined up nicely.

          Weird.

          Attachments

          Updated on 2013-05-17T21:06:55Z at 2013-05-17T21:06:55Z by gunner3200
          • TFQC_Jeremy_Flicker
            TFQC_Jeremy_Flicker
            13 Posts
            ACCEPTED ANSWER

            Re: RDz 8.5.1 COBOL Source Formatting

            ‏2013-05-20T14:43:03Z  in response to gunner3200

            Many of the editor actions depend on the ability to parse the source code successfully.  If you look at the blue toolbox icon at the bottom of the IDE in your screenshot, you will see a red x overlain on top of it.  This signifies that the parser failed to parse the source code and thus some of the "tooling" will not be available.  To correct this issue, we will need to inspect the parse warnings displayed in the editor.  I see at least two of them are present from examining your screenshot.  

            • gunner3200
              gunner3200
              57 Posts
              ACCEPTED ANSWER

              Re: RDz 8.5.1 COBOL Source Formatting

              ‏2013-05-20T16:40:34Z  in response to TFQC_Jeremy_Flicker

              That was it.  The program I was trying this with had 2 syntax errors, not realy errors but the COBOL editor flagged them as such, but when I commented out the 2 lines I was able to use the Formatter.

              Sorry to say but I really don't like the idea of having a seperate "COBOL" editor from the LPEX editor.  The version of RAD built for the iSeries, WDSCi back then, had much better COBOL support built into it over 6 years ago when I was working on that system.  Why IBM thinks there needs to be seperate COBOL editors in the same basic tool set across platforms is bad enough but having more then one in the same platform is very strange to me.

              It doesn't make sense to me that you're adding a new editor instead of building this functionality into the LPEX editor.  In the small amount of time I tried to just use this particular feature I noticed several things that were markedly different between the COBOL editor and working on COBOL in the LPEX editor.  Simple odd things, like pressing the enter key to add a new line worked differently, having to put actual spaces in a new line before the arrow keys would allow you to move to the right.  The fact that the COBOL Editor doesn't take on the "Apperance settings" of the LPEX editor.  Not having an "ISPF" mode like the LPEX editor.

              I'll continue to play around with the COBOL editor but I'm not impressed so far.  Things shouldn't be this hard to use and adding another level of oddity to RDz isn't going to help new users learn the product nor invite others to start using the tool in my opinion.

              Thank you for your help though.