Cobol

SSRANGE vs NOSSRANGE compiler option

SSRANGE: Arrays in COBOL are known as tables. An array is a linear data structure and is a collection of individual data items of the same type. Data items of a table are internally sorted. Let’s say we have an array of 100 occurrences and program tried to access 101 occurrences of the array then program will give a subscript out of range error unless compiler option SSRANGE is specified.

If you specify the SSRANGE compiler option, the VS COBOL II compiler generates additional code that makes certain a table subscript or index does not address an area outside the boundaries of the associated table. This compiler option also generates code to ensure that OCCURS DEPENDING ON values, which are set dynamically by VS COBOL II source code statements, do not go beyond the maximum boundaries initially defined for the associated variable-length table.

To invoke this option, you need to code the parameter COPT=SSRANGE on the compile step of your job. If you have compiled your program with the SSRANGE compiler option, subscript range checking will occur during program execution for all tables as they are referenced. If an “out of bounds” condition occurs, a diagnostic message is generated, and the program is abnormally terminated. Subscript range checking occurs when a program is being executed because most table elements are referenced using computed subscripts or indexes rather than numeric literals. The default VS COBOL II compiler option is NOSSRANGE.

If your program is compiled with the SSRANGE option, you have the option to cancel the checking performed at execution time. This is accomplished by specifying the NOSSRANGE execution time option as follows:

//RUN EXEC PGM=MYPROG,PARM='/NOSSRANGE'

You can tell NOSSRANGE is a run-time option rather than a compiler option because of the slash. It is recommended that you use the SSRANGE compiler option when you are testing programs. However, because script range checking involves the execution of additional code, your program executes a little slower than it might. Therefore, when programs are ready to be handed over for production running, they should have the default compiler option of NOSSRANGE.

COBOL Blog: Click Here IBM Reference:Click Here

Admin

Share
Published by
Admin

Recent Posts

Increase Transparency and Collaboration Product Backlog

A well-maintained product backlog is crucial for successful product development. It serves as a single…

2 months ago

Product Backlog – Incremental value to the customer

Incremental value to the customer refers to the gradual delivery of small, functional parts of…

2 months ago

Product Market, Customer’s Desire, Need, and Challenges

A Product Market refers to the group of potential customers who might be interested in…

2 months ago

PAL-EBM Professional Agile Leadership – EBM Certification

The Professional Agile Leadership - Evidence-Based Management (PAL-EBM) certification offered by Scrum.org is designed for…

5 months ago

PAL I Professional Agile Leadership Certification

The Professional Agile Leadership (PAL I) certification, offered by Scrum.org, is designed to equip leaders…

5 months ago

Scrum Master Certification: CSM, PSM, SSM

Choosing the right Scrum Master Certification depends on your current experience and career goals. If…

7 months ago