Sunday, August 25, 2013

JCL Specials

Symbols used in JCL datasets
1. && - Temporary Datasets
2. & -  Symbolic parameters in procedures
3. * - Referbacks

Temp Datasets
1. Without DSN - //DATA1 DD
2. With DSN    - //DATA2 DD DSN=&&tempdata

Special Programs
1. IGYCRCTL - Compilation
2. IEWL     - Link/Edit 
3. DSNHPC   - Precompile
4. IKJEFT01 - Bind

System Programs
1. IEF* - Program produced by scheduler group
2. IEB* - Dataset utility programs
3. IEH* - System utility programs
4. IEW* - Linkage/Loading programs

Sunday, August 18, 2013

Overrides In JCL

1. REGION Parameter - JOB Over-rides EXEC

//JOB1 JOB (A123),'XYZ'
//        REGION=40K   
//STEP1 EXEC PGM=PGM1,REGION=10K
//STEP2 EXEC PGM=PGM2,REGION=20K

Example : If STEP1 utilises complete 10K,also STEP2 utilises 20K but require more region , it over-rides its step region declaration and utilises the job region declaration (Provided there is no region requirement from any other step).
But if it exceeds the JOB region declaration, the job abebds.

2.TIME Parameter - EXEC Over-rides JOB

//JOB1 JOB (A123),'XYZ'
//        TIME=12
//STEP1 EXEC PGM=PGM1,TIME=04
//STEP2 EXEC PGM=PGM2,TIME=04
//STEP3 EXEC PGM=PGM3,TIME=02

Example : If STEP1 or STEP2 utilises more than 4 minutes,then even though total time for job is 12 minutes, the steps are not executed and the job abends.
If JOB is coded smaller time than the EXEC, then the JOB will terminateto the specified time of the JOB.

3. COND Paramter - JOB Over-rides EXEC

4. JOBLIB AND STEPLIB Parameters - STEPLLIB over-rides JOBLIB


Friday, July 12, 2013

Differences 3


Q11) Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc. ?
A11) An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntax’s: 1.) USING, GIVING sorts are comparable to external sorts with no extra file processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort. 

Q12) What is the difference between a DYNAMIC and STATIC call in COBOL. ?
A12) To correct an earlier answer: All called modules cannot run standalone if they require program variables passed to them via the LINKAGE section. DYNAMICally called modules are those that are not bound with the calling program at link edit time (IEWL for IBM) and so are loaded from the program library (joblib or steplib) associated with the job. For DYNAMIC calling of a module the DYNAM compiler option must be chosen, else the linkage editor will not generate an executable as it will expect u address resolution of all called modules. A STATICally called module is one that is bound with the calling module at link edit, and therefore becomes part of the executable load module.

Sl #
STATIC Call
DYNAMIC Call
1
Identified by Call literal.
Ex: CALL ‘PGM1’.
Identified by Call variable and the variable should be populated at run time.
01 WS-PGM PIC X(08).
Move ‘PGM1’ to WS-PGM
CALL WS-PGM
2
Default Compiler option is NODYNAM and so all the literal calls are considered as static calls. 
If you want convert the literal calls into DYNAMIC, the program should be compiled with DYNAM option.
By default, call variables and any un-resolved calls are considered as dynamic.
3.
If the subprogram undergoes change, sub program and main program need to be recompiled.
If the subprogram undergoes change, recompilation of subprogram is enough.
4
Sub modules are link edited with main module.
Sub modules are picked up during run time from the load library.
5
Size of load module will be large
Size of load module will be less.
6
Fast
Slow compared to Static call.
7
Less flexible.
More flexible.
8
Sub-program will not be in initial stage the next time it is called unless you explicitly use INITIAL or you do a CANCEL after each call.
Program will be in initial state every time it is called.

Difference between Pass-by-reference and Pass-by-content
Sl #
Passl By Reference
Pass By Content
1
CALL ‘sub1’ USING BY REFERENCE WS-VAR1
CALL ‘sub1’ USING BY CONTENT WS-VAR1
(BY CONTENT keyword is needed)
2
It is default in COBOL. BY REFERENCE is not needed.
BY CONTENT key word is mandatory to pass an element by value.
3
Address of WS-VAR1 is passed
Value of WS-VAR1 is passed
4
The sub-program modifications on the passed elements are visible in the main program.
The sub-program modifications on the passed elements are local to that
sub-program and not visible in the main program.

Q13) Difference between exit program and end programe 
A13)
EXIT PROGRAM                                                          END PROGRAM
1.syntax                                                                       1.syntax
 EXIT PROGRAM                                                      END     

2.used to mark ending of calling program,              2. Must be the last statement of the program.
if it is calling any other program, you cant end
u r calling pgm by END PROGRAM



Sunday, July 7, 2013

Differences 2


Q5) What is the difference between Structured COBOL Programming and Object Oriented COBOL programming ?
A5) Structured programming is a Logical way of programming, you divide the functionalities into modules and code logically. OOP is a Natural way of programming; you identify the objects first, and then write functions, procedures around the objects. Sorry, this may not be an adequate answer, but they are two different programming paradigms, which is difficult to put in a sentence or two. 

Q6) What is the difference between external and global variables ?
A6) Global variables are accessible only to the batch program whereas external variables can be referenced from any batch program residing in the same system library. 

Q7) Difference between next and continue clause?
A7) The difference between the next and continue verb is that in the continue verb it is used for a situation where there in no EOF condition that is the records are to be accessed again and again in an file, whereas in the next verb the indexed file is accessed sequentially, read next record command is used.

Q8) What is the difference between performing a SECTION and a PARAGRAPH ?
A8) Performing a SECTION will cause all the paragraphs that are part of the section, to be performed. Performing a PARAGRAPH will cause only that paragraph to be performed. 

Q9) What is the difference between COMP & COMP-3 ?
A9) COMP is a binary storage format while COMP-3 is packed decimal format. 

Q10) What are the differences between OS VS COBOL and VS COBOL II ?
A10) OS/VS Cobol pgms can only run in 24 bit addressing mode, VS Cobol II pgms can run either in 24 bit or 31 bit addressing modes. I. Report writer is supported only in OS/VS Cobol. II. USAGE IS POINTER is supported only in VS COBOL II. III. Reference modification e.g.: WS-VAR(1:2) is supported only in VS COBOL II. IV. EVALUATE is supported only in VS COBOL II. V. Scope terminators are supported only in VS COBOL II. VI. OS/VS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds. VII. Under CICS Calls between VS COBOL II programs are supported.

Sunday, June 16, 2013

Differences 1


Q1) What is the difference between PIC 9.99 and 9v99 ?
A1) PIC 9.99 is a FOUR-POSITION field that actually contains a decimal point where as PIC 9v99 is THREE- POSITION numeric field with implied or assumed decimal position. 

Q2) What is the difference between SEARCH and SEARCH ALL ? What is more efficient ?
A2) SEARCH is a sequential search from the beginning of the table. SEARCH ALL is a binary search, continually dividing the table in two halves until a match is found. SEARCH ALL is more efficient for tables larger than 70 items. 

Q3) What is the difference between static call & Dynamic call?
A3) In the case of Static call, the called program is a stand-alone program, it is an executable program. During run time we can call it in our called program. As about Dynamic call, the called program is not an executable program it can executed through the called program 

Q4) What is the different between index and subscript ?
A4) Subscript refers to the array of occurrence , where as Index represents an occurrence of a table element. An index can only modified using perform, search & set. Need to have an index for a table in order to use SEARCH and SEARCH All.
Sl #
Subscript
Index
1
Working Storage item
Internal Item – No need to declare it.
2
It means occurrence
It means displacement
3
Occurrence, in turn translated to displacement to access elements and so slower than INDEX access.
Faster and efficient.
4
It can be used in any arithmetic operations or for display.
It cannot be used for arithmetic operation or for display purpose.
5
Subscripts can be modified by any arithmetic statement.
INDEX can only be modified with SET, SEARCH and PERFORM statements.

Sunday, July 1, 2012

JCL Interview Questions 6


What are S0C1, S0C4, S0C5, S0C7 ABENDs??
S0C1 (Operation Exception Error) - May be due to 

Missing or misspelled DD name 
Read/Write to unopened dataset 
Reading a dataset opened output mode
Writing into a dataset opened input mode
Called subprogram not found

S0C4 may be due to 
Missing Select statement (during compile) 
Bad Subscript/index 
Protection Exception 
Missing parameters on called subprogram 
Read/Write to unopened file 
Move data from/to unopened file;

S0C5 May be due to 
Bad Subscript/index 
Close an unopened dataset 
Bad exit from a perform 
Access to I/O area (FD) before read;

S0C7 may be due to 
Numeric operation on non-numeric data 
Un-initialized working storage 
Coding past the maximum allowed subscript

S0CB might be due to 
Division by Zero 

Why do you use a CONTROL CARD? 
A: A CONTROL CARD can be a member of a PDS or a sequential dataset and is used for storing the date fields, definitions of VSAM files etc., 
We use CONTROL CARD because we cannot use an in-stream procedure in a procedure. Generally you will be calling a PROC from your JCL and you cannot code instream procedure in the PROC and so you will point to the dataset, which is called controlcard. 

How do you submit JCL via a Cobol program?
In your JCL define as: //JOBA JOB 1111,JOB1 //STEP01 EXEC PGM=PROG1 //ddname DD SYSOUT=(*,INTRDR)....and your COBOL (PROG1) should look like this: SELECT JCL-FILE ASSIGN TO ddname. Open this file and write the JCL statements into this file. Example: MOVE '//TESTJOB JOB 1111,VISVEISH' TO JCL-REC.MOVE '//STEP01 EXEC PGM=IEFBR14' TO JCL-REC.and close this file. Then TESTJOB will be submitted. 

How do you submit a JCL under CICS environment?
Pass all the JCL codes to a COBOL variable (should be declared using OCCURS clause) and then write the line one by one to the spool using CICS commands like SPOOLClose, SPOOLOpen and SPOOLWrite. For more help refer CECI of CICS or CICS manual. 

What is the parameter to be passed in the job card for the unlimited time, irrespective of the job class
TIME=1440 

Define COND parameter in JCL?
COND is a condition parameter, consists of 2 subparameters, 1st - return code from the previous step, 2nd - condition. If COND is true, the step on which COND is coded will be BYPASSED. It is compared with system return code of previous step //STEP1 EXEC PGM=ABCD //STEP2 EXEC PGM=XYZ, cond=(4,lt) STEP 2 will be executed when system return code of step1 is less than 4. 

What is meant by S0C-07 system ABEND codes
S0C7 - Data exception error - you will get it whenever you are trying to move the low values or spaces into the numeric field, or compare the numeric fields with low values, or try to do some arithmetic operations on the low values. To avoid this you have to always initialize the numeric fields otherwise they will contain the low values. 

How to pass the temp dataset form one JOB step to another?
By specifying the DISP as PASS for the temp dataset 

Write a JCL to execute a Job by 7:00 AM on Jan 20,1986?
The code is: //*MAIN DEADLINE=(0700,B,012086) 

How many types of libraries are there in JCL?
Libraries are of three types: System Libraries:- such as SYS1.LINKLIB Private Libraries:- Specified in a JOBLIB or STEPLIB DD STATEMENTS. Temporary Libraries:- Created in a previous step of the Job. 

What do you mean by INCLUDE statement in JCL?
An INCLUDE statement identifies a member of a PDS that contains this set of JCL statements is called an INCLUDE group. The system replaces the INCLUDE statement with the statements in the INCLUDE group. 

What are the Maximum number of In-stream procedures you can code in any JCL?
15. 

What you mean by skeleton JCL?
JCL, which changes during run time,that is the values for the JCL such as program name, dd name will change. The same JCL can be used for various jobs, equivalent to dynamic SQL; 

What is JCL
It is an interface between operating system (MVS) & the application program. When two related programs are combined together on control statements, it is called job control language 

What is the maximum blocksize for a Tape file?
It is 32,760. Based on that we can calculate efficient number of Records in a Block 

What are the basic JCL Statements for a Job?
The basic JCL statements for any job are: 
JOB : Identifies a job and supplies accounting info 
EXEC : Identifies a job step by indicating the name of the program to be executed. 
DD : Identifies a data set to be allocated for the job step Delimiter (/*) : Marks the end of an in-stream dataset Null (//) : Marks the end of a job Comments (//*) : Provides Comments 
PROC : Marks the beginning of a procedure 
PEND : Marks the end of a procedure 
OUTPUT : Supplies options for SYSOUT processing. 

What does the statements: TYPRUN=SCAN and TYPRUN=HOLD do in a JCL statement?
TYPRUN= SCAN checks the JCL for errors, TYPRUN= HOLD holds the job until further notice.