Personally I use the Scan for String Pattern (QCLSCAN) API which is much more useful than the INSPECT stm.
STRING <== The field to be scanned
STRLEN <== The length of the string to be scanned
STRPOS <== Starting position
PATTERN <== Value to scan
PATLEN <== Length of character(s) to scan
TRANSLATE <== No translation to upper char required
TRIM <== Blank characters trimmed
WILD <== No wildcard character
RESULT <== A value returned to your program
Call “QCLSCAN” Using STRING, STRLEN, …, RESULT.
If RESULT > 0 ==> PATTERN found and the result is the position of
the first character of the pattern in the string..
To create data item DEPTH with the same attributes as data item HEIGHT, you
DEPTH <b>LIKE</b> HEIGHT
To create data item PROVINCE with the same attributes as data item STATE,
except one byte longer, you write:
PROVINCE <b>LIKE</b> STATE (+1)
I am unaware of a LIKE command in COBOL. COBOL has a MOVE statement, an ADD statement, a WRITE statement, and many more. But I don’t think there is a LIKE statement.
Please update this with a more precise question.
The LIKE clause for a Data Division data description entry has been available since at least V3 days (and probably earlier) for both OPM and ILE COBOL.