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



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

Answer / 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

More JCL Interview Questions

In SPACE,what is directory,RLSE

6 Answers   TCS,


Name a few IBM utility programs, and explain its function.

0 Answers  


Can I concatenate various datasets whose organization are different from each other. Lets say I want to cancatenate a PDS file, a PS file, a GDG file etc. Can You do that ?? If yes, how ? is there any separate Utility to do so ???

4 Answers  


There are a set of 10 files and a customer will be selecting random no of files(i.e they may be more than 2, may not be in the order).Sometimes he might just select one file or sometimes no files at all.How do you code a JCL for this? Is it possible to code just JCL alone for this problem?

9 Answers   Infosys,


We have an output dataset in job with disp parameter as SHR. Can we write data in that file dataset?

2 Answers   CTS, IBM,






how to convert a file form fixed Length to variable length?

2 Answers   Syntel,


What is primary allocation for a dataset?

4 Answers  


What is the meaning of data definition name (ddname) and dataset name (dsname) in the DD statement?

2 Answers  


What are the jcl procedures?

0 Answers  


We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?

0 Answers   IBM,


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

0 Answers  


What is Backward Referencing ?

3 Answers   HSBC,


Categories