October 2011

JCL Interview Questions

1)How do you override a specific DDNAME/SYSIN in PROC from a JCL?

// DSN=...

2)Why do you want to specify the REGION parameter in a JCL step?

To override the REGION defined at the JOB card level.
REGION specifies the max region size. REGION=0K or 0M or omitting REGION means no limit will be applied.

What is the difference between a package and a plan?

Package and plan contain optimized code for SQL statements.

A package for a single program, module or subroutine contained in the database request module (DBRM) library.

A plan may contain multiple packages and pointers to packages. The one CICS module would then exist in a package that could be referenced in two different plans.

DB2: How to get the list of table's owned by the particular user?

Use the below query to get the list of table's owned by the particular user.

SELECT * FROM SYSIBM.SYSTABLES WHERE CREATOR = 'owner id'

DB2 : Buffer Pools

what is Buffer pools

Buffer pools, also known as virtual buffer pools, are areas of virtual storage used temporarily to store pages of table spaces or indexes. When an application program needs to access a row of a table, DB2 retrieves the page containing that row and places the page in a buffer.

If the row is changed, the buffer must be written back to the table space. If the needed data is already in a buffer, the application program will not have to wait for it to be retrieved from DASD. The result is faster performance. The sizes of virtual buffer pools can be changed while DB2 is running. The result is greater flexibility.

How many buffer pools are available in db2?

Ten 32k size buffer-pools and fifty 4k size buffer-pools (bp0 to bp49) default buffer pools are bp0,bp1,bp2 & bp32

CICS destination control table (DCT)

The destination control table (DCT) contains an entry for each transient data destination. A destination can be intrapartition, extrapartition, indirect, or remote. You code different DFHDCT macros for each type. The macros specify the symbolic name for each destination, and other information that CICS needs.

DB2: B37 abend during SPUFI?

The B37 ABEND in the SPUFI is because of space requirements, the query has resulted in so many rows that the SPUFI.OUT file is not large enough to handle it, increase the space allocation of spufi.out.

DB2: Difference between join and union, union all?

Difference between JOIN and UNION

Join is used to retrieve data from different tables using a single SQL statement.

Union is used to combine the results of two or more SQL queries.

Difference between a UNION and UNION ALL

UNION: Eliminates duplicates.

UNION ALL: Retains duplicates. Both are used to combine the results from different SELECT statements.

DB2: SQL Communications Area

What is the SQL Communications Area ?

It is a data structure that must be included in any host-language program using SQL. It is used to pass feedback about the SQL operations to the program.

Fields are return codes, error messages, handling codes and warnings.

DB2: DCLGEN

What is DCLGEN?

DCLGEN stands for declarations generator; it is a facility to generate DB2 SQL data structures in COBOL or PL/I programs.

It's an acronym for DeCLarations GENerator.

Contents of a DCLGEN

1. EXEC SQL DECLARE TABLE statement which gives the layout of the table/view in terms of DB2 datatypes.
2. A host language copy book that gives the host variable definitions for the column names.

Is it mandatory to use DCLGEN? If not, why would you use it at all?

It is not mandatory to use DCLGEN. Using DCLGEN, helps detect wrongly spelt column names etc. during the pre-compile stage itself ( because of the DECLARE TABLE ). DCLGEN being a tool, would generate accurate host variable definitions for the table reducing chances of error.

Is DECLARE TABLE in DCLGEN necessary? Why it used?

It not necessary to have DECLARE TABLE statement in DCLGEN. This is used by the pre-compiler to validate the table-name, view-name, column name etc., during pre-compile.

Linux / Unix / vim : How to make the process to run in background and bring back to foreground?

While working in vim/vi want to set the current process to background? You can use command ctrl+z which takes you to the command prompt and make currently editing file process to background.

It will show like [1]+ stopped vim 1.txt suppose if you are editing 1.txt in vim.

To bring that back to foreground, just use fg command in command prompt.

Every time when you set the process to background, it shows id in []. In case if you have more than one process's in background, then use fg with id to bring the specific process to foreground.

DB2 : Difference between Merge join, nested join and hybrid join.

DB2 can implement a join in three ways using a merge join, a nested join or a hybrid join.

A merge join requires that the tables being joined be in a sequence; the rows are retrieved with a high cluster ratio index or are sorted by DB2.

A nested join does not require a sequence and works best on joining a small number of rows. DB2 reads the outer table values and each time scans the inner table for matches.

The hybrid join is a nested join that requires the outer table be in sequence.

DB2: Compare a subselect to a join.

* Any subselect can be rewritten as a join, but not vice versa.
* Joins are usually more efficient as join rows can be returned immediately, subselects require a temporary work area for inner selects results while processing the outer select.

DB2: What are correlated Sub-queries?

Sub-query in which the inner ( nested ) query refers back to the table in the outer query. Correlated.

Sub-queries must be evaluated for each qualified row of the outer query that is referred to.

How is a typical DB2 batch program executed ?

1. Use DSN utility to run a DB2 batch program from native TSO.

An example is shown:

DSN SYSTEM(DSP3)
RUN PROGRAM(EDD470BD) PLAN(EDD470BD) LIB('EDGS01T.OBJ.LOADLIB')
END

2. Use IKJEFT01 utility program to run the above DSN command in a JCL.

JQuery: How to make radio box checked and Uncheck?

1. To make the radio checked

$('#element').attr("checked", "checked");

2. To make the radio uncheck

$('#element').removeAttr("checked");

or

$('#element').attr("checked",false);

3. How to make particular radio checked using value

<input type="radio" name="gender" id="gender" value="Male">
<input type="radio" name="gender" id="gender" value="Female">

First identify the radio from radio group which have same id using specified attribute. For example here, want to select based on value

$('input[value="Female"]').attr("checked","checked");

$('input[value="Female"]').removeAttr("checked",false);

4. If same value used for other element also then how to identify the specified value within specified id or class

$("#gender").each(function(){
  $($(this).val() == "Female") {
     $(this).attr("checked","checked");
   }
}

JQuery: How to hide and delete element?

To hide the element

jQuery("#hide_div").hide();

To hide group of elements which have same class

jQuery(".hide_class").hide();

To remove element

jQuery("#del_div").remove();

To delete elements which have same class

jQuery(".del_class").remove();

JQuery: How to swap image?

<img src ="/images/but_up.gif" id="im_id" border=0 class="but_swap"></img>

$(".but_swap").live('click',function(){
   if ($(this).attr("class") == "but_swap") {
    this.src = this.src.replace("_up","_down");   }else {
    this.src = this.src.replace("_down","_up");
  }
$(this).toggleClass("on");
});

Revo Uninstaller Portable

Normally we use windows Add or Remove programs to uninstall the softwares. This sometimes leaves files or folders of the uninstalled softwares.

The Revo Uninstaller Pro is helpful to remove complete set of files or folders of uninstalled software.

Open Source Music Player - Amarok

Everyone likes to listen music either western or carnatic albumn or cine songs. Normally to play music in windows, we use windows Media player.

Recently while browsing, find a music player called "Amarok" which supports Linux, Unix, Mac OS and windows.

Amarok is open source music player. It available various flavors of linux. It is the music player mainly built for linux.

It have dependencies like MySQL, TagLib, Qt, KDE-libs... There are external scripts which provides addition features like alarm using favorite music, listen radio of various countries and so on.

Fun: Appraisal and Resignation

A newly joined trainee engineer asks his boss "what is the meaning of appraisal?"

Boss: "Do you know the meaning of resignation? "

Trainee: "Yes I do"

Boss: "So let me make you understand what a appraisal is by comparing it with resignation"

Comparison study : Appraisal and Resignation