• 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
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    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

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

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