JCL Procedures, FAQs, Interview Questions and Answers

10/02/2009 No Comment

JCL Procedures, FAQs, Interview Questions and Answers.

How are in-stream procedures (procs) built?
Answer : In-stream procedures are built by coding a set of statements and placing them after the JOB statement and before the EXEC statement. In-stream procedures begin with a PROC statement and end with a PEND statement. Up to 15 in-stream procedures can be included in a single job.
Each in-stream procedures may be invoked several times within the job. In-stream procedures can use symbolic parameters in the same way as catalogued procedures.

What is the difference between an in-stream procedure and a cataloged procedure?

Answer : An In-stream procedure is basically same as a catalogued procedure. The difference is that to execute an in-stream procedure one places it after the JOB statement and before the EXEC statement and must end it with a PEND statement. A catalogued procedure is catalogued on a procedure library and is called by specifying the procedure name on the EXEC statement. An in-stream procedure is useful to test the procedure before making it a catalogued procedure.

Name some of the JCL statements that are not allowed in the procs.

Answer : Some of the JCL statements that are not allowed in the procs are:
1. JOB Delimiter (/*) or Null (//) statements
2. JOBLIB or JOBCAT DD statements
3. DD * or DATA statements
4. Any JES2 or JES3 control statements

What parameters are good candidates to make symbolic parameters?

Answer : Any parameter, sub parameter, or value in a procedure that may vary each time the procedure is called is a good candidate to be coded as a symbolic parameter.

Which type of override parameter requires that one know the parameters that can be overridden?

Answer : Regular parameters require that one know the parameters that can be overridden, such as step names within the procedure, the DDnames of the statements overridden, and the order of the DD statements.

How is a symbolic parameter coded?
Answer : A symbolic parameter is preceded by an ampersand (&) and followed by a name (&FIRST). The first character must be alphabetic. Symbolic parameters can be coded only in the operand field of the JCL statements; they cannot appear in the name or operation field of the JCL statements. If more than one value is assigned to the symbolic parameters on a PROC or EXEC statement, only the first one is used. Symbolic parameters may be coded in any order on the PROC or EXEC statement.

How are values assigned to symbolic parameter?

Answer : Values can be assigned to symbolic parameter on the PROC statement, on the EXEC statement, or on a SET command. Values containing special characters other than blank must be enclosed in apostrophes. The Values assigned to symbolic parameter can be of any length, but it cannot be continued onto another line.

Can symbolic parameter concatenated?

Answer : Symbolic parameter can be concatenated with other symbolic parameters, regular parameter or with the portions of the regular parameters as follows
Symbolic/symbolic – PARM-&FIRST&LAST
Symbolic/regular – SPACE-&SPACES
Symbolic/portion – SPACE-CTRK, &PRIMARY

What are some of the rules involved in overriding parameters on the EXEC statements in a procedure?
Answer : To override EXEC parameter one should follow these rules
1. A PGM parameter cannot be overridden.
2. The parameter for each step do not need to be coded in the same order as they appear on the procedure EXEC statement
3. To add or override a parameter on an EXEC statement, code it as follows parameter.procstepname=value.
4. If a parameter which does not exist is coded on the EXEC statement, the parameter will be added
5. All parameters in each step must be coded in order: the first step must be coded first, second step second, third step third, etc.

What are some of the rules involved in overriding DD statements in procs?

Answer : The following rules apply when overriding a DD statement:
1. DD statement overrides precede the DDname with procstepname
2. The JCL parameter is replaced unless it does not exist on the original statement, in which case it is added. For the DCB each sub parameter can be overridden
3. DD statement overrides should carry DDnames that already exist in the step they are to effect
4. DD statement overrides must be coded preceding any added DD statement for the proc step
5. DD override statement must be listed in the order in which they are shown in the proc
6. DD override statement are only in effect for the duration of the run

How are concatenated DD statements in the proc overridden?

Answer : Overriding concatenated DD statements requires the following:
1. To override only the first DD statement in a concatenation, code only one overriding DD statement
2. To override all DD statements in a concatenation, code an overriding DD fo each concatenated DD statement
3. The overriding concatenated DD statements must be in the same order as the concatenated DD statement
4. Code a DDname on the first overriding DD statements only. Leave the DDname blank on the following DD statements.
5. To leave a concatenated statements unchanged, code its corresponding, overriding DD statement with a blank operand field
Related Posts

No comments :


Aired | The content is copyrighted and may not be reproduced on other websites. | Copyright © 2009-2016 | All Rights Reserved 2016

Contact Us | About Us | Privacy Policy and Disclaimer