• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • V6R1 CL Enhancements

    November 7, 2007 Ted Holt

    Thanks to the kindness of Guy Vig and Fernando Hurtado of the International Business Machines Corporation, I have information for you concerning V6R1 CL. For the third straight release, IBM has added solid features to the compiler. Since I use CL heavily, I greatly appreciate the effort. Here’s what you can look forward to when you install V6R1.

    Close a File

    CL includes a new Close Database File (CLOSE) command that you can use to close a file. This gives you another way to process a file more than once in a CL procedure. As you are no doubt aware, the first Receive File (RCVF) command issued against a file opens that file and retrieves the first record. Each subsequent RCVF command retrieves another record, and when there are no more records to retrieve, RCVF issues escape message CPF0864. If you CLOSE a file, RCVF re-opens the file and begins the process anew. CLOSE has only one parameter, OPNID, which indicates the file to be closed.

    Here’s an example that I shamelessly swiped from the documentation Guy and Fernando gave me.

    DCLF   FILE(*LIBL/MYFILE2)  OPNID(FILE2)
      :
    RCVF   OPNID(FILE2)
      :
    CLOSE   OPNID(FILE2)
    RCVF   OPNID(FILE2)
      :
    

    Copy Source Code from Other Members

    I like this enhancement, too. I use a lot of template code in my programming, and the new Include CL Source (INCLUDE) command is going to help me immensely. It’s similar in function to RPG’s /COPY and /INCLUDE directives, COBOL’s COPY command, and C’s #INCLUDE preprocessor directive. To make the compiler a source member, fill in the SRCMBR and SRCFILE parameters.

    This command copies member SUBR1, which is in source physical file COMMONSUBR in library MYLIB.

    INCLUDE   SRCMBR(SUBR1)  SRCFILE(MYLIB/COMMONSUBR)
    

    This command copies source member DCLSET1, which is in the file specified in the INCFILE parameter of the CRTCLPGM, CRTCLMOD, or CRTBNDCL command that kicked off the compilation.

    INCLUDE   SRCMBR(DCLSET1)  SRCFILE(*INCFILE)
    

    The Retrieve CL Source command has a new RTVINCSRC parameter, which gives you the choice of retrieving the INCLUDE commands or the included code in the retrieved source code.

    Store Compiler Options

    I do not like having to change compiler options when creating CL procedures and commands. When I get to V6R1, I won’t have to. For commands, the CMD command has been enhanced to permit object-creation parameters one normally finds in the Create Command (CRTCMD) command.

    CMD   PROMPT(UCD0002)  PMTFILE(MYCMDPMT *DYNAMIC)  +
          MSGF(MYCMDMSG)  TEXT(*CMDPMT)  MAXPOS(2)  +
          PRDLIB(MYAPPLIB)  HLPID(*CMD)  HLPPNLGRP(MYAPPHLP)
    

    In CL procedures, you can use the Declare Processing Options (DCLPRCOPT) command to specify compiler options. The new BNDDIR and BNDSRVPGM parameters allow you to bind to modules and service programs when compiling with CRTBNDCL. You’ll no longer have to create a module from the CL source, then use Create Program (CRTPGM) to tie everything together.

    DCLPRCOPT    DFTACTGRP(*NO)  ACTGRP(MYAPP)  +
                 BNDDIR(MYAPPLIB/MYBNDDIR)
    

    Null Support

    CL’s new *NULL special value will come in handy when working with pointers. Use the *NULL value to set a pointer or to test a pointer.

    DCL   VAR(&STRPTR) TYPE(*PTR) VALUE(*NULL)
    
    IF COND(&STRPTR *EQ *NULL) THEN(DO)
    

    The Verify Name API

    The new Verify Name API comes in two flavors: QCAVFYNM and QCAVERIFYNAME. (I suspect QCAVFYNM is a callable program, while QCAVERIFYNAME is a procedure in service program QCAVFYNMS.) It allows you to test a character string to see if the string represents a valid object name. If the name is not valid, the API sends escape message CPF019D.

    Better National Language Support

    When V6R1 becomes reality, command objects will be able to retrieve prompt messages dynamically. A command object will be able to display prompts in different national languages though the use of the Prompt File (PMTFILE) parameter of the Create Command (CRTCMD) command. PTMFILE allows you to specify a message file from which the prompt strings are to be retrieved. PMTFILE(*NONE) means that the prompt text is in the definition statements, as always.

    CMD   PROMPT(UCD0002)  PMTFILE(MYCMDPMT *DYNAMIC)  +
          MSGF(MYCMDMSG)  TEXT(*CMDPMT)  MAXPOS(2)  +
          PRDLIB(MYAPPLIB)  HLPID(*CMD)  HLPPNLGRP(MYAPPHLP)
    

    When the command is prompted, the system will retrieve the prompt text from message ID UCD002 in message file MYCMDPMT, which is found by scanning the library list. By placing the value *DYNAMIC, instead of the default *STATIC, in PMTFILE’s second element, you can use one command object with different national languages.

    According to the documentation Guy and Fernando sent me, you can also specify this parameter in the CMD command within the command source.

    Better Unicode Support

    PARM, ELEM, and QUAL command definition commands have a new CCSID parameter, which permits special value *UTF16 for Unicode values. In addition, the TOSTMF parameter of the Copy to Stream File (CPYTOSTMF) command has been Unicode-enabled.

    It Just Gets Better and Better!

    Well, that’s a quick look at the new features in V6R1 CL. IBM did not give me everything on my wish list, but they gave me some of my wishes, and added some good features that hadn’t occurred to me. I’m most thankful for these new enhancements to this important language.

    RELATED STORY

    Proper CL Error-Handling



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Midrange Dynamics North America

    Git up to speed with MDChange!

    Git can be lightning-fast when dealing with just a few hundred items in a repository. But when dealing with tens of thousands of items, transaction wait times can take minutes.

    MDChange offers an elegant solution that enables you to work efficiently any size Git repository while making your Git experience seamless and highly responsive.

    Learn more.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Bug Busters Software Engineering:  High availability software that won't break the bank
    COMMON:  Join us at the annual 2008 conference, March 30 - April 3, in Nashville, Tennessee
    Maximum Availability:  The ultimate System i replication for business of all sizes

    IT Jungle Store Top Book Picks

    The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
    The System i Pocket RPG & RPG IV Guide: List Price, $69.95
    The iSeries Pocket Database Guide: List Price, $59.00
    The iSeries Pocket Developers' Guide: List Price, $59.00
    The iSeries Pocket SQL Guide: List Price, $59.00
    The iSeries Pocket Query Guide: List Price, $49.00
    The iSeries Pocket WebFacing Primer: List Price, $39.00
    Migrating to WebSphere Express for iSeries: List Price, $49.00
    iSeries Express Web Implementer's Guide: List Price, $59.00
    Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
    Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
    Getting Started with WebSphere Express for iSeries: List Price, $49.00
    WebFacing Application Design and Development Guide: List Price, $55.00
    Can the AS/400 Survive IBM?: List Price, $49.00
    The All-Everything Machine: List Price, $29.95
    Chip Wars: List Price, $29.95

    InfoPrint Solutions Expands Globally BCD’s WebSmart PHP Goes GA

    Leave a Reply Cancel reply

Volume 7, Number 39 -- November 7, 2007
THIS ISSUE SPONSORED BY:

Help/Systems
WorksRight Software
Krengeltech

Table of Contents

  • V6R1 CL Enhancements
  • Copy Message Descriptions
  • Admin Alert: Five Benefits of a High-Availability System

Content archive

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

Recent Posts

  • Public Preview For Watson Code Assistant for i Available Soon
  • COMMON Youth Movement Continues at POWERUp 2025
  • IBM Preserves Memory Investments Across Power10 And Power11
  • Eradani Uses AI For New EDI And API Service
  • Picking Apart IBM’s $150 Billion In US Manufacturing And R&D
  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20

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 © 2025 IT Jungle