Programming / CL


The CL Corner: More Character-String Enhancements for CL PDF Print E-mail
Programming - CL
Written by Bruce Vining   
Friday, 01 March 2013 00:00

Let's look at the new %CHECK, %CHECKR, and %SCAN built-ins of CL.

bruce viningWritten by Bruce Vining

In last month's article, "How Would You Like That Character String Trimmed?," we reviewed the new CL built-ins %TRIM, %TRIML, and %TRIMR. This month, we'll look at three more CL built-ins that IBM has provided by way of 7.1 PTF SI49061. The new built-ins, which are supported with both the OPM and ILE compilers, are %CHECK, %CHECKR, and %SCAN.

Last Updated on Friday, 01 March 2013 00:00
Read more...
 
User Rating: / 1
PoorBest 
The CL Corner: How Would You Like That Character String Trimmed? PDF Print E-mail
Programming - CL
Written by Bruce Vining   
Friday, 25 January 2013 00:00

Let's look at the new %TRIM, %TRIML, and %TRIMR built-ins of CL.

bruce viningWritten by Bruce Vining

Over the past year, IBM has continued to enhance CL in order to make our lives, as developers, easier. In the previous article, "New Support for CL Commands Lets You Know When a Command Ends," we saw how a PTF enables the system to call a program of your choosing when a given CL command completes processing. Likewise, in an earlier series of articles, starting with "Introducing the New Run SQL Command," we saw how, with a PTF, you can now run SQL statements directly out of your CL programs.

Last Updated on Friday, 25 January 2013 00:00
Read more...
 
Practical CL: The 32-Character Solution PDF Print E-mail
Programming - CL
Written by Joe Pluta   
Wednesday, 07 November 2012 00:00

Since the System/38, we've had to deal with the implied 32-byte length of character parameters on the command line; this article provides the workarounds.

joe plutaWritten by Joe Pluta

It doesn't matter where I'm working, how skilled the staff is, whether it's new development or mature legacy systems, it never fails that every couple of years I come across the old (and I do mean old) 32-character limitations on character parameters passed from the command line. It's a simple issue, really, but one that still manages to confound us. It may be the greatest example in our community of how those who cannot learn from history (or steal from those who have!) are doomed to repeat it.

Last Updated on Wednesday, 07 November 2012 00:00
Read more...
 
User Rating: / 5
PoorBest 
The CL Corner: A CL Command to Scan for a String of Characters PDF Print E-mail
Programming - CL
Written by Bruce Vining   
Friday, 26 October 2012 00:00

Find a character pattern within a variable.

bruce viningWritten by Bruce Vining

Last month, in "A CL Command to Scan for Characters," we built the command Scan Characters (SCNCHR). The SCNCHR command returns the position of the first character within a CL variable that is found in a list of search-for values. This month, we'll look at how to provide a Scan String (SCNSTR) command.

Last Updated on Friday, 26 October 2012 00:00
Read more...
 
The CL Corner: A CL Command to Scan for Characters PDF Print E-mail
Programming - CL
Written by Bruce Vining   
Friday, 05 October 2012 00:00

Find characters within a variable.

bruce viningWritten by Bruce Vining

Last month, in "A CL-Based Implementation of RPG Built-in %Check," we built the command Check Characters (CHKCHR). The CHKCHR command returns the position of the first character within a CL variable that is not found within a list of valid values. Based on reader requests, this month we'll look at how to implement a Scan Characters (SCNCHR) command. The SCNCHR command will return the position of the first character within a CL variable that is found in a list of valid values.

Last Updated on Monday, 22 October 2012 13:02
Read more...
 
The CL Corner: A CL-Based Implementation of RPG Built-in %Check PDF Print E-mail
Programming - CL
Written by Bruce Vining   
Friday, 31 August 2012 00:00

Find characters that don't belong!

bruce viningWritten by Bruce Vining

I recently received the following from Wayne R.: "I use RPG's %CHECK function to check if any characters are not valid. Is there something similar in CL?" RPG's %Check built-in, if you're not familiar with it, returns the first position in a variable that contains a character that is not in a list of valid characters. If, for instance, you had a variable with a value of 'cabbage', then comparing this to a list of valid values such as 'abc' would return a position value of 6. This is due to the sixth character (the "g") not being in the list of valid values ('abc'). If all characters in the variable are found in the valid character list, %Check returns a position value of 0. While CL currently does not have a built-in such as RPG's %Check, you will see it's not that difficult to create a CL command to provide this function for programming our IBM i—and in fact that's what we'll do in today's article.

Last Updated on Tuesday, 28 August 2012 12:27
Read more...
 
User Rating: / 1
PoorBest 
The CL Corner: Using Multiple Files with the RUNSQL CL Command PDF Print E-mail
Programming - CL
Written by Bruce Vining   
Friday, 27 July 2012 00:00

Take advantage of being able to join files with SQL.

bruce viningWritten by Bruce Vining

Last month, in "Run-Time Selection Using the RUNSQL CL Command," we saw how to build an SQL statement on the fly, selecting specific records/rows from the file/table SAMPLE. In this article, we'll look at how to combine information across files using the RUNSQL CL command. But before combining information, we first need to define that information, which will be accessed external to the file SAMPLE.

Last Updated on Friday, 27 July 2012 16:52
Read more...
 
The CL Corner: Run-Time Selection Using the RUNSQL CL Command PDF Print E-mail
Programming - CL
Written by Bruce Vining   
Friday, 29 June 2012 00:00

Build the RUNSQL SQL statement on the fly.

bruce viningWritten by Bruce Vining

Last month, in "More on the RUNSQL CL Command," we saw how to select specific records from the SAMPLE database using the RUNSQL command. In that article, we hardcoded the selection criteria of Effective date (EffDate) being earlier than May 1, 2012. This month, we'll look at how to allow a user to interactively specify the Class, Status, and EffDate year values that the user is interested in. This will include the ability for the user to also ignore (that is, not select on) any one or more of these three fields/columns.

Last Updated on Friday, 29 June 2012 00:00
Read more...
 
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>

Page 1 of 24

WHITE PAPERS

The following White Papers can be found at the MC White Paper Center

 

 


   MC-STORE.COM