Page 1 of 1

How to write - 'Hello world' program through JCL

Posted: Sat Jun 18, 2011 2:41 pm
by pal.sanjay.k
Hi,

Can anyone tell me ?

How to write - 'Hello world' program through JCL by passing 'hello world' as sysin data.

Not by submitting cobol program(having 'Hello world') by JCL.

Posted: Sat Jun 18, 2011 7:34 pm
by Anuj Dhawan
Well, before I answer - would like to know your interpretation about the three letters put together and called "JCL"?

Posted: Sat Jun 18, 2011 11:27 pm
by pal.sanjay.k
Hi Anuj,
I think u are right. JCL used to submit batch jobs.
But just thought, like we pass parameters('hello world') to the cobol prog, cant we pass 'Hello world' as a stream in JCL.

It will be grateful, if u cud elaborate on this. I am still confused....

Posted: Sun Jun 19, 2011 3:52 am
by MrSpock
Pass it to what? For what purpose? What do you want to do with it? Too many questions for what little detail you've provided.

Here's a quick overview of JCL (Job Control Language):

1. You need a JOB statement to identify the job:
//JOBNAME JOB (.......),'NAME',CLASS=,MSGCLASS=,...
as per the job coding standards at your site.

2. You need a job step to execute something, either a program or a JCL procedure:
//STEPNAME EXEC PGM=PROGRAM,PARM='parameters'

or

//STEPNAME EXEC PROCEDURE

3. Then, if your program needs to access data, you need DD statements:
//DDNAME DD DSN=SOME.DATASET,DISP=...
//DDNAME DD SYSOUT=*
//DDNAME DD *
/*

and, for the most part, that's about it.

Posted: Mon Jun 20, 2011 9:58 pm
by Frank Yaeger
How to write - 'Hello world' program through JCL by passing 'hello world' as sysin data.


FWIW, this DFSORT job will take Hello World from SORTIN DD * (sysin data) and write it to SORTOUT (SYSOUT output).

Code: Select all

//S1 EXEC PGM=SORT        
//SYSOUT DD SYSOUT=*      
//SORTIN DD *             
Hello World               
//SORTOUT DD SYSOUT=*     
//SYSIN DD *              
  OPTION COPY             
/*
If you state more clearly what it is exactly you want to do, I can probably show you how to do it with DFSORT.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080

Posted: Tue Jun 21, 2011 2:26 pm
by Anuj Dhawan
pal.sanjay.k wrote:I think u are right. JCL used to submit batch jobs.
But just thought, like we pass parameters('hello world') to the cobol prog, cant we pass 'Hello world' as a stream in JCL.
JCL, by it's very definition, is a control language used to identify a job to an operating system and to describe the job's requirement, so by itself does nothing, just aranges the things to get it working.

What you are asking is probably, avoid writing a COBOL, PL/1, C, or Java program - instead use some "utility-program", like Frank has demonstrated, using DFSORT. If so, you've plenty of choices and you already have one working example.

Posted: Sat Jun 25, 2011 10:09 pm
by pal.sanjay.k
Thanks Anju and MrSpock.

Actually I now realized that i asked a wrong question.
JCL can not be used to WRITE application programs.

Its just used to SUBMIT jobs and in some cases PASSING some parameters to the COBOL programs.

Like in 'C' we do ALT + F9 to compile program. We do Trngcob to compile Cobol prog.
To run progs in C we do CTRL + F9 . We submit JCL job to RUN COBOL prg.

In C after compling we get obj file , which runs in doing ctrl + F9
in Cobol on compilation we get a Load module usually here 'OPERN.CICS3.LOADLIB'.
on submitting JCL the respective Program name whose Load module is loaded at theOPERN.CICS3.LOADLIB gets executed.


Please correct me if I am wrong at any stage.

Thanks Frank for explaining, but sorry i didn't reach at that level...

Waiting for response...


Regards,
Sanjay Kumar.

Posted: Tue Jul 12, 2011 4:07 pm
by Anuj Dhawan
Well, for C, You are talking about as if you'll do it on personal computer at home; and that's not what happens in PROD.

For COBOL, you write a Source-code, compile, link-edit it to get the load module. Load modules get loaded to memory, memory with processor, and not in to some library as you've mentioned.