How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?



How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?..

Answer / Praveen Mishra

To run a COBOL batch program using the JCL, you can create a job card with appropriate specifications such as input and output datasets, library lists, and other required options. Here is an example of a simple JCL for running a COBOL program:nn```JCLn //JOB NAME.n JOB (YOUR_JOB_NAME), n 'YOUR_CLASS', n DD DISK (n DD DSN=YOUR_DATASET, n DISP=SHR, n UNIT=SYSDA,n SPACE=(CYL,1) n ), n EXEC PGM=YOUR_COBOL_COMPILERn SYSPRT DD SYSOUT=*n SYSIN DD DSN=YOUR_COBOL_SOURCE,n DISP=SHR, n UNIT=SYSDA,n SPACE=(CYL,1)n STEPLIB DD DSN=YOUR_LIBNAME,DISP=(NEW,CATLG),SPACE=(CYL,1)n /END-JCL"nReplace (YOUR_JOB_NAME), (YOUR_DATASET), (YOUR_CLASS), and (YOUR_COBOL_COMPILER) with the appropriate names for your specific job, dataset, class, and compiler.nnTo run a COBOL/DB2 program, you can modify the EXEC PGM line to point to the DB2 processor instead of the COBOL compiler.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JCL Interview Questions

If I defined space as TRK(10,10) for the one file and lrecl = 4K then tell me how many record will vsam file will contain. will it 1,2,3,4,5 or how many,

3 Answers   IBM,


I had Records in file Like this Company Code IBM 2 IBM 1 IBM 4 WIPRO 3 WIPRO 2 WIPRO 9 TCS 4 TCS 6 TCS 3 i want the record of every company with highest code How can i do that?

4 Answers   Wipro,


Explain the purpose of the dd keylen parameter?

1 Answers  


how to execute the last 5 steps in jcl

2 Answers   Syntel,


Can we browse or edit the GDG dataset if it is a tape entry?

4 Answers  


What dd statement is used to supply the name of a dataset?

1 Answers  


Can we use DISP=SHR in output file in JCL

1 Answers  


How would I code JCL to copy a gdg data set G001v00 and create a gdg Data set G001v01

2 Answers  


Using DELETE what type of file can you delete? a)SEQUENTIAL FILE B)INDEXED FILE C) D) Some options were there..i cant remember

3 Answers   HSBC,


Why 16 is used in calculating the DPRTY ? as, DPRTY = (num1, num2), THEN, DPRTY = 16* num1 + num2

4 Answers   IBM,


Can you execute a PROC from another PROC?

8 Answers   Keane India Ltd,


Why include statement is used in a jcl?

1 Answers  


Categories