affiliate marketing Interview Qns

Thursday, November 4, 2010

IEBCOMPR

Its primary purpose is to compare two sequential or partitioned files. This program simply reads two files and finds out if they are identical or not.

The following is the sample of a JCL statement to execute this utility program.

//GP4ABC JOB (RR, 1235,,,,8,,U),’MR. XYZ’,CLASS=S,

// MSGCLASS=G,MSGLEVEL=1,NOTIFY=GP4ABC

//*

//***********************************************************

//* THIS PROGRAM COMPARES TWO DATASETS.

//***********************************************************

//STEP1 EXEC PGM=IEBCOMPR

//SYSPRINT DD SYSOUT=*

//SYSUT1 DD DSN=TSGBAXC.SACRED.DATA,DISP=SHR

//SYSUT2 DD DSN=TSGBAXC.NEWCOPY.DATA,

// DISP=SHR

//SYSIN DD DSN=TSGBAXC.PARMINPUT.DATA(CMPR),

// DISP=SHR

OR

//SYSIN DD *

COMPARE TYPORG= PS

or PO.



In this example, the DSN stated against DDNAME SYSUT1 and that of the DDNAME SYSUT2 are both inputs to the utility program IEBCOMPR. The program will read both the programs and will try to find similarity or dissimilarity between these two datasets and provide output to show the same. The parameter TYPORG shows what type of dataset is being compared, where PO means Partitioned datasets and PS means Physical Sequential file. This parm input can be provided to the program either in the form of a member in a PDS by stating the DSN and its member or using instream procedure by using SYSIN DD *


IEBGENER

It is the most commonly used utility. Its primary purpose is to make copies of sequential files, but it is often used to create sequential files or partitioned datasets

The following is the sample of a JCL statement to execute this utility program.

//GP4ABC JOB (RR, 1235,,,,8,,U),’MR. XYZ’,CLASS=S,

// MSGCLASS=G,MSGLEVEL=1,NOTIFY=GP4ABC

//*

//***********************************************************

//* THIS PROGRAM COPIES ONE FILE TO ANOTHER.

//***********************************************************

//STEP1 EXEC PGM=IEBGENER

//SYSPRINT DD SYSOUT=*

//SYSUT1 DD DSN=TSGBAXC.SACRED.DATA,DISP=SHR

//SYSUT2 DD DSN=TSGBAXC.NEWCOPY.DATA,

// DISP=(,CATLG,DELETE),

// UNIT=DISK,

// SPACE=(CYL,(20,2),RLSE),

// DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160)

//SYSIN DD DUMMY

In this example, the DSN stated against DDNAME SYSUT1 is copied to a new DSN stated against DDNAME SYSUT2. This means SYSUT1 is the input and SYSUT2 is the output. SYSIN DD DUMMY states that no other input(sysin) parameter was used in this process. DUMMY specifies that while input file was getting copied to the output file, no further manipulation was made to the copying process. This follows the same pattern when a programmer wants to suppress a particular input or output dataset by using the DDNAME DD DUMMY in the execution jcl

IDCAMS

It is a special utility program available only both on VS and MVS system. The use of IDCAMS is currently limited within VSAM files, even though it can perform many of its functions also with non-VSAM files. Apart from its capabilities to perform file transfer, it can also define/delete VSAM files, allocate VSAM clusters, does record selects following special conditions etc

For VSAM Files

1. Define a VSAM Master or user catalog

2. Define a VSAM data space

3. Define a VSAM cluster

4. Delete a VSAM cluster

5. Load a VSAM file from a non-VSAM file

6. Copy a VSAM File

7. Print a VSAM File

8. List the entries for a VSAM Catalog

9. Scratch(delete) a VSAM File

For Non-VSAM Files

1. Copy a non-VSAM file

2. Print a non-VSAM File

3. Selectively copy a non-VSAM File

· Start at a certain record, stop at a certain record

· Stop at a certain record from the beginning of the file

· Perform the previous two operations at the same time in proper succession

4. Catalog a non-VSAM File in a VSAM Catalog

5. Scratch a non-VSAM file created in a VSAM Catalog

6. Create Index for Generation Data Group


The following is the sample of a JCL statement to execute this utility program.


//TSGBIDC1 JOB ($$$$$$,11,999,A,I59604,$$$$$$$$$$,9999,9999,SYSOUT),

// 'TSGBAXC - WEST',MSGCLASS=X,REGION=64M,CLASS=A,

// NOTIFY=TSGBAXC

//PRTLOG OUTPUT CLASS=*

//*********************************************************************

//* THIS STEP COPIES THE INPUT FILE TO THE OUTPUT FILE.

//* REPRO MEANS REPRODUCE THE FILE, WHICH IS REALLY A COPY.

//*********************************************************************

//STEP0001 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//INPUT DD DSN=TSGBKXR.KANNAN.SOURCE,DISP=SHR

//OUTPUT DD DSN=TSGBAXC.BRANDNEW.SOURCE,DISP=SHR

//SYSIN DD *

REPRO INFILE(INPUT) OUTFILE(OUTPUT)

//*********************************************************************

//* THIS STEP COPIES THE INPUT FILE TO THE OUTPUT FILE.

//* REPRO MEANS REPORDUCE THE FILE, WHICH IS REALLY A COPY

//* STARTAT(1000) MEANS START COPYING FROM RECORD NUMBER 1000,

//* STOPAT(9000) MEANS STOP AT RECORD NUMBER 9000

//*********************************************************************

//STEP0002 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//INPUT DD DSN=TSGBKXR.KANNAN.SOURCE,DISP=SHR

//OUTPUT DD DSN=TSGBAXC.BRANDNEW.SOURCE,DISP=SHR

//SYSIN DD *

REPRO INFILE(INPUT) OUTFILE(OUTPUT) -

STARTAT(1000) STOPAT(9000)

//*********************************************************************

//* THIS STEP COPIES THE INPUT FILE TO THE OUTPUT FILE. REPRO

//* MEANS REPORDUCE THE FILE, WHICH IS REALLY A COPY

//* STOPAT(9000) MEANS IT WILL COPY FROM RECORD NUMBER 0001 AND

//* STOPAT(9000).

//*********************************************************************

//STEP0003 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//INPUT DD DSN=TSGBKXR.KANNAN.SOURCE,DISP=SHR

//OUTPUT DD DSN=TSGBAXC.BRANDNEW.SOURCE,DISP=SHR

//SYSIN DD *

REPRO INFILE(INPUT) OUTFILE(OUTPUT) -

STOPAT(9000)

//*********************************************************************************

//* THIS STEP CREATES INDEX FOR THE GDG OR IN OTHER WORDS, IT CREATES

//* A GDG BASE WHICH WILL BE POPULATED WHEN THE ACTUAL DATA IS BEING

//* BUILT.

//*********************************************************************************

//STEP0004 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//SYSIN DD *

GDG(TSGBAXC.CUMULATIVE.SALES.DATA) -

ENTRIES(12) -

NOSCRATCH –

NOEMPTY

//******************************************************************************

//* THIS STEP DELETES AN OLD CLUSTER

//******************************************************************************

//STEP0005 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//SYSIN DD *

DELETE(TSGBAXC.CUMULATIVE.SALES.DATA) -

CLUSTER


DELETE(TSGBAXC.CUMULATIVE.SALES.DATA) -

SCRATCH

//******************************************************************************

//* THIS STEP DEFINES A NEW CLUSTER

//******************************************************************************

//STEP0006 EXEC PGM=IDCAMS

//SYSPRINT DD SYSOUT=*

//SYSIN DD *

DEFINE CLUSTER –

NAME(TSGBAXC.CUMULATIVE.SALES.DATA) –

FILE(VSAMC1) -

VOLUMES(TVA11234) –

RECORDS(100 30) –

RECORDSIZE(2000 2000) –

UNIQUE -

CISIZE(1024) -

INDEXED –

KEYS(5 12) –

DATA –

NAME(TSGBAXC.CUMULATIVE.SALES.DATA) –

INDEX –

NAME(TSGBAXC.CUMULATIVE.SALES.INDEX)

NAME - The name assigned to the cluster itself or data component, or index

Component

FILE - Specifies the ddname of a DD statement that defines the volume

that will contain the data space

VOLUMES - The Volume Serial Number that will contain the cluster

RECORDS - The space allocation for the cluster. RECORDS, TRACKS, or

CYLINDERS specifies the unit of allocation. The first operand

within the parenthesis specifies the primary allocation and the

second operand specifies the secondary allocation, just as we do in

regular new data representation

RECORDSIZE - The average and the maximum record size

UNIQUE - Specifies that a data space needs to be created for this cluster

CISIZE - The unit of direct-access storage that VSAM transfers between disk

storage and virtual storage when an I-O request is made, is called a

CONTROL INTERVAL. It should always be a multiple of 512K

INDEXED - The file organization is key-sequenced

KEYS - The length and offset of the record key

DATA NAME - Specifies the actual VSAM dataset name


INDEX NAME - Specifies the index name about where the data can be found just like the

beginning of a book, where it says, which chapter can be found in what page.

MODEL - Specifies the name of a particular cluster from where the missing parameters

need to be copied, such as MODEL(TSGBAXC.EASTERN.SALES.DATA)




What is an Utility Program?

A utility program is a set of generalized programs, written by IBM, which can be used for common data processing functions. However, these programs cannot help a programmer to actively test his/her program but definitely assist him/her in some other way to test their program, by preparing a set of test data, selecting a set of data with specific testing conditions, etc.

For example, a tape dataset needs to be copied to paper. It is possible to write a program to do that, but IBM made it easy by providing a utility program IEBGENER to do just that without letting the programmer write a new program to perform this small function. Industry information shows that IEBGENER is the most extensively used utility program in all IBM mainframe environment.

WHAT IS A MAINFRAME?

WHAT IS A MAINFRAME, AND WHY IT IS CALLED THAT WAY

A Mainframe is a computer, larger, rather much larger compared to a Personal Computer, that we are so used to see in the desk of so many people in the office or at home. There is no fixed reason or naming principle behind the scenario, of calling it a Mainframe Computer. In the rule of thumb, it is called as a Mainframe primarily for the following reasons:

¨ It has a very powerful CPU or Central Processing Unit¨ It can handle a variety of softwares

¨ It can handle a variety of programming language

¨ It can support all kinds of applications, regardless of its type, such as business processing or scientific processing and so many other types

¨ It can support a variety of storage devices

¨ The storage procedure is highly scientific and also highly organized

¨ It can also support a variety of databases

¨ It can support a large number of users at any particular point of time

¨ It can process a volume of data in a very high speed


Types of JCL

There are eight types of JCL, which are in use in the Mainframe Industry. They are:

· JOB

· EXEC

· DD

· PROC

· PEND

· DELIMITER

· COMMENT

· NULL.

Tuesday, October 26, 2010

SQL Data Definition Language (DDL)

The Data Definition Language (DDL) part of SQL permits database tables to be created or deleted. We can also define indexes (keys), specify links between tables, and impose constraints between database tables.
The most important DDL statements in SQL are:
• CREATE TABLE - creates a new database table
• ALTER TABLE - alters (changes) a database table
• DROP TABLE - deletes a database table
• CREATE INDEX - creates an index (search key)
• DROP INDEX - deletes an index