Saturday, September 7, 2013

Defaults

JCL Defaults
1.(NEW,DELETE,DELETE)  - DISP Parameter
2. 5 Buffers - BUFNO Parameter in DCB

COBOL Defaults
1.Trailing - Default for SIGN clause
2.Ascending - SEARCH ALL
3.NOSSRANGE - Subscript out of ranger checking

DB2 Defaults
1.BP00,BP01,BP02 & BP32 - Default Buffers in DB2
2.REPLACE - ACTION Parameter in BIND card
3.VALIDATE - RUN parameter in BIND CARD
4.ASCENDING - ORDER BY in Sort

CICS Interview Questions 2

Q) What  are the  six  different  types  of  argument  values  in  COBOL  that  can  be  placed in various options of a CICS command?
A)
Data Value -  EX (Literal 8 or 7 7 KEYLEN PIC S9(4 ) COMP VALUE 8.)
   Data Area    -  EX (01 RECORD-AREA.
                                  05 FIELD1 PIC X(5). )
   Pointer-Ref   - EX (05 POINTER-I PIC S9(8) COMP. )
   Name           - EX (05 FILE-NAME PIC X(5) VALUE ‘FILEA’. )
   Label            - Cobol paragraph name
   HHMMSS    -  EX (77 TIMEVAL PIC S9(7) COMP3. )

Q) Kindly specify the PIC clause for the following
   Any BLL Cell, Data type of Length Option field, HHMMSS type of data fields
A) Any BLL Cell       - S9(8) COMP
   Data type of Length Option field   - S9(4) COMP
   HHMMSS type of data fields         -  S9(7) COMP3

Q) Specify CICS transaction initiation process. (From the perspective of CICS control programs and control tables.)
A)
TCP places d ata in TIOA and corresponding entry into TCT.
KCP acquires the transaction identifier from TIOA and verifies if it is present in PCT.
SCP acquires Storage in Task Control Area (TCA), in which KCP prepares control data for the task.
KCP then loads the application programs mentioned in PCT by looking for it in PPT.
If resid ent -  real storage memory location is not present in the  PPT  the control  is  passed  to  PCP that
loads the application programs from the physical storage location address given in PPT. The control is
then passed to  the application program (LOAD module).

Q) List the sequence of steps used to achieve “Modification in Skip Sequential Mode.”
A) I.  READNEXT command
II.  Issue the ENDBR command
III.  Issue the READ command with UDTAE optio n.
IV.  Manipulate the record (DELETE or REWRITE command)
V.  Issue START command
VI.  Issue two READNEXT commands (One for dummy skip)
VII. Go to step two.

Q) Specify the requirements for Auto matic Task Initia tion. (Mention the control table, it’s entries
and the corresponding Procedure division CICS command).
A)
DFHDCT  TYPE=INTRA,
       DESTID=MSGS,
          TRANSID=MSW1,
           TRIGLEV=1000

    EXEC CICS WRITEQ TD
    QUEUE(‘MSGS’),
    FROM(DATA-AREA),
    LENGTH(MSG_LEN)
    END-EXEC.

Q) What are the commands used to gain exclusive control over a resource (for Ex a Temporary storage queue.)?
A)
EXEC CICS ENQ       EXEC CICS DEQ
    RESOURCE(QID)      RESOURCE(QID)
   END-EXEC            END-EXEC

Q) What is the EIB parameter and  the CICS command used to implement Pseudo-Conversa tional
   technique using single PCT - Single PPT entry?
A)
EIBCALEN - To check if COMMAREA has been passed in terurn command.
    EXEC CICS RETURN
    TRANSID(data-name)
    COMMAREA(data-area)
    LENGTH(data-value)
    END-EXEC

Q) Mention the 5 fields available in the symbolic map for every ‘NAMED’ field in the DFHMDI
macro? Give a brief description of these fields (Not exceeding a line).
A)
FIELD+L - Return the length of text entered (or for dymanic cursor positioing)
   FIELD+F  - Returns X(80) if data entered but erased.
   FIELD+A  - Used for attributes reading and setting
   FIELD+I  - Used for reading the text entered while receiving the map.
   FIELD+O  - Used for sending information on  to the MAP.

Q) What are the two ways of breaking a CPU bound process to allow other tasks to gain access to CPU.
A)
EXEC CICS DELAY       EXEC CICS DELAY
    INTERVAL(hhmmss)        TIME(hhmmss)
    END-EXEC              END-EXEC

POST and  WAIT commands also achieve the same result.

Q) How do you initiate another transaction? The transaction initiated should be in a position to retrieve information  pertaining  to  which  transaction  has initia ted  it and  from  which  terminal. (Code the required CICS commands)
A)
EXEC CICS START
    INTERVAL(hhmmss)/TIME(hhmmss)
    TRANSID(‘TRAN’)
    TERMID(‘TRM1)
    FROM(data-area)
    LENGTH(data-value)
    RTRANSID(EIBTRNID)
    RTERMID(EIBTRMID)
   END-EXEC

   EXEC CICS RETRIEVE
    INTO(data-area)
    LENGTH(data-value)
    RTRANSID(data-name)
    RTERMID(data-name)
   END-EXEC

Sunday, September 1, 2013

COBOL

8 - Maximum length of Program ID.
7 - Maximum Level in OCCURS clause.
18 - Maximum numbers of digits in a numeric field.
30 - Maximum length of name of Identifier.
120 - Maximum numbers of characters in an alphanumeric field.

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.