We can use the ACCEPT Statement to accept the value from the JCL or a system defined value.
ACCEPT IDENTIFIER FROM [Mnemonic-name]
1. ACCEPT EMPLOYEE-DETAILS.
Here the value of EMPLOYEE-DETAILS will be provided from the JCL during the runtime of the JCL. You can pass data from JCL using SYSIN or PARM.
2. ACCEPT CURRENT-DATE-VAL FROM DATE.
Here the value of CURRENT-DATE-VAL will be fetched from the system defined DATE.
3. ACCEPT CURRENT-TIME-VAL FROM TIME.
Here the value of CURRENT-TIME-VAL will be fetched from the system defined TIME.
SYSIN Parameter in JCL:
1. SYSIN Parameter is used in JCL(JOB CONTROL LANGUAGE) to pass the data from JCL to COBOL Program.
2. ACCEPT Statement is coded in COBOL Program to receive the Data which is passed from the SYSIN of the JCL.
Syntax of SYSIN format 1:
a) //SYSIN DD * values…
Here, DD * – In-stream data
b) //SYSIN DD DATA values…
Let us take an Example of complete flow of ACCEPT Statement
ADDITION OF TWO NUMBERS USING SYSIN