Created
October 31, 2016 10:21
-
-
Save blippy/c2cc25f877b9e9f4926fa6c190502b63 to your computer and use it in GitHub Desktop.
String indexing in COBOL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| *> vim: syntax=off | |
| identification division. | |
| program-id. dex. | |
| data division. | |
| working-storage section. | |
| *> 01 my-string occurs 7 times pic x. | |
| 01 my-string pic x(7). | |
| procedure division. | |
| move "hello" to my-string | |
| display my-string(3:2) *> = offset[1-based]:number of chars | |
| *> output is therefore: ll | |
| stop run | |
| . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment