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

what is use of dsn parameter in dd statement?

762


why should SYSIN DD * statement should not be included inside a PROCedure snippet??? please answer this.. i need to know.

2048


how do you code a null statement?

878


what are the types of abends that occur on job failure? And explain the possible causes of these

1222


In sms datasets, what is the function of the dd mgmtclas keyword?

976






I have a COBOL program that ACCEPTs some input data. How do you code the JCL statement for this?

803


I have a job called careerride and some steps in it as step1,step2. But I want to execute step2 before step1 ? How do I do that?

931


Differentiate between addressing mode and run mode.

689


what operation is performed by job statement?

740


when can a job time-out occur? How to overcome that?

843


What is multithreading in jcl?

1038


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

910


Can we use DISP=SHR in output file in JCL

1070


how can a gdg base be created in a jcl. What is the difference between empty and scratch parameter while defining/altering gdg base?

898


Is automatic restart possible in jcl?

848