Skip to content

Instantly share code, notes, and snippets.

@blippy
Created October 31, 2016 10:21
Show Gist options
  • Select an option

  • Save blippy/c2cc25f877b9e9f4926fa6c190502b63 to your computer and use it in GitHub Desktop.

Select an option

Save blippy/c2cc25f877b9e9f4926fa6c190502b63 to your computer and use it in GitHub Desktop.
String indexing in COBOL
*> 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