• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • How Do You Do That with RDi? Part 2: Compile

    December 13, 2016 Susan Gantner

    In an earlier tip, I began a series on how I do things using RDi that some people seem to prefer doing in PDM. In that first tip, I talked about various ways to copy a source member. In this tip, I’ll talk about compiling with RDi.

    I must confess to being baffled by the number of people I talk to who, while they do all their editing in RDi, always go back to PDM to do their compiles. To me, if you don’t compile your code with RDi, you’re missing out on a huge time-saver: the ability to do away with perusing compile listings to find the errors. Perhaps those who prefer to do their compiles in PDM just don’t make as many errors as I do! With the Error List view in RDi, I simply double click on any error in the list to be positioned to the relevant line of code in the editor. That saves me a ton of time.

    Let’s start with the basics. Typically, I’m compiling a program that I’ve just made changes to so it’s in the editor tab in the foreground. From there, I typically use the Compile pull-down menu, at least on the first iteration of a compile for a program. (More in a moment about what I do for later compiles.) From there, I choose either Compile or Compile (Prompt), depending on whether I need to modify any default compile parameters.

    It’s easy to hit a snag right off the bat when doing that because sometimes the compile options are greyed-out. This is usually because the editor view doesn’t have focus. Perhaps I had been working with the Error List or the Outline views so the focus is now on one of those views. So a simple click back into the editor view (or using the F12 shortcut key) brings the editor back into focus so the compile options are made available. I then select the appropriate compile command from this list and wait for my errors to appear in the Error List. Of course, I’m really hoping all the time to see an empty error list, but if I don’t, I simply double click on each error in the list and fix the problems before my next compile attempt.

    Once I have made the changes, then on my second (and subsequent) compile attempts I usually use the Ctrl+Shift+C keyboard shortcut since it’s faster than using the menu option. The reason I typically start with the menu option is because the shortcut will repeat the same type of compile command you chose for the last time that type of member. For example, the first time around for an RPGLE source member, I use the menu so that I can be certain of choosing the correct type of compile command; i.e., CRTBNDRPG or CRTRPGMOD or perhaps some special compile command that I’ve created. (More on this later.) On the subsequent compiles, I know it’s OK to simply repeat the last type of compile command until I get a clean compile. If you rarely use different compile types for your source members, you may decide to forego even doing the first compile from the menu and just use the shortcut all the time.

    A small aside here for a moment about using the Error List view. I mentioned above that I’m hoping for an empty error list. Some of you may have been thinking that the error list will never really be empty because of all the level-00 informational messages that appear there. I never see those messages because I have filtered them out of my Error List view. To do that, look for the “View Menu” icon near the top right corner of your Error List view. (It’s typically the rightmost of the icons there–along with the X and XX to remove the lists–and looks like a tiny inverted pyramid). From the View Menu options, choose “Show Severity” and then de-select the “Information” messages. From now on, you will not see any 00-level messages in your Error List view for any type of compile you do. It’s a much more satisfying feeling to see an empty error list than one where you need to look at the Severity to see if you need to do any more work.

    One other thing that I like to do with my compile commands in RDi is to customize them. There are two basic ways that I do this. I start by customizing the standard compile commands that come with RDi to set the parameters to the values I prefer. In addition, I sometimes find it useful to create my own special customized compile commands.

    Some of the parameter customization that I typically do for my RPG compiles includes setting Debug View to *ALL (instead of *Source, which RDi sets by default) and Output(*None). It took me quite a while to wake up to the fact that since I was never going to look at all those compile listings again (I use Error List instead), why should I even create them in the first place? That light bulb finally went on one day as I was doing some mass deletions of old compile listings! As a happy side effect, it seems to me that the compiles run a tad faster as well without the requirement to produce the listing output.

    To customize the defaults for the standard compile commands, use the “Work With Compile Commands. . .” option from the Compile menu. In the dialog box that pops up, select the CRTBNDRPG and/or CRTRPGMOD command, use the Prompt button and check the “All Parameters” box. Then change the parameters as you see fit–such as for Debugging view and Output and click OK to save those parameter defaults.

    For some clients, I also need to specify other special parameters for things such as Target Release and the library where the program object should be created. For those situations, I could prompt my compiles to change those but that seems too slow. So when I need some different default parameters for a specific client or application, I create a special version of the compile command with those parameters set appropriately.

    This begins the same as above with the “Work With Compile Commands. . .” option from the Compile menu. In the dialog box that pops up, I highlight “New command” to create a new one, add a label/name to describe my special command. Then I add the compile command (e.g., CRTBNDRPG) and press the Prompt. . . button. See in the screen shot below an example of the dialog box for creating a custom version of the CRTBNDRPG command. In the prompt for the command, I check the “All Parameters” box and the fill in the parameters that I need for this version of the command, such as the appropriate target release and/or hard-coding the library for the compiled program but also remembering to specify Output(*None) and Debug view (*All) as I do with my own versions of the standard commands.

    From now on, the Compile menus will show my custom versions of the compile commands for any RPGLE source member type I’m editing – and RDi will also remember that custom compile command for subsequent compiles using the shortcut Ctrl+Shift+C.

    I’ve often been asked how to see the completion messages following a compile. I do this from the Commands Log view (located in the same area where Error List is). Just page to the bottom of that view to see the completion messages for your compiles. This works well to confirm what command was actually submitted and whether or not the compile was successful.

    As always, it can be a bit challenging to find errors that occur in the binding step, because the Commands log may only have the completion messages–not the complete job description with messages such as “Definition not found for symbol. . .” or “Binding Directory xxx not found.”

    The best way to alleviate such challenges is to do your compiles in your RDi host server job rather than submitting them to a separate batch job (which is the default RDi behavior.) When the compile happens in your host server job, those kinds of messages will appear in the Commands log along with the completion messages.

    To switch the “Compile in batch” behavior, use the Preferences option (under the Window menu), key “Command” into the filter search box near the top left panel of the Preferences dialog. From the filtered list, choose “Command Execution” under Remote Systems → IBM i and then de-select the box for “Compile in batch.”

    I’m hoping this tip may have helped to convert some of you who may still be compiling in PDM to be able to take advantage of RDi compiles and the valuable Error List that goes with them.

    Sometimes I hear from people who have more complex requirements for compiling that these tips don’t address. For example, what if you need to do an override before the compile? What if you need to use a completely different compile command from CRTBNDRPG or CRTRPGMOD because of some pre-compile steps or something like that? There are ways to accomplish most of those things in RDi as well. So I will take a look at dealing with more complex compile scenarios in my next tip.

    Susan Gantner is half of Partner400, a consulting company focused on education on modern programming and database techniques and tools on the IBM i platform. She is also a founding partner in System i Developer, a consortium of System i educators and hosts of the RPG & DB2 Summit conferences. Susan was a programmer for corporations in Atlanta, Georgia, before joining IBM. During her IBM career, she worked in both the Rochester and Toronto labs, providing technical support and education for application developers. Susan left IBM in 1999 to devote more time to teaching and consulting. Together with Jon Paris, she now runs Partner400, and appears regularly at many technical conferences, including System i Developer’s RPG & DB2 Summit. Send your questions or comments for Susan to Ted Holt via the IT Jungle Contact page.

    RELATED STORY

    How Do You Do That With RDi? Part 1: Copy A Source Member

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    UCG Technologies

    CYBER-ATTACKS ON THE RISE. PROTECT WITH THE TRIPLE PLAY.

    COVID-19 has not only caused a global pandemic, but has sparked a “cyber pandemic” as well.

    “Cybersecurity experts predict that in 2021, there will be a cyber-attack incident every 11 seconds. This is nearly twice what it was in 2019 (every 19 seconds), and four times the rate five years ago (every 40 seconds in 2016). It is expected that cybercrime will cost the global economy $6.1 trillion annually, making it the third-largest economy in the world, right behind those of the United States and China.”1

    Protecting an organization’s data is not a single-faceted approach, and companies need to do everything they can to both proactively prevent an attempted attack and reactively respond to a successful attack.

    UCG Technologies’ VAULT400 subscription defends IBM i and Intel systems against cyber-attacks through comprehensive protection with the Triple Play Protection – Cloud Backup, DRaaS, & Enterprise Cybersecurity Training.

    Cyber-attacks become more sophisticated every day. The dramatic rise of the remote workforce has accelerated this trend as cyber criminals aggressively target company employees with online social engineering attacks. It is crucial that employees have proper training on what NOT to click on. Cyber threats and social engineering are constantly evolving and UCG’s Enterprise Cybersecurity Training (powered by KnowBe4) is designed to educate employees on the current cutting-edge cyber-attacks and how to reduce and eliminate them.

    A company is only as strong as its weakest link and prevention is just part of the story. Organizations need to have a quick response and actionable plan to implement should their data become compromised. This is the role of cloud backup and disaster-recovery-as-a-service (DRaaS).

    Data is a company’s most valuable asset. UCG’s VAULT400 Cloud Backup provides 256-bit encrypted backups to two (2) remote locations for safe retrieval should a cyber-attack occur. This is a necessary component of any protection strategy. Whether a single click on a malicious link brings down the Windows environment or an infected SQL server feeds the IBM i, once the data is compromised, there is no going back unless you have your data readily available.

    Recovery is not a trivial task, especially when you factor in the time sensitive nature of restoring from an active attack. This leads to the third play of the Triple Play Protection – DRaaS.  Companies have myriad concerns once an attack is realized and a managed service disaster recovery allows employees to keep focus on running the business in a crisis state.

    The combination of training employees with secure backup and disaster recovery offers companies the best chance at avoiding financial disruption in an age of stronger, more frequent cyber-attacks.

    Reach out to UCG Technologies to discuss your company’s security needs and develop a data protection plan that fits you best.

    ucgtechnologies.com/triple-play

     800.211.8798 | info@ucgtechnologies.com

     

    1. https://theconversation.com/cyberattacks-are-on-the-rise-amid-work-from-home-how-to-protect-your-business-151268

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Profound Logic Software:  NOW ON DEMAND! Webinar: Agile Modernization with Node.js. Fresche:  IBM i staffing for all of your IT needs. Request a FREE estimate. 1-800-361-6782 System i Developer:  RPG & DB2 Summit - March 21-23, 2017 in Orlando. Register now!

    IT Spending And Staffing Show The Effects Of Managed Services The IBM i Year In Review

    Leave a Reply Cancel reply

Volume 16, Number 27 -- December 13, 2016
THIS ISSUE SPONSORED BY:

WorksRight Software
T.L. Ashford
UCG Technologies

Table of Contents

  • RPG And The BLOB
  • How Do You Do That with RDi? Part 2: Compile

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Why Open Source Is Critical for Digital Transformation
  • mrc Refreshes IBM i Low-Code Dev Tool
  • Unit Testing Automation Hits Shift Left Instead of Ctrl-Alt-Delete Cash
  • Four Hundred Monitor, March 3
  • IBM i PTF Guide, Volume 23, Number 9
  • Doing The Texas Two Step From Power9 To Power10
  • PHP’s Legacy Problem
  • Guru: For IBM i Newcomers, An Access Client Solutions Primer
  • IBM i 7.1 Extended Out To 2024 And Up To The IBM Cloud
  • Some Practical Advice On That HMC-Power9 Impedance Mismatch

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2021 IT Jungle

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.