From JCL we can pass data into COBOL program many ways. One is through PARM (maximum limit is 100 bytes), second through Input file, third through SYSIN card.
The data that we passed from PARM and SYSIN are passed to LINKAGE SECTION. In LINKAGE section we need to give 2 bytes extra to store length, and next we need to give actual size of the data.
05 STRINGLEN PIC 9(4) USAGE COMP.
05 STRINGPARM PIC X(80).
PROCEDURE DIVISION USING PARMDATA.
IF STRINGLEN > 0 . . .
The logic tests that if string-len is greater than zero, we can validate the data from JCL.