How can we pass data from cobol to JCl?

Answer Posted / rosi

hi.
i need help
i need Passing a variable parm from JCL to a cobol/db2
program
I'm trying to write a batch cobol/db2 pgm wich receive in
linkage section some paremeters
I succeeded to pass a static string of characters but what
I need is variable parameters (INPUT )

//DDB5A59 JOB CLASS=A,MSGCLASS=R,MSGLEVEL=
(1,1),NOTIFY=xxxx
//
REGION=0M
// SET INPUT=MYNAME
<=====
//PH01S01 EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=
(4,LT)
//SYSTSPRT DD
SYSOUT=*
//SYSTSIN DD
*
DSN SYSTEM
(DBSN)
RUN PROGRAM(COBPROG) PLAN(NACPLN) -

PARMS('INPUT') -

LIB
('MYDB.TRNSCTN.LOADLIB')
//SYSPRINT DD
SYSOUT=*
//SYSUDUMP DD
SYSOUT=*
//INFILE DD DSN=MYDB(&INPUT),DISP=SHR
//ERRLST DD
SYSOUT=P,DCB=RECFM=F,FCB=L56
The program (cobprog) is that when I run the job ,if PARMS
('&INPUT') returns :&INPUT and
if PARMS(&INPUT) returns :null
i need "myname" to the cobol/db2 program and name of the
member (DSN=MYDB(&INPUT),DISP=SHR)
Do you think helpe me?
Thanks

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

3720


Which division and paragraphs are mandatory for a COBOL program?

709


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

2723


Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2058


1.give the details about WHEN OTHER. 2. how many form are available in evaluate.

1614






How are the next sentence and continue different from each other?

766


how do you reference the variable block file formats from cobol programs

686


can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech

1960


i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com

1772


Explain what you understand by passing by value.

701


Write a program to explain size error.

677


What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

679


What is comp-1 and comp-2?

764


What are literals?

632


What are the different rules for performing sort operation?

763