tag:blogger.com,1999:blog-15361070915694048472023-11-15T06:50:02.726-08:00Difference between Subscript and IndexKapshttp://www.blogger.com/profile/12650677106280775953noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-1536107091569404847.post-79221914085025151352008-12-04T23:25:00.000-08:002008-12-05T00:30:34.048-08:00Subscript and IndexWhat is the difference between a subscript and an index?<br /><br />An index is defined with it's associated table using the INDEXED BY phrase. It is a storage area generated by the compiler. It is a register item that exists outside the program's working storage. It is 4 bytes in length. You can’tdisplay an index. The SET statement sets up and down an index,PERFORM VARYING.<br /><br />A subscript is a positive integer defined in working-storage. It's best to defineit as S9(4) COMP. A subscript is changed using ADD, SUBTRACT, MOVE orPERFORM VARYING like any other numeric working storage variable.<br /><p>For more cobol queries, <a href="http://cobol-queries.blogspot.com/">click here</a></p>Kapshttp://www.blogger.com/profile/12650677106280775953noreply@blogger.com0tag:blogger.com,1999:blog-1536107091569404847.post-509227683135095142008-12-04T03:59:00.000-08:002008-12-05T00:29:07.218-08:00Max no. of dimensions in a cobol array ?For Cobol 3 is the max where as for Cobol-II 7 is the max.Kapshttp://www.blogger.com/profile/12650677106280775953noreply@blogger.com0tag:blogger.com,1999:blog-1536107091569404847.post-546419994338186062008-12-04T03:49:00.000-08:002008-12-05T00:29:07.220-08:00What is array bounds checking ?My program has an array defined to have 10 items. Due to a bug , I find that even if he program access the 11<span class="blsp-spelling-error" id="SPELLING_ERROR_0">th</span> item in the array, the program does not <span class="blsp-spelling-error" id="SPELLING_ERROR_1">abend</span>. What’s wrong with it?<br /><br />Must use the compiler option <span class="blsp-spelling-error" id="SPELLING_ERROR_2">SSRANGE</span>, if u want array bounds checking.Default is <span class="blsp-spelling-error" id="SPELLING_ERROR_3">NOSSRANGE</span>.<br /><br />For detailed description of these compiler options. Please refer to the following link <a href="http://cobolperformance.blogspot.com/">COBOL Compiler options</a>Kapshttp://www.blogger.com/profile/12650677106280775953noreply@blogger.com0tag:blogger.com,1999:blog-1536107091569404847.post-80092477957004931392008-12-04T03:48:00.001-08:002008-12-05T00:29:07.220-08:00Can we convert index to subscript and vice versa?Yes, with SET statement. Example: SET INX TO SUB.Kapshttp://www.blogger.com/profile/12650677106280775953noreply@blogger.com0tag:blogger.com,1999:blog-1536107091569404847.post-65716897650669203442008-12-04T03:38:00.000-08:002008-12-05T00:29:07.221-08:00How can we change the value of index?Verbs used to updated value of an index.<br /><br />SET INX TO VALUE<br />SET INX UP/DOWN BY VALUE<br />PERFORM/VARYING.Kapshttp://www.blogger.com/profile/12650677106280775953noreply@blogger.com0tag:blogger.com,1999:blog-1536107091569404847.post-71313486840341815302008-12-03T03:55:00.000-08:002008-12-05T00:34:09.588-08:00How can we pass a table in cobol linkage section ?If you were passing a table via linkage, which is preferable - a subscript or an index?<br /><br />Bingo!!!- you haven't been paying attention! It's not possible to pass an index via linkage. The index is not part of the calling programs working storage( index is a register) . Those of us who've made this mistake, appreciate the lesson more than others.Kapshttp://www.blogger.com/profile/12650677106280775953noreply@blogger.com0