How to pass values in jcl to cobol?

Answer Posted / muttaiah

We can pass data from JCL to Cobol in 3 ways.
1. SYSIN: Normally and using files
2. Parm Parameter in Exec stmt


1. Sysin: Using this we can pass large amount of data. The
data passed using sysin will be accepted in cobol using
accept statement in procedure division.

//sysin dd *
adbcde
/*

or

//sysind dd dsn=<filename>,disp=shr

2. Parm: The parm parameter in Exec is used to send 100
char's of data from jcl step to cobol. This is accepted in
cobol usign linkage section. LInkage section should be
coded with Lenght and data fields.

//Stepname exec pgm=<PGManme>,parm='100 chars max'

Hope this will give you a clear picture than the other 2
answers.

Is This Answer Correct ?    22 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to compare two files in SYNCSORT and on the mismatch record should be deleted from second file.

5062


can any one plzzzzzz tell the jcl code for creating ps using idcams

10517


Explain the function of the dd dcb keyword?

706


What is timing concept in mainframe?

1662


What do you understand by the term “keyword” with respect to jcl and what is the opposite of the term?

679






have in 100 records in a file i want to read first 3 records and skip next 3 records and agan i want to read 3 records and again i want to skip 3 records... run a loop from record one to 10 evaluate i/3 if comes even then skip else write to output file

923


how you can access an uncataloged dataset in a JCL?

656


Explain the function of //jcllib statement?

708


what are JCLLIB and STEPLIB in JCL?

675


How jcl is used for testing batch programs?

721


Explain the hierarchy levels in jcl?

1120


What statement marks the beginning of an in-stream or cataloged procedure in jcl and assigns default values to parameters defined in the procedure?

816


Explain about LMQUERY�give a dialog information about a data set

904


How to pass the parameter in parm using linkage section ? (syntax)?

655


What is the function of the dd avgrec keyword in sms datasets?

841