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;
...
IF UNSPEC( funcptr ) = ''B THEN
you can write the simpler and clearer
funcptr = NULLENTRY();
...
IF funcptr = NULLENTRY() THEN
But the ability to initialize even static entry variables may be the nicest ability provided by this function. For example, to invoke our XML parser using the PLISAXA function, you would typically have an event structure declared as follows
dcl
1 eventHandler static
,2 e01 type event
init( start_of_dcoument )
,2 e02 type event
init( version_information )
,2 e03 type event
init( encoding_declaration )
,2 e04 type event
init( standalone_declaration )
,2 e05 type event
init( document_type_declaration )
,2 e06 type event_end_of_document
init( end_of_document )
,2 e07 type event
init( start_of_element )
...
,2 e19 type event
init( comment )
,2 e20 type event
init( unknown_attribute_reference )
,2 e21 type event
init( unknown_content_reference )
,2 e22 type event
init( start_of_prefix_mapping )
,2 e23 type event
init( end_of_prefix_mapping )
,2 e24 type event_exception
init( exception )
;
And you must have a procedure corresponding to each of the events in the INIT attributes - even if you were not interested in that event. But, now, if you are not in, say, the comment event you could replace the above
,2 e19 type event
init( comment )
with
,2 e19 type event
init( nullentry() )
and now you would no longer need to define a corresponding procedure - and your XML parsing would be faster, too!
One small word of warning: to use NULLENTRY with PLISAXC or PLISAXD, you must also have a recent library PTF applied as well.

PL/I Cafe
Simplifying your code - part 4 |
Simplifying your code - part 3
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 |
Simplifying your code - part 2 - INLIST optimizations
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. |
Simplifying your code - part 1
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 |
Announcing Enterprise PL/I for z/OS V4.5IBM 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 calculations. Enterprise PL/I for z/OS V4.5 provides significant performance improvements over Enterprise PL/I V4.4. Compute intensive applications running on z13 (compiled with Enterprise PL/I V4.5) have shown CPU time reduction of up to 17% over the same applications running on zEC12 (compiled with Enterprise PL/I V4.4). This significant improvement in performance is achieved through a combination of more powerful z13 hardware and improved compiler optimization. Enterprise PL/I V4.5 also has many new features. It addressed 28 customer requirements. The most significant new feature is providing full, integrated support (i.e. parse, generate, and validate) for JSON, the preferred lightweight data exchange format for mobile applications. Other significant new features include raising the maximum size of strings (from 32K to 128M), generating faster code for CICS calls, allowing structures to be used as SQL indicator variables, supporting named constants as SQL host variables, and new compiler options to improve code quality and analyze runtime problems. Enterprise PL/I for z/OS V4.5 is scheduled to become generally available on February 27, 2015. More information. |
PL/I library pagesAre 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:
Start visiting the following PL/I library pages: |
Enterprise PL/I for z/OS Session at SHARE in AnaheimPeter Elderon from the IBM compiler development team will be presenting on what's new in Enterprise PL/I for z/OS at SHARE in Anaheim, March 9 to 14. Register for SHARE in Anaheim today! |
Get all the details about the latest release of Enterprise PL/I for z/OS V4.4
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. |
New optional argument of ALLOCATE function - AREA reference
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.
The ALLOCATE built-in function now has the AREA reference as a new optional argument. When you specify ALLOCATE(n, x), the specified number of bytes n is allocated within that area. The number is rounded up to a multiple of 8. If there is insufficient space within the specified area, the AREA condition is
For more information, see Built-in functions, pseudovariables, and subroutines. |
Interfaces to Other ProductsThe PL/I workstation compiler supports the following interfaces to other products:
1. Using the sort program For more information, see "Using interfaces to other products". |