fhg
Volume 7, Number 39 -- November 7, 2007

V6R1 CL Enhancements

Published: November 7, 2007

by 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


Sponsored By
HELP/SYSTEMS

Discover Robot/SECURITY, the i5/OS security monitoring
and auditing software, from Help/Systems

                                                            · Profile Exchange
                                                            · Exit Point Monitoring
                                                            · System Authority Auditing
                                                            · QAUDJRN Monitoring
                                                            · System Security Analysis

Robot/SECURITY is the only security software that
combines five critical System i security tools in one package.

Visit our Web site at http://www.helpsystems.com/400g-sec/
to learn more about Robot/SECURITY.


Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

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


 
The Four Hundred
IBM Brags About Its Power6 Server Shipments

Neuwing, IBM to Quantify and Monetize IT Energy Savings

Ask TPM: Enticing Users to Upgrade Their i5/OS Hardware

Project ECLipz Surfaces, But Not the Way You Think

The Linux Beacon
Intel Quietly Releases 'Montvale' Itanium Kickers

Cray Revamps Supercomputers with XT5 Designs

Mandriva in a Tizzy after Microsoft Trumps Linux in Nigeria

Neuwing, IBM to Quantify and Monetize IT Energy Savings

Four Hundred Stuff
XAware Takes the Open Source Plunge

Quadrant Refines PPM Offering with IntelliChief 2.0

ARTech Nearly Done with 'Rocha' Rewrite of GeneXus 4GL

VAULT400 Offers Free Insurance with 'Quick-Ship'

Big Iron
IBM Readies Quad-Core z6 Chip for Mainframe Iron

Top Mainframe Stories From Around the Web

Chats, Webinars, Seminars, Shows, and Other Happenings

System i PTF Guide
November 3, 2007: Volume 9, Number 44

October 27, 2007: Volume 9, Number 43

October 20, 2007: Volume 9, Number 42

October 13, 2007: Volume 9, Number 41

October 6, 2007: Volume 9, Number 40

September 29, 2007: Volume 9, Number 39

The Windows Observer
Microsoft Unveils New 'Oslo' Approach to SOA

Good Times Roll for Microsoft Financially

Microsoft Concedes to EC, Slashes Protocol Pricing

'Viridian' Hypercall APIs to be Open Source, Microsoft Says

The Unix Guardian
SCO to Sell Unix Wares for $36 Million?

Sun Sues NetApp Right Back Over Patents

'Project Indiana' OpenSolaris Preview Debuts

Midrange Shops Get Disaster Recovery Services from IBM

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

THIS ISSUE SPONSORED BY:

Help/Systems
WorksRight Software
Krengeltech


Printer Friendly Version


TABLE OF CONTENTS
V6R1 CL Enhancements

Copy Message Descriptions

Admin Alert: Five Benefits of a High-Availability System

Four Hundred Guru

BACK ISSUES

From the IT Jungle Forums
Reallocate disk space from one LPAR to another

How to retrieve a workstation ID

Finding *OUTFILE Template Files

i5/OS V5R4 Release Notes

MCH1202





 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement