How to write - 'Hello world' program through JCL
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Member
- Posts: 3
- Joined: Sat Jun 18, 2011 2:33 pm
How to write - 'Hello world' program through JCL
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.
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.
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
-
- Member
- Posts: 3
- Joined: Sat Jun 18, 2011 2:33 pm
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.
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.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
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'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
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
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.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.
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.
Last edited by Anuj Dhawan on Tue Jul 12, 2011 4:01 pm, edited 1 time in total.
Regards,
Anuj
Anuj
-
- Member
- Posts: 3
- Joined: Sat Jun 18, 2011 2:33 pm
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.
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.
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
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.
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.
Regards,
Anuj
Anuj
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page