|Q. How is IEBCOMPR Utility program used? What is its purpose?|
|IEBCOMPR is used to compare two datasets. If they match, that is if they are mirror images of each other, exactly identical, condition code return is 0. The two datasets being compared must have the same record length. The IEBCOMPR utility has this format. |
The two datasets, that need to be compared are given as SYSUT1 and SYSUT2. IEBCOMPR has one important control card COMPARE. This indicates the type of dataset being compared ; if you are comparing two Physical Sequential datasets, the COMPARE control card should be PS. If you are comparing two Partitioned Datasets(PDS), the COMPARE should be PO.
Note : By default COMPARE control card has TYPORG set to PS.
|Q. What is SORT Utility used for? How does SORT work?|
|The SORT Utility is used to sort data records in a datset. Apart from this it can be used to copy selective data, merge previously sorted datasets, remove duplicates in a dataset etc. Hence, SORT is one of the most important IBM Utilities. |
The general syntax for SORT JCL/Batch JOB is as follows :
In order to sort, we must supply SORTIN Card with the Input dataset, which contains the original data records. We must also supply SORTOUT Card, which gives the name of the Output Dataset, where the sorted output records should be printed.
Let me show you one typical SORT JCL/Job Stream, which shows the different Input Output Datasets needed.
So, we can draw a simple schematic which illustrates the above idea. I hope this would make it sink into your mind...
SORT Utility requires SORT Control Card. The SORT Control Statement has an action word FIELD. The SORT Control Statement tells the SORT program, which are the key fields in the file according to which it should be sorted. It tells the starting column of the key field, the length of the key field, the type of data CH-Character, BI-Binary. It also specifies, whether we want to sort in Ascending order(A) or Descending Order(D).
The SORT Control Card has the following syntax :
Suppose we have an input dataset that contains records in the following format :
AGENT-ID POLICY-NO SUM-ASSURED
Suppose we, want to sort the dataset in increasing(ascending) order of
AGENT-ID. That is, we are using AGENT-ID as a key to sort the dataset. Then, we must write the SORT Control Card as :
In the data, 1 Agent can sell 2 or more insurance policies. For example,
AGENT-ID A6003 has sold both Policy-No 10 and Policy-NO 70. Then, how to sort? In that case, we can specify another secondary key, which comes into picture only when the primary key AGENT-ID is the same for two records. If we want the secondary key to be POLICY-NO, then we can code the SORT Control Card as,
More on Sorting Here >>
Friday, July 10, 2009
Technorati Tags: IBM Utilities,IEBCOMPR,IBM Utilities Tutorial,Using SORT,Using IEBCOMPR,IEBCOMPR JCL,JCL,Tutorial,SORT,Comparing,Comparing two datasets,Comparision of 2 datasets,COMPARE,COMPARE Control Statement,COMPARE Control Card,TYPORG Action word,PS,PO,Comparing Sequential Datasets,SORT Utility,DFSORT,Sorting a dataset,SORT JCL,Quasar Chunawalla,SORT Control Card,SORT Control Statement,SORTIN,SORTOUT,SORTWK,Removing duplicates,Removing Duplicate records,Filtering records,merging two datasets,Primary key,Secondary Key