Passing a variable parm from JCL to a cobol/db2 program

Answer Posted / tejaratbours

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 ?    3 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?

922


Hello Guys, I have 1+ Year Experience in MAINFRAME TESTING. After 1 Week I have an Interview With a Company on Mainframe Testing. Please Could You Guys Please Suggest me What Sections Should I prepare ?? ___Tell Me the Topic Or Appropriate Site & Links. ?? ---------------Thank You

2246


Is their any set of rules for dd? Explain.

642


How do you access an uncatalogued dataset in a jcl?

714


how do you access an uncataloged dataset in a jcl?

815






What is the function of the steplib dd statement?

720


write a jcl to execute a job by 7:00 am on jan 20,1986?

678


how can you check if a file is empty using jcl?

796


What is the syntax of JCL statement?

679


Many jcl statements contain specific values designed to direct and control the execution of the statement. What are these fields called?

708


What is the use of disp parameter?

636


Differentiate between addressing mode and run mode.

603


What is the function of //cntl statement?

815


what JCL Procedures?

687


how do you create a dataset in a jcl with the same file organisation as that of another existing dataset?

782