We don't have actual strings in COBOL. Fields are just as long as they are defined as.
However, if you want to "break something", we have a verb called UNSTRING:
UNSTRING CONSTPARM INTO xxxx DELIMITED BY ALL SPACE
yyyy DELIMITED BY ALL SPACE
zzzz DELIMITED BY ALL SPACE
lackofforethought DELIMITED BY ALL SPACE
etc
You have to name the fields you want to receive the data.
If using the same UNSTRING
more than once, before doing the UNSTRING
set all the target fields to initial values. Otherwise can get data "left over" from the previous use of that UNSTRING
.
For a full explanation, consult your manual. Enterprise COBOL Language Reference. UNSTRING
is very powerful, and has lots of options.
To put a field together (or to wrap a Christmas present) use STRING
.