03 - IEBCOMPR and Sort Utility
03 - IEBCOMPR and Sort Utility
03 - IEBCOMPR and Sort Utility
2 TUTORIAL, CICS
Bulletin Board
Whats new at MAINFRAMES 360
(Updates)...
Mainframes360 Search
Search
powered by
Quick Links
IBM Utilities Tutorial 03 : IEBCOMPR and SORT ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS
Jump to :
<== Previous Tutorial
-------
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.
//HERC04
JOB
A123,QUASAR
//STEP01
EXEC
PGM=IEBCOMPR
//SYSPRINT
DD
SYSOUT=A
//SYSUT1
DD
DSN=data-set1
//SYSUT2
DD
DSN=data-set2
//SYSIN
DD
TYPORG=
dataset-type(PS or PO)
COMPARE
/*
//
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 :
//HERC03A
JOB
A123,QUASAR
//STEP01
EXEC
PGM=SORT
//SYSOUT
DD
//SYSPRINT
DD
SYSOUT=*
//SORTIN
DD
DSN=input-dataset
//SORTOUT
DD
DSN=SORTED-output-dataset
IBM Utilities Tutorial 03 : IEBCOMPR and SORT ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS
//SYSIN
DD
Control
Statements
go here
/*
//
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.
IBM Utilities Tutorial 03 : IEBCOMPR and SORT ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS
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
Control Statement tells the SORT program, which are the key fields in the file according to which
should be sorted. It tells the starting column of the key field, the length of the key field, the
of data CH-Character, BI-Binary. It also specifies, whether we want to sort in Ascending order(A)
Descending Order(D).
The SORT Control Card has the following syntax :
http://www.mainframes360.com/2009/07/ibm-utilities-tutorial-03-iebcompr-and.html (4 of 11)12/23/2009 4:17:10 AM
SORT
it
type
or
IBM Utilities Tutorial 03 : IEBCOMPR and SORT ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS
SORT FIELDS=(start-column-of-key-field,key-field-length,type,order)
Suppose we have an input dataset that contains records in the following format :
AGENT-ID
POLICY-NO
SUM-ASSURED
A6003
10
100000
A0901
20
200000
A1015
30
300000
A4082
40
400000
A0901
50
500000
A8221
60
600000
A6003
70
700000
A0901
80
800000
0 comments:
Post a Comment
IBM Utilities Tutorial 03 : IEBCOMPR and SORT ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS
Quick Links
Jump to :
<== Previous Tutorial
-------
Note :
Copyright Quasar Chunawalla, Tata Consultancy Services,2009.
Note : The copyrights of all the material, text and pictures posted in this website
belong to the author. Any instance of lifting the material from this website, shall
be considered as an act of plagiarism. For any clarifications, please mail at quasar.
chunawala@tcs.com
IBM Utilities Tutorial 03 : IEBCOMPR and SORT ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS
Globe-trotting
Some Excerpts from Mainframes360
Q. What are the two broad types of Applications/Systems?
All application/systems are of 2 types
(i) Online Systems(Transaction Processing Systems)
(ii)Batch Processing Systems. Read more ...
Q. What is the DATA DIVSION? What are the different sections in the DATA DIVISION?
DATA DIVISION is used to describe the Input Output Storage areas and temporary storage areas. In other words, itll describe the
structure of the data being stored in Input Output Files, as well as in any temporary storage. Read more ...
IBM Utilities Tutorial 03 : IEBCOMPR and SORT ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS
paragraph under the FILE SECTION. Remember, that FD paragraph is always coded in AREA A. Read more ...
Q. What is JOB Log? Why do we need a JOB Log? What purpose does it serve?
When you submit a Batch JOB/JCL to the MVS System, the MVS executes the Job Stream, makes the necessary resources available to the
the EXEC PGM (Program), and finally tells you the result of the Job. Read more ...
Q. In the previous tutorial, youve stated what is compiling, linking and running.. Can you show me a Compiler and
Linking JCL/Job Stream that does this?
Sure, as you know, the Compiler takes a SYSIN DD Input Dataset, which is the Source COBOL Program. The COBOL Compiler IGYWC(or
IGYCRCTL) produces SYSOUT DD Dataset containing the JOB Log and Status messages, and more importantly, SYSLIN DD which is Object
Module and Input for the Linker. Read more ...
Q. What is the ENVIRONMENT DIVISION? What purpose does it serve in the COBOL Program?
The ENVIRONMENT DIVISION provides information about the computer equipment/configuration upon which the COBOL program will run. It
also gives the name of the input and output files used in the program. It assigns the file-names to ddnames(DD Statements in the
Run JCL). Read more ...
Q. What does a Mainframe Computer look like? How do you operate it?
Lets just try to see whats life like, if you are Mainframe machines operator. A Desktop computer can fit into a trolley or a
cabinet. A Mainframe Machine is generally big monster-size, would fill up a room. On a Desktop PC, you would sit near the physical
computer and operate it using the keyboard and the mouse, and see the result on the monitor. Read more ...
Q. Hey, Windows is the most popular Operating System on a Desktop-PC. On the same lines, the popular Mainframes
Operating System is MVS...
Bulls-eye! In fact, MVS is said to be the Operating System that makes the world move. Read more ...
IBM Utilities Tutorial 03 : IEBCOMPR and SORT ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS
kind. Think of task, where we have 1,00,000 records of Input data, and we want to perform 3 calculations on each record, and then
put the Output Records in a separate file. Read more ...
Q. Look, on Windows PC, you interact with the computer using the Windows GUI the Desktop Icons, the Menus,
Buttons etc. How do you interact with an MVS Mainframe System?
MVS offers several ways to interact with it. The 3 main ways of interacting with MVS are TSO, ISPF and CICS. Read more ...
Q. What does COBOL stand for? What are the application areas where COBOL Programs written?
COBOL stands for Common Business Oriented Language. COBOL Programs are used for commercial data processing. COBOL is an Englishlike language. Writing a COBOL program is just like writing a passage in English. Read more ...
Q. You said COBOL Programming language bears resemblance with English. Do COBOL Programs have paragraphs like in
English?
A COBOL Program consists of 4 main divisions : IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION and PROCEDURE DIVISION.
IDENTIFICATION DIVISION is used to identify the COBOL Program to the system. It tells the... Read more ...
Q. Paragraphs in the English language are indented. Do you have indentation/alignment rules in COBOL?
Just like paragraphs in English, COBOL Divisions and Paragraphs must follow strict alignment rules. The way we indent paragraphs in
English, you must indent different Divisions, sections and paragraphs in a COBOL Program. When you write .. Read more ...
Q. What does the PROCEDURE DIVISION look like? Whats the format/syntax. Can you elaborate..
http://www.mainframes360.com/2009/07/ibm-utilities-tutorial-03-iebcompr-and.html (9 of 11)12/23/2009 4:17:11 AM
IBM Utilities Tutorial 03 : IEBCOMPR and SORT ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS
The PROCEDURE DIVISION indicates the entry-point or starting point of the COBOL Program. This is where the computer system begins
to run(execute the COBOL instructions). Hence, all your instructions/programming logic must be written inside this PROCEDURE
DIVISION. Read more ...
Q. How do you compile a COBOL Program? What is meant by Linking a COBOL Program? Finally, how do you run the
Program on a Mainframe System?
Compiling a COBOL Program : COBOL is a high-level language. The Mainframe Computer System only understands binary Machine Language
0 and 1. Thus, your COBOL Program has to be translated from COBOL Language to Binary Machine Language. So, you give the Program in
COBOL Language as Input to the Translator(Compiler), and you get the Output Program in Binary Machine Language. Read more ...
Q. Could you throw some light on the WORKING-STORAGE SECTION of a COBOL Program?
The WORKING-STORAGE SECTION is used to declare any fields or records that are not going to be used in input files, or output files,
but they are used to store the intermediate results of processing in a temporary storage area. Read more ...
Navigation
Navigation
- Main Page
- Questions Archive
- Articles and Writing
Tutorials
+
+
+
+
-
JCL Tutorials(12)
IBM Utilities Tutorials(08)
COBOL Tutorials(08)
DB2 Tutorials
VSAM Tutorials
CICS Tutorials
REXX Tutorials
ISPF Panel Programming
FAQs
- How do I learn Mainframes?
- Coaching and Institutes
- Mail me
- JOB Prospects
- Idea behind Mainframes 360
IBM Utilities Tutorial 03 : IEBCOMPR and SORT ~ MAINFRAMES TUTORIAL, JCL TUTORIAL, VSAM TUTORIAL, COBOL TUTORIAL, DB2 TUTORIAL, CICS
Technorati
Add this blog to your favourites..
Subscribe To
Posts
Comments
About Me
Quasar Chunawalla
Chennai, Tamil Nadu, India