tposival
New User
Joined: 07 May 2008 Posts: 1 Location: usa
|
|
|
|
Does anyone have a list of COBOL statements that do not allow the use of a data-name reference by a subscript. I want to create a recommendation on how, and where to use subscripted data-names.
Example: valid usage
SELECT OPTIONAL "file-name-1" ASSIGN "assignment-name-1" TO LINE SEQUENTIAL ORGANIZATION IS ACCESS SEQUENTIAL MODE IS " STATUS FILE IS "data-name-1".
Where as the data-name-1 is table-element (table-subscript-1). This look dangerous to code a statement like this, because the subscript must have a valid value before this file can be open or it will generated an run time error.
Does anyone know if the compiler will allow this statement? |
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello tposival and welcome to the forums,
Quote: |
Does anyone know if the compiler will allow this statement? |
Have you tried this? If not, do so and post anything that happens that is not clear.
Quote: |
Does anyone have a list of COBOL statements that do not allow the use of a data-name reference by a subscript. |
The Language Reference for your compiler is the best source for this kind of info.
Quote: |
I want to create a recommendation on how, and where to use subscripted data-names. |
Possibly there is something i misunderstand, but i do not understand how such a recommendation would be created. Anything that occurs multiple times must be so referenced, regardless of any recommendation As i mentioned, there may be something i misunderstand. |
|