Hi Matt,
To avoid confusion, there are 2 ways to pass parm info to a cobol pgm: when the pgm is called as a subpgm or when it's executed directly from JCL.
When used as a subpgm, NVS's approach is used.
When executed from JCL, Glenn's is used.
One thing to note, when using the 2nd approach, the Linkage Section s/b coded as follows:
Code:
Linkage Section.
01 link-data.
05 link-len pic s9(004) comp.
05 link-data pic x(020).
link-len will contain the length of the PARM data provided in the // EXEC JCL stmt.
link-data will contain the data itself.
Note that the length field (link-len) is NOT required for the 1st approach.
BTW, in NVS's post, "02 linkfield2" should read
"01 linkfield2".
Regards, Jack.