13
Wed, Nov
5 New Articles

V7R1 CL: Something for Everyone

CL
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

The newest version of CL offers enhancements in recovery, productivity, capacity, and serviceability.

 

With all of the wonderful enhancements to Control Language (CL) in V5R3 (multiple files, DOxxx loops, SELECT, etc.), V5R4 (subroutines, structures, pointers, etc.), and V6R1 (CLOSE, INCLUDE, DCLPRCOPT enhancements, etc.), you may have wondered what IBM would deliver for CL in the IBM i 7.1 release. Well, it turns out that 7.1 certainly does have some great new features for the CL developer.

Better Recovery and Productivity

Most of us had all but given up hope, but Retrieve CL Source (RTVCLSRC) for ILE is here! If you're unfamiliar with RTVCLSRC, it's a command that can be used to retrieve the CL source statements that were used in compiling a program—a wonderful time-saver for companies when the source for a program cannot be readily found (or when you suspect the program version isn't what it should be). Both the Create CL Module (CRTCLMOD) and Create Bound CL Program (CRTBNDCL) commands now support the Allow RTVCLSRC (ALWRTVSRC) keyword to indicate that the source for the program should be saved with the program. The Retrieve CL Source (RTVCLSRC) command now supports the new keywords SRVPGM and MODULE to specify the name and library of the service program or module from which the source will be retrieved (a new keyword wasn't necessary for programs as RTVCLSRC already had the PGM keyword for OPM CL programs). For completeness, even the Declare Processing Options (DCLPRCOPT) command has been updated to reflect that the ALWRTVSRC keyword now applies to ILE programs as well as original program model (OPM) CL programs. Historically, one of the key inhibitors for CL developers moving from OPM CL to Integrated Language Environment (ILE) CL has been the reluctance to give up the capability to retrieve or recover the source statements used to create a CL program. CL developers now have virtually no reason not to move to an ILE-based application environment.

 

In addition to adding RTVCLSRC support for ILE CL, V7R1 also provides improved source code sharing across modules, programs, and service programs. In V6R1, IBM provided the new Include CL Source (INCLUDE) command, which can be used to copy source from one source file member into the source program being compiled. The source being included (or copied) can be declarative commands, such as Declare (DCL) or Declare File (DCLF), or processing logic, such as shared subroutines (introduced with V5R4), common error-handling logic, etc. One limitation, however, exists with V6R1 INCLUDE support. The limitation is that the source member being included could not, itself, have INCLUDE commands imbedded within it. With V7R1, this limitation has been removed. You can now have a virtually unlimited number of nested INCLUDE commands within your CL source, providing for much greater sharing of common declarations and processing logic.

 

While we're on the topic of programmer productivity, a new OPTION value has also been added to the various CRT* commands for ILE and OPM CL. This new value, *DOSLTLVL for the Do/Select nesting-level option, indicates that two new columns of the CL compiler listing are to be produced, showing the nesting level for various control flow commands. One column indicates the level of loop-oriented commands, such as DOFOR, DOUNTIL, and DOWHILE, while the other column indicates SELECT-level processing. With the nasty habit of editors such as SEU to align all prompted commands to the same column, having nesting levels clearly identified in the compile listing certainly speeds up the process of finding the start and end of logical command groupings, a task I (and I'm sure you) frequently perform when looking at a CL source listing.

Higher Capacity

IBM has also enhanced the ability to declare integer variables within a CL program. Back in V5R3, the CL DCL command added support for 2-byte and 4-byte signed and unsigned integer variables (removing the need in many cases to use the %bin CL built-in). The 4-byte signed integer values could range from -2147483648 to 2147483647, and unsigned integers from 0 to 4294967295. While these are large numbers, they are not large enough for some applications. One specific type of application, where larger numeric value support is needed, is in the area of systems management.

 

Many systems are tuned throughout the day using CL commands, and this results in quite a few of the systems management applications being written, at least in part, using CL. The problem is that many of the system APIs that return system-level information, information that a systems management application needs access to in order to effectively manage a system, have evolved to using 8-byte integer values in order to reflect the high workloads that IBM i is capable of supporting. Compared to 4-byte integer values, 8-byte signed integers can store a value ranging from -9223372036854775808 to 9223372036854775807, and 8-byte unsigned integers a range from 0 to 18446744073709551615. With V7R1, CL developers who need access to these expanded ranges can simply DCL the appropriate variables as TYPE(*INT) or TYPE(*UINT) with LEN(8).

 

There are two considerations related to 8-byte integer support, neither of which I consider to be very limiting. The first is that 8-byte integers can be declared only within an ILE CL program. So if you're still writing for the OPM environment, my only comment is that it's time to move into the 21st century! The second consideration is that while the DCL command supports 8-byte signed and unsigned integers, the Parameter definition (PARM) and Element definition (ELEM) commands used in creating user commands do not. I have never encountered a need to supply a numeric value, to a command, even approaching the size of a 4-byte integer, and I really don't know that I would even want a user trying to supply such a number, at a command prompt, in any case. So I do not see this as being a problem. And I'm sure IBM could remove this limitation if it were to become a problem, just as they did for DCL and the need for CL programs to access system API information efficiently.

More Serviceability

What if you're not a CL developer? For users who administer or manage a system running CL programs, there is also good news in V7R1 for you. In addition to adding the ALWRTVSRC keyword to the CRTBNDCL and CRTCLMOD commands, these commands (along with the equivalent commands for RPG, COBOL, C, and C++) also added the Debug encryption key (DBGENCKEY) keyword. This support allows an ILE module or program to be created with the listing-level debugging view encrypted. For a company that develops CL programs strictly for their own use, this new capability may not be of much interest or value. But for companies that develop software products that run on IBM i for use by other companies, and, most importantly from your point of view, for the companies that install their software, this ability to encrypt debug data can lead to improved software serviceability.

 

Many companies that produce software products treat their source code as a valuable asset to be protected (so don't expect too many of these companies to provide their CL programs compiled with ALWRTVSRC(*YES)). This asset-protection view also means that historically no source-level or listing-level debug views were provided with the software that their users installed. Not having these debug views available can, as most CL developers who have ever tried to debug a problem with and without interactive debug can confirm, lead to longer problem determination times. The ability to encrypt the debug views, ship these encrypted views with the product software, and then, when necessary, decrypt the views on the customer system using the system-provided debuggers, can have a significant impact on the ability for software providers to more quickly determine the cause of a problem and provide a fix for the problem. This in turn leads to more timely correction of software problems for you—what I would consider a definite win-win situation for both software providers and the users of their software.

A Broad Range

The V7R1 CL enhancements touch many areas of your system. The ones touched on in this article include the following:

  • Support for RTVCLSRC, providing improved source recovery
  • Improved INCLUDE command support, enabling greater sharing of common code
  • Access to a wider range of numeric values for CL variables
  • Encrypted debug views, enabling improved software serviceability for third-party applications

These improvements can have a positive impact on your use of CL, whether you are a developer of CL programs or a user of CL-based application programs. With CL, life just keeps getting better.

 

My thanks to Guy Vig for providing these CL enhancements in 7.1. Guy is widely known, inside and outside of IBM, as "Mr. CL" and has been the driving force behind all of the CL enhancements we've seen in V5R3 through V7R1.  

 

Bruce Vining

Bruce Vining is president and co-founder of Bruce Vining Services, LLC, a firm providing contract programming and consulting services to the System i community. He began his career in 1979 as an IBM Systems Engineer in St. Louis, Missouri, and then transferred to Rochester, Minnesota, in 1985, where he continues to reside. From 1992 until leaving IBM in 2007, Bruce was a member of the System Design Control Group responsible for OS/400 and i5/OS areas such as System APIs, Globalization, and Software Serviceability. He is also the designer of Control Language for Files (CLF).A frequent speaker and writer, Bruce can be reached at This email address is being protected from spambots. You need JavaScript enabled to view it.. 


MC Press books written by Bruce Vining available now on the MC Press Bookstore.

IBM System i APIs at Work IBM System i APIs at Work
Leverage the power of APIs with this definitive resource.
List Price $89.95

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: