IBM Support

New support for XMLPARSE and VLR compiler option In COBOL V5.1

News


Abstract

The XMLPARSE(COMPAT|XMLSS) and VLR(COMPAT|STANDARD) compiler options are now available in COBOL V5.1 with the PTFs for APAR PI22094 (UI21043, UI21044, and UI21045), with a targeted availability date of October 1st, 2014.

Content

Programs with XML PARSE statements that were compiled with the XMLPARSE(COMPAT) compiler option with the Enterprise COBOL V4 compiler, or were compiled with the Enterprise COBOL V3 compiler, had to be changed to compile and run with COBOL V5.1 since the XMLPARSE compiler option, specifically, XMLPARSE(COMPAT), was not available in COBOL V5.1.

In addition, programs that had READ statements for variable-length records could get FS=00 under Enterprise COBOL V4, but get FS=04 under COBOL V5.1 which could cause programs to get incorrect results. A new compiler option VLR(COMPAT|STANDARD) was added to help solve the problem.



If you would like to take advantage of XMLPARSE(COMPAT|XMLSS) and VLR(COMPAT|STANDARD) compiler options in COBOL V5.1, you should apply the ptfs for APAR PI22094 (UI21043, UI21044, and UI21045).

The following documentation about these new compiler options will be added to the manuals in a future release of Enterprise COBOL V5:

+--------------------------------------------------------------+
| Start of changes for:                                        |
| Enterprise COBOL Language Reference, SC14-7381-01            |
                                                               
  The description of the XML PARSE statement will be changed    
  to match the COBOL V4.2 manual.  To find this information    
  now, please refer to the XML PARSE statement information      
  in the Enterprise COBOL Language Reference for Version 4      
  Release 2:  SC23-8528-01.                                    
                                                               
| End of changes for:                                          |
| Enterprise COBOL Language Reference, SC14-7381-01            |
+--------------------------------------------------------------+
                                                               
+--------------------------------------------------------------+
| Start of changes for:                                        |
| Enterprise COBOL Programming Guide, SC14-7382-01             |
                                                               
 Chapter 17: Compiler Options                                  
                                                               
Add the description of the new VLR compiler option to        
Chapter 17 as follows:                                        
                                                               
  VLR compiler option                                          
                                                               
    VLR(COMPAT|STANDARD)                                        
                                                               
    Default: VLR(STANDARD)                                      
    Abbreviation: VLR(C|S)                                      
                                                               
  This option affects Variable-Length Read statements in         
  the following 'wrong-length read' cases:                  
                                                           
  The COBOL 85 standard specifies the following rules as    
  part of the processing of READ statements:                
  If the number of character positions in the record that  
  is read is less than the minimum size specified by the    
  record description entries for the file, the portion of  
  the record area which is to the right of the last valid  
  character read is undefined.                              
  If the number of character positions in the record that  
  is read is greater than the maximum size specified by the
  record description entries for file-name-1, the record is
  truncated on the right to the maximum size. In either of  
  these cases, the READ statement is successful and an I-O  
  status value of 04 is set indicating that a record length
  conflict has occurred..                                  
                                                           
                                                           
  VLR(STANDARD)                                            
  Programs will get the status value of 04 when READ        
  statements encounter a record length conflict, or        
  'wrong length read'.  If your program performs a          
  wrong length read as described above and your code        
  checks for File Status = 0 after READ of variable-length  
  record files, your code will take the 'Not zero' path.    
  You can change your code to test for FS=0, while FS=4    
  and other values will all be a failed READ. For FS=4      
  you may want to add code to avoid the bad data in        
  variables or protection exceptions mentioned above.      
                                                           
                                                           
  VLR(COMPAT)                                              
  Programs will get the status value of 00 when READ        
  statements encounter a record length conflict, or        
  'wrong length read'.  If your program performs a          
  wrong length read as described above and your code        
  checks for File Status = 0 after READ of variable-length  
  record files, your code will take the 'zero' path,        
  just as it did in previous versions of IBM COBOL          
  (Enterprise COBOL V4 and V3 and earlier).                

                                                               
Add the description of the restored XMLPARSE compiler        
option to Chapter 17 as follows:                              
                                                               
 XMLPARSE compiler option                                      
                                                               
  Add the description of the XMLPARSE compiler option from      
  the Enterprise COBOL V4 Programming Guide.  For immediate    
  use, please use the COBOL V4 Programming Guide:              
  SC23-8529-01.                                                
                                                               
  Briefly, the syntax is as follows:                            
                                                               
  XMLPARSE(COMPAT|XMLSS)                                        
                                                               
    Default: XMLPARSE(XMLSS)                                    
    Abbreviation: None                                          
                                                               
 Chapter 28: Processing XML Input                              
                                                               
  Add the description of the XML PARSE statement from          
  the Enterprise COBOL V4 Programming Guide.  For immediate    
  use, please use the COBOL V4 Programming Guide:              
  SC23-8529-01.                                                
                                                               
| End of changes for:                                          |
| Enterprise COBOL Programming Guide, SC14-7382-01             |
+--------------------------------------------------------------+
                                                               
                                                               
+--------------------------------------------------------------+
| Start of changes for:                                        |
| Enterprise COBOL for z/OS Migration Guide, GC23-8527-01      |
                                                               
  The compiler option XMLPARSE was restored.  Both the XMLSS    
  and COMPAT parsers are once again available.                  
                                                               
  Global changes:                                              
   There are many places in the Migration Guide that mention    
   lack of XMLPARSE compiler option and lack of the old        
   XML PARSER in COBOL V5, and these all have to be changed.    
 
  Some of these places are:                                  
   Preface: Changes in compilers and Migration Guide editions
   Chapter 1: Discussion of programs that must be upgraded    
   Chapter 11. Upgrading programs from Enterprise COBOL      
               Version 3                                      
   Chapter 13. Upgrading from Enterprise COBOL Version 4      
                                                             
  In Chapter 11 and 13 we talk about how to change programs  
  that used XML PARSE to use the new parser.  This information
  is under the heading                                        
     "Migrating from the old XML parser to the new XML parser"
  This information will be moved to a new appendix, since it  
  is no longer needed for moving from one compiler to another,
  but it is good information for customers who might want to  
  move from the old parser to the XMLSS parser.              
                                                             
  Finally, there are some differences in the old parser      
  (XMLPARSE(COMPAT)) support in COBOL V5 compared to COBOL V4
  and COBOL V3, and they should be added to the chapters on  
  moving XML PARSE programs from COBOL V3 (Chapter 11) or from
  V4 (Chapter 13) to COBOL V5:                                
                                                             
  The XMLPARSE(COMPAT) parser implementation is different from
  that of versions 3 and 4. The change will not affect most  
  existing programs. However, there are some unusual cases    
  where the differences can be apparent:                      
                                                             
  1. User modifications to the XML document during execution  
     of the XML PARSE statement.                              
                                                             
     In versions prior to V5, the COMPAT XML parser was      
     actively in progress when the XML processing procedure  
     was executing. In V5, any encoding conflicts are        
     resolved, after which the entire document is parsed,    
     storing the XML events in a buffer. After the parse is  
     terminated, the XML events are then presented from this  
     buffer to the user's program by PERFORMing the processing
     procedure. Thus, if the program modifies the XML document
     in the processing procedure code, the parser does not see
     these modifications. In the prior implementation, such  
     modification, for example correcting an end tag name to  
     match the start tag name, would be seen and acted on by  
     the parser.                                              
                                                             
  2. A limited number of continuable XML EXCEPTION events.    
                                                             
     For XML EXCEPTION events with XML-CODE values in the    
     range 1-49 for which the user requests continuation by  
     setting XML-CODE to zero, the COMPAT XML parser only    
     checks for further errors and does not present any      
     further non-EXCEPTION XML events. When continuing after  
     an EXCEPTION event, the V5 COMPAT XML parser does not    
     expand the XML event buffer, and thus might not present  
     all the EXCEPTION events that would otherwise occur. The
     initial buffer size can accommodate a minimum of 8192 XML
     events, and is expanded as necessary for non-EXCEPTION  
     events.                                                  
                                                             
  3. Differences caused by LE condition handling.            
                                                             
     In versions prior to V5, the processing procedure was    
     executed in a stack frame subordinate to the stack frame
     of the active XML parser. The processing procedure for  
     the V5 COMPAT parser runs in the same stack frame as the
     rest of the COBOL program, after the XML parser has run  
     to completion. This change has the following effects:    
                                                             
     - Previously, LE condition handlers registered in the XML
       processing procedure were not in effect after a COMPAT
       XML PARSE statement terminated. In the V5              
       implementation, they remain in effect until            
       un-registered.                                        
                                                             
     - Previously, branching to an LE services resume point  
       set outside the XML processing procedure terminated a  
       COMPAT XML PARSE statement. In V5, the processing      
       procedure must exit normally to terminate an XML PARSE
       statement. Otherwise the already active XML PARSE      
       statement causes a runtime error if either the program
       exits (IGZ0227S) or another XML PARSE statement is    
       executed (IGZ0228S).                                      

                                                               
| End of changes for:                                          |
| Enterprise COBOL for z/OS Migration Guide, GC23-8527-01      |
+--------------------------------------------------------------+
                                                               
+--------------------------------------------------------------+
| Start of changes for:                                        |
| Enterprise COBOL for z/OS Customization Guide, SC14-7380-01  |
                                                               
  Chapter 2:  Enterprise COBOL compiler options                
                                                               
   Add the VLR and XMLPARSE compiler options.                  
                                                               
   The XMLPARSE description should be just like in COBOL V4    
   Customization Guide, briefly:                                
                                                               
                          +--XMLSS---+                          
                          |          |                          
   >>--XMLPARSE=--+---+---+--COMPAT--+------->>                
                  |   |                                        
                  +-*-+                                        
                                                               
   Default                                                      
     XMLPARSE=XMLSS                                            
                                                               
                                                               
                                                               
   The VLR option:                                              
                      +-STANDARD-+                              
                      |          |                              
   >>---VLR=--+---+---+--COMPAT--+------->>                    
              |   |                                            
              +-*-+                                            
                                                               
   Default                                                      
     VLR=STANDARD                                              
                                                               
   Abbreviations:                                              
     VLR=C|S                                                    
                                                               
| End of changes for:                                          |
| Enterprise COBOL for z/OS Customization Guide, SC14-7380-01  |
+--------------------------------------------------------------+ 

[{"Product":{"code":"SS6SG3","label":"Enterprise COBOL for z\/OS"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Documentation","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"5.1","Edition":"","Line of Business":{"code":"LOB17","label":"Mainframe TPS"}}]

Document Information

Modified date:
08 August 2018

UID

swg21686067