Welcome to the IBM Rational PL/I community. Here you will find the latest technical and business information, and educational information about PL/I and related z/OS and AIX topics including IMS, CICS, and Rational Developer for System z.
When you use INLIST rather than a long list of comparisons OR'ed together, your code is easier to read and understand, but it is also easier for the compiler to understand and hence to optimize. For example, for an invocation of INLIST such as inlist( x, 2, 3, 5, 7, 11, 13, 17, 19 ) if x is a FIXED BIN(31) variable, the compiler will generate a branch table to determine the result. And in general, if x is FIXED BIN(p,0) with p <= 31 or FIXED DEC(p,0) with p <= 9, if all the values to test are similarly nice constants,... [More]
The new INLIST built-in function has made it easy for you to simplify code that tests if a expression is in one of a list of values. But sometimes you may want to test if an expression is in a range of values, as in IF BIRTHYEAR >= 1980 & BIRTHYEAR <= 1999 THEN The new BETWEEN built-in function makes it easy for you to simplify such code. This function returns a bit(1) value indicating if the value of an expression is within the... [More]
There are many times when you may want to test if a value is equal (or not equal) to one of a set of values. You can do this easily with a SELECT statement or an IF statement as in the following code IF (EXPLAN.ACCESSTYPE = 'I ' | EXPLAN.ACCESSTYPE = 'N ' |... [More]
While the ASSERT statement discussed in the previous post is relatively new to PL/I (since it was introduced only with the 4.3 release), there is another, much older statement than can be used in a similar fashion: the SELECT statement. In particular, if you code a SELECT statement without an OTHERWISE clause, if none of the WHEN clauses are true, then the ERROR condition will be raised with an ONCODE and error message indicating that no WHEN clause in the SELECT is true. For example, if you code... [More]
This will be the second half of the break from writing about checking program correctness and writing instead about some new things we made available recently via PTFs. Thing 1: SQL allows the use of a null data: a date with a year, month, and day all equal to 1. PL/I now supports this via a new compiler option: Under the new NULLDATE compiler option, the VALIDDATE and REPATTERN built-in functions will accept the SQL null date as a valid date. For compatibility, NONULLDATE is the default. To use this null date in... [More]
I want to take a break from writing about checking program correctness and to write instead about some new things we made available recently via PTFs. Thing 1: we have added a new built-in function to provide an "unhex" capability. It is modeled after the base64decode8 etc. built-in functions, and in the Language Reference Manual, it would be described as HEXDECODE decodes a source buffer from hex into a target buffer. It returns a FIXED BIN(31) value that indicates the number of bytes that are written into the target buffer.... [More]
There is another new built-in function that also makes it easy to simplify your code: NULLENTRY. Previously to assign a null value to an entry variable, you had to use the UNSPEC pseudovariable, and to test if an entry variable was null, you had to use the UNSPEC built-in function. Moreover, you had no nice way to use INIT with an ENTRY variable. But now instead of writing UNSPEC( funcptr ) = ''B;... [More]
IBM has been quietly delivering a new release of the PL/I compiler every year since 1999 on System z. The recent announcement of Enterprise PL/I for z/OS continues to show IBM’s commitment to delivering a world class PL/I compiler on System z. Enterprise PL/I for z/OS V4.5 is enhanced to fully exploit the new z13 architecture. It uses the new Vector Facility to improve the performance of the code generated for the verify and search built-in functions and expands the use of the Decimal Floating Point Facility for fixed decimal... [More]
The PL/I workstation compiler supports the following interfaces to other products: 1. Using the sort program The compiler provides an interface called PLISRTx (x = A, B, C, or D) that allows you to make use of the IBM-supplied Sort programs. To use the Sort program you must include the correct PL/I statements in your source program and specify the correct data sets in your JCL. 2. Interlanguage Communication between PL/I and C The Interlanguage Communication (ILC) between PL/I and C is supported. You can write PL/I code that either calls or is... [More]
Pl/I 4.5 added a new option to help you check the correctness of your code when it runs, and I will describe it in a future blog. But first I would like to write about some existing features (some new and some quite old) that can help you check the correctness of your code (and, yes, compile times checks of your code are even better, and I will also talk about them in a future blog). One of the newest features that can help you check the correctness of your code (and simultaneously document the code as well) is the ASSERT statement. We... [More]
Check out all the information about the latest release of Enterprise PL/I for z/OS. You can get a summary of the release as well as all the announcement details. See what's new with Enterprise PL/I for z/OS, V4.4 including enhancements to leverage the latest z/OS. For all the details about the Enterprise PL/I for z/OS, V4.4 announcement, see here .
ALLOCATE is a storage control built-in function, which allocates storage of the specified size in the heap. You can also use ALLOCATE to allocate the specified size in the specified area. When you specify ALLOCATE (n) , ALLOCATE allocates storage of size n in heap storage and returns the pointer to the allocated storage. If necessary, n is converted to REAL FIXED BINARY (31,0) . If the requested amount of storage is not available, the STORAGE condition is raised. The ALLOCATE built-in function now has the AREA reference as a new... [More]
Are you looking for PL/I documentation across different releases? Do you want to access PL/I documentation of both the HTML and PDF format? The PL/I library pages now provide the following types of PL/I documentation in one central location: Announcement letters PDF documentation HTML documentation URL Start visiting the following PL/I library pages: Enterprise PL/I documentation library PL/I for AIX documentation library PL/I for MVS & VM PL/I for VSE
In PL/I conversions, BINARY rules over DECIMAL, and FLOAT, over FIXED.
This means, for example, that when an expression contains a BINARY and a DECIMAL operand, then
the result will be BINARY.
Hence, for the assignment in this code
dcl a fixed bin;
dcl b float dec;
b = b + a ;
there will be these conversions
a will be converted to FLOAT BIN
b will be converted to FLOAT BIN
the sum will be converted to FLOAT DEC
PL/I has always had a series of built-in functions (BINARY, DECIMAL, FIXED, and FLOAT) to help
control such... [More]
If you use the TEST option and DebugTool, Enterprise PL/I will show you the source as you coded it.
So, for example, if you have code that contains an EXEC SQL statement, you will see in the
debugger just that EXEC SQL statement as you coded it and not the many, many statements generated by the
preprocessor and visible in the listing. This is a big plus since those generated
statements will be largely meaningless to you and would certainly not be ones
you should be debugging and fixing.
The same would be true if you were using the CICS... [More]