Midrange News for the IBM i Community


Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Chicagoland
New CL Features are Helpful
has no ratings.
Published: 05 Apr 2012
Revised: 10 Sep 2013 - 3853 days ago
Last viewed on: 28 Mar 2024 (6168 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

New CL Features are Helpful Published by: Bob Cozzi on 05 Apr 2012 view comments(7)

Yesterday for the first time, my client had all of its systems on v5r4 or later so I tried the "New CL Enhancements" for the first time. The DOFOR, DOWHILE were used along with *INT data-types, *DEFINED and the ITERATE command.

This made processing lists of data passed to the CL program from its Command Definition much, much easier.

While I basically responded with a "we could have used these 20 years ago" when I was asked how I liked them, it wasn't really until a critical mass of end-user shops were actually on v5r4 or later that any update to any language is really put to test. So... now I like them.

The bad news is that IBM broke the CL Command Prompter in v5r4 and later (We'll, at least on v7r1 its broke I still checking which pieces were broke at an earlier release.)

Bug 1: When you prompt, and use the & to extend the prompted parameter's input field, the prompter used to extend the parameter input length. Today it simply ends the prompter.

Bug 2: When you prompt inside of CDO (Command Definition Object) source, and specify the SPCVAL or SNGVAL (special or single values) keywords, the prompter inserts an *N into the 2nd component instead of "nothing". Meaning that your CDO source now looks like this:

  PARM KWD(LIBNAME) TYPE(*NAME) MIN(1) EXPR(*YES) SPCVAL(*LIBL *N) (*CURLIB *N))

Instead of how it should look, which is like this:

  PARM KWD(LIBNAME) TYPE(*NAME) MIN(1) EXPR(*YES) SPCVAL(*LIBL) (*CURLIB))

Now when I'm writing CL or creating Commands, I have to release my aggravation by insulting IBM, after all these years. Sad. Cool

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: neilrh
Premium member *
Jackson, MI
Comment on: New CL Features are Helpful
Posted: 11 years 11 months 23 days 17 hours 26 minutes ago

How about the next new thing to V7R1... RUNSQL?!

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: New CL Features are Helpful
Posted: 11 years 11 months 23 days 17 hours 6 minutes ago
Edited: Tue, 10 Sep, 2013 at 19:53:32 (3853 days ago)

I don't see RUNSQL on my system except for the version I wrote back in 1989 which still works to this day.

 

[edit] But you did give me an idea of another command to include the COZTOOLS. I can dig out and update my old RUNSQL command and get it working on v7r1 (the old RPGIII version still works just like it did 23 years ago).

[update] Oh my! The things I had to do before RPG IV with VARYING fields or CL with *DEFINED variables!

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: New CL Features are Helpful
Posted: 11 years 11 months 23 days 15 hours 41 minutes ago

RUNSQL is a soon to be released PTF update.

Posted by: BrianR
Premium member *
Green Bay, WI
Comment on: New CL Features are Helpful
Posted: 11 years 11 months 23 days 14 hours 46 minutes ago

Using the & to extend a parameter input length works for me (7.1) as long as I key a space after it if the parameter is already filled in with something else.

I'm seeing the same behavior from the prompter (filling in default values from list parameters where one of the list values was entered) from every command, not just the comand definition commands.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: New CL Features are Helpful
Posted: 11 years 11 months 23 days 10 hours 45 minutes ago

Neil,

Can you post a link to that announcement (RUNSQL in PTF v7.1)? Thanks.

Posted by: DaleB
Premium member *
Reading, PA
Comment on: New CL Features are Helpful
Posted: 11 years 11 months 22 days 17 hours 3 minutes ago

I guess a RUNSQL command could be useful, but we already have ways to run SQL from CL, so this is more of a convenience than anything. For starters, QSH 'db2 xxx' comes to mind. (Who doesn't have QShell installed nowadays?) On the other hand, real, monitorable, error messages would be a plus.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: New CL Features are Helpful
Posted: 11 years 11 months 22 days 16 hours 4 minutes ago

I read the article. The "new" RUNSQL command looks like little more than what I published 24 years ago--in fact it looks like it might be a bit more difficult to use for the SELECT statement. Everything else can be EASILY mapped to a user-written CL Command using the EXECUTE IMMEDIATE. Not sure why IBM is soliciting sympathy about "working long hours" to provide a RUNSQL command. I did it in 2 weeks time back in 1988/89 using nothing more than RPGIII and CL; and I'm not a $200 Billion company.