How does JCL act on code(if you take a COBOL program) ?
There are certain set of divisions that interact with JCL.
Identification Division- act as introductory part to JCL(program name, author,date etc no interacting code).
Environment Division- now the story begins - JCL interacts with OS acc to need as it send request for Files under file operation.
Data Division- after files are accessed, it works with them according to operations to READ or to PRINT files (with the help of OS).
Procedure Division- it contains various actions taken on files
eg to close files that are being used.
How can you check if a file is empty using JCL?
When the file is used as input in IDCAMS, job completes with a warning (return code 4) if the file is empty.
Is their any set of rules for DD? Explain.
Yes, DD should follow predefined rules otherwise it will not be executed or will show error message.
DD is called the data defining sets and it is most sensitive part of JCL statements.
It should follow the EXEC statement for that job for which DD is needed.
Always assign a valid name to DD, otherwise it will terminate abnormally.
For each data set you should define a data defining statement.
Positional parameters are used by DD and should use the operand field otherwise error.
Keyword parameters are used by DD and shoud use the operand field otherwise error.
If both are coded keyword parameter must follow positional parameters.
If we want to use a GDG which is already created by some job, then how to use the reference of the last generation in a JCL?
To refer the latest generation of a GDG, we use the reference as (+0).
What is // ?
It is an important symbol used in JCL statements.
JCL statement must begin with this symbol.
It is a predefined rule that must follow to execute the JCL statements otherwise it will through error.
The JCL execution system first checks for that symbol at beginning of statements to be considered as JCL statement.
Use without space between symbol and jobname.
Every statement in jcl should start with //.to work properly.
Use of it avoid any runtime exceptions.