Home
PCRE for z/OS
PCRE2 plans
POSIX & COBOL
Downloads
About C and Patches
Important Points
History
Contact
  
 


News: 9/11/2017 - PCRE2 10.30 is now available for z/OS only. 

pcregrep is now fully functional and treats PDS and PDSE libraries as directories and fully recognizes HFS and ZFS files.
Posix compatibility is now fully supported.
FREEMAIN and GETMAIN functions are now supported.

On November 14, 2012 I published, at long last, PCRE for z/OS.  This is a port of PCRE to the classic Mainframe environment with EBCDIC as the character set, JCL as the batch language, Rexx as the analogous language to Perl and above all COBOL and PL/I as the mainstay, LE application languages.  In doing so, I removed the C modules away from their native environment and ported them to a foreign and strange envioronment where character strings do not terminate with a null and lines do not terminate with newline, where the standard input and output are managed by //SYSIN DD and //SYSOUT DD and not by stdin and stdout and where the command line in batch is limitted both by length and content by the limitation of the PARM= parameter in the // EXEC statement.

I had not thought about all those, and other limitations when I started the port.  My goal was simple, to introduce regular expressions to COBOL.  I achived that goal and one may now call the PCRE functions from within COBOL on the mainframe and process regular expressions.  Alas, a lot of work is still to be done, some that was planned and some that I have not anticipated but it has to be done nevertheless.

The most important tasks are outside of the technical world of implementing and testing more and more features and to the fullest extent.  The main tasks are actually:

1. To advertise the existence of this port so people may try it and

2. To overcome the cultural issue of the traditional conservatism of Mainframe application developers and get them to understand, learn and use regular expressions

Beyond that, here are points describing the existing supported features and  the anticipated technical roadmap for developing this port.  Currently the port is based on PCRE2 10.30.  The old PCRE1 is available on version 8.39 and is not maintained any farther.

1. While a few people have expressed interest in the PL/I interface and some tried to give me useful advice, I've found that with my limited time and resources, I cannot do it.  Hence, Native PL/I support is officially dropped and will not be renewed unless there would be a volunteer who is both capable in working with PL/I and its interfaces, and is ready to devote time for this project.  PL/I, being an LE language could call the library using the provided API, though.

2. Rexx seemed to me to be a perfect fit for PCRE.  There is a basic Rexx API provided by John Gateley and we are working on improving that API.

3. A basic test suit is available.

4. The C++ library of PCRE is not maintained since Google dropped that sub-project, and thus C++ is not supported in z/OS as well. (apparently the big boys face similar issues to what I face :).

5. Compiling and testing under most important EBCDIC codepages (in no particular order: IBM1047 - most common in the United States, IBM1026 - Turkish, IBM1140 – old code page 037, IBM1148 - CP500, IBM285 – UK, IBM424 - Hebrew, IBM875 - Greek) - I really need voluteers from the respective countries to do that.

6. At a certain point I should complete, stabilize and publish the port process and scripts is still a work in progress.

I wish to thank few individuals who helped me a lot in this effort.  First and foremost, my wife Susan who had to put up with me all those long nights.  Philip Hazel who kept his cool when I annoyed him with basic questions and sheer carelessness on my side.  It is his brain child that I've taken to this adventure.  Sam Golob of CBT-tape fame who helped me with advice on the z/OS side.  John Gateley who worked diligently on the Rexx API.  I also wish to thank the anonymous contributor to PCRE who developed the EBCDIC support and made my exercise possible.