Writing script with JCL language

JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Writing script with JCL language

Postby HugsBunny » Tue Nov 22, 2011 10:37 pm

Hello All,

well, I have this task for university:

1 part. Using JCL language, write a script that creates new dataset with these parameters:
Record format . . . : FB
Record length . . . : 80
Block size . . . . : 800
2 part. Using JCL write a script, that copies a sequential dataset
3 part. Know how to start JCL scripts. Show all started jobs list.
4 part. Write a script with an error and show the error message.

Can anyone help me, what to do or at least put me on the road? I googled a lot, but I do not get good information and knowing almost nothing about using mainframe.

As far I found out that I should go to 3.2 and allocate new file with the ending jcl. Is that correct? I know how to create datasets, read something in a book, but not sure how to start scripting :/

(by the way, that is only 1 task in my studies and I am not planning to work with mainframe, that's why I am looking for an easy answer :))
Posts: 2
Joined: Tue Nov 22, 2011 10:35 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Writing script with JCL language

Postby Akatsukami » Tue Nov 22, 2011 10:56 pm

Your professor/instructor/TA is seriously confused -- and I express myself politely -- about the nature of JCL. JCL only establishes environments and runs programs.

Your task #1 can be executed through a batch job (not a "JCL script")...but that is because the creation of data sets is part of establishing an environment. Read up on the DD statement.

Task #2 cannot be done, although a batch job can be written to run a program that copies a data set. Read up on IEBGENER. Quite a few other utilities can also be used.

Task #3 is pretty complete yivshish. If "starting a JCL script" is something other than a complete malapropism for "submitting a batch job", then we're talking scheduling and spool management that are both proprietary and far too complex to be dealt with in a single post.

Task #4 is simple. Find any post where a sotfware engineer whines, "My JCL won't run!!!" and copy the JCL therein :P
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Global moderator
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Writing script with JCL language

Postby BillyBoyo » Tue Nov 22, 2011 11:03 pm

Part of the problem is that the person who established your task knows little about Mainframes either.

JCL - Job Control Language

This does not mean it is a language in any particularly meaningful sense. You don't write scripts with it. What you write with JCL is JCL. You write JCL.

If you need to define a dataset with JCL (this might also be referred to as "in Batch" or "with a Batch job") then a common mehthod is with a program called IEFBR14. If you google for that along with NEW,CATLG,DELETE then you will probably find an example of the sort of thing you want.

There are many ways to copy a dataset in Batch (all Batch jobs require JCL). Sort can be a good one. Google for "SORT FIELDS=COPY" or SORT and "OPTION COPY".

The third question is unclear. Whilst editing a piece of JCL you can SUBmit it for processing. "Started Tasks" which more closely fits the question is something different, and probably not something you'd be interested in at your level. Look for SDSF in ISPF if you want to list the status of jobs.

I'm sure you'll have no problem generating an error or two. SDSF again to see the output from a Job (or OUTLST) which will have error messages of various sorts.
Global moderator
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Writing script with JCL language

Postby HugsBunny » Tue Nov 22, 2011 11:09 pm

I just want quicly reply that I translated task from my native language and this may be lack of my knowledge, not professor's :D

Thank you for your answers, I'll check what you advised right away :)
Posts: 2
Joined: Tue Nov 22, 2011 10:35 pm
Has thanked: 0 time
Been thanked: 0 time

Return to JCL


  • Related topics
    Last post