Mainframes Refresher
Mainframes Refresher
CONTENTS
No
Particulars
Page No
TSO Commands
COBOL Tutorial
43
46
JCL
49
JCL Utilities
73
JCL FAQs
83
CICS Tutorial
92
116
10
CICS FAQs
121
11
DB2 Tutorial
126
12
DB2 Utilities
144
13
DB2 FAQs
146
14
154
15
File-Aid Tool
172
16
Endevor Tool
207
17
214
18
Domain - Telecom
232
19
PL/I
252
TSO Commands
Message-id = MSGID
Displays the Message-id of the last message.
RECEIVE
The TSO/E Interactive Data Transmission Facility RECEIVE command allows you to
obtain files transmitted to your userid. The RECEIVE command queries the Job Entry
Subsystem
RECEIVE INDS('your xmi.ps')
DSLIST
SAVE /VDL
Save the data set list in log data set
QPRINT
-2-
TSO PROFILE
The profile command is used either to specify to the system certain user characteristics
which are to be used to control the flow of information to and from the terminal or to list
the user profile. The user profile is retained throughout each terminal session unless the
user wishes to change it by issuing the profile command again and specifying the
appropriate operands.
CUT DISPLAY
This command when given while a member is opened in view/edit mode will show the
Clipboard manager. The Clipboard can then be browsed or deleted.
KEYLIST
Displays the Keylist utility. Invoking KEYLIST OFF can disable it.
KEYS
o If the KEYLIST is ON, it displays the keys of current Keylist.
o If the KEYLIST is OFF, it displays the Primary keys definition.
PFSHOW
Displays the value of all the PFKEYS on the panel.
They can be removed from the panel by invoking PFSHOW OFF
SCRNAME ON
Displays the screen name of the Top Left corner. We can give our own screen name to
any screen by writing "SCRNAME myscrname"
SWAP LIST
Displays the Active ISPF logical Sessions.
LANGUAGE PROCESSING COMMANDS
ASM
Invoke assembler prompter and assembler f compiler.
CALC
Invoke itf:pl/1 processor for desk calculator mode.
COBOL
Invoke cobol prompter and ans cobol compiler.
FORT
-3-
CALL
Load and execute the specified load module.
LINK
Invoke link prompter and linkage editor.
LOADGO
Load and execute program.
RUN
Compile, load, and execute program.
TEST
Test user program.
TESTAUTH
Test apf authorized programs.
DATA MANAGEMENT COMMANDS
ALLOCATE
ALLOCATE A DATA SET WITH OR WITHOUT AN ATTRIBUTE LIST OF DCB
PARAMETERS.
ALTLIB
DEFINE OPTIONAL, USER-LEVEL OR APPLICATION-LEVEL SETS OF LIBRARIES
CONTAINING SAA/PL EXECS OR CLISTS. THESE LIBRARIES ARE SEARCHED
WHEN IMPLICITLY INVOKING AN SAA/PL EXEC OR CLIST.
ATTRIB
ALLOW DCB PARAMETERS TO BE DYNAMICALLY INTRODUCED AND NAMED FOR
USE WITH A SUBSEQUENT ALLOCATE COM.
-4-
CONVERT
SIFT ITF/PL1 AND FORTRAN SOURCE.
COPY
COPY A DATA SET. (SEE NOTE BELOW.)
DELETE
DELETE A DATA SET.
EDIT
CREATE, EDIT, AND/OR EXECUTE A DATA SET.
FORMAT
FORMAT AND PRINT A TEXT DATA SET. (SEE NOTE BELOW.)
FREE
RELEASE A DATA SET AND/OR AN ATTRIBUTE LIST.
LIST
DISPLAY A DATA SET. (SEE NOTE BELOW.)
LISTALC
DISPLAY ACTIVE DATA SETS.
LISTBC
DISPLAY MESSAGES FROM OPERATOR/USER.
LISTCAT
DISPLAY USER CATALOGUED DATA SETS.
LISTDS
DISPLAY DATA SET ATTRIBUTES.
MERGE
COMBINE DATA SETS. (SEE NOTE BELOW).
-5-
PRINTDS
PRINT A DATA SET.
PROTECT
PASSWORD PROTECT DATA SETS.
RENAME
RENAME A DATA SET.
TSOLIB
DEFINE OPTIONAL SEARCH LEVEL THAT TSO/E USES WHEN SEARCHING FOR
COMMANDS AND PROGRAMS.
SYSTEM CONTROL COMMANDS
ACCOUNT
MODIFY/ADD/DELETE USER ATTRIBUTES.
CONSOLE
PLACE TERMINAL IN CONSOLE MODE.
OPERATOR
PLACE TERMINAL IN OPERATOR MODE.
PARMLIB
LIST/UPDATE TSO/E DEFAULTS.
RACONVRT
UADS TO RACF DATA BASE CONVERSION UTILITY.
SYNC
SYNCHRONIZE THE BROADCAST DATA SET WITH USER IDS FROM THE UADS
AND RACF DATA BASE.
-6-
SESSION CONTROL
CONSPROF
DEFINE USER CONSOLE CHARACTERISTICS.
EXEC
INVOKE COMMAND PROCEDURE.
EXECUTIL
ALTER REXX ENVIRONMENT.
HELP
INVOKE HELP PROCESSOR.
LOGOFF
END TERMINAL SESSION.
LOGON
START TERMINAL SESSION.
PROFILE
DEFINE USER CHARACTERISTICS.
SEND
SEND MESSAGE TO OPERATOR/USER.
TERMINAL
DEFINE TERMINAL CHARACTERISTICS.
TIME
LOG SESSION USAGE TIME.
TSOEXEC
EXECUTE AN AUTHORIZED OR UNAUTHORIZED COMMAND FROM WITHIN AN
UNAUTHORIZED ENVIRONMENT.
WHEN
-7-
CANCEL
CANCEL BACKGROUND JOB.
OUTPUT
DIRECT OUTPUT MEDIUM FOR BACKGROUND JOB.
STATUS
LIST STATUS OF BACKGROUND JOB.
SUBMIT
SUBMIT BACKGROUND JOB.
INTERACTIVE
DATA TRANSMISSION FACILITY.
RECEIVE
RECEIVE DATA SENT TO YOU BY A TRANSMIT COMMAND.
TRANSMIT
TRANSMIT MESSAGES AND/OR DATA SETS VIA NODES DEFINED TO JES
-8-
COBOL Tutorial
Computer Programming
A Program is a set of instructions that enables a computer to process data, there are two types of
computer programs which are 1- Operating system programs, which control the overall operation
of the system and 2- Applications programs, it is the actuall program tasks requried by the users.
THe term used to descriebe all type of programs is called software in general application program
reads input , process it, and produce information or out put the user neads. A set of computerized
business procedures in an application area is called an information systems.
Application program development process
1. Determain program specifications.
2. Design the program planning tools.
3. Code and enter the program.
4. Compile the program.
5. Test the program.
6. Document the program.
History of Cobol.
Developed by 1959 by a group called COnference on Data Systems Language (CODASYL). First
COBOL compiler was released by December 1959.
First ANSI approved version
1968
Modified ANSI approved version 1974 (OS/VS COBOL)
Modified ANSI approved version 1985 (VS COBOL 2)
This book is written based on IBM COBOL for OS/390 V2R2.
Interduction to Cobol
COBOL is a high-level programming language first developed by the CODASYL Committee
(Conference on Data Systems Languages) in 1960. Since then, responsibility for developing new
COBOL standards has been assumed by the American National Standards Institute (ANSI).
The word COBOL is an acronym that stands for COmmon Business Oriented Language. As the
the expanded acronym indicates, COBOL is designed for developing business, typically fileoriented, applications. It is not designed for writing systems programs. For instance you would not
develop an operating system or a compiler using COBOL
Coding Sheet.
1-6
-9-
7
8-11
12-72
73-80
Continuity (-), Comment (*), Starting a new page (/), Debugging lines (D)
Column A -Division, Section, Paragraph, 01,77 declarations must begin here.
Column B -All the other declarations/statements begin here.
Identification field. It will be ignored by the compiler but visible in the source listing.
Language Structure.
Character
Set
Word
Clause
Statement
Sentence
Paragraph
Section
Division
Program
Digits (0-9), Alphabets (A-Z), Space (b), Special Characters (+ - * / ( ) = $ ; " > < .
,)
:- One or more characters- User defined or Reserved.
:- One or more words. It specifies an attribute for an entry.
:- One or more valid words and clauses.
:- One or more statements terminated by a period.
:- One or more sentences.
:- One or more paragraphs.
:- One or more sections or paragraphs.
:- Made up of four divisions.
:-
Divisions in COBOL.
There are four divisions in a COBOL program and Data division is optional.
1. Identification Division.
2. Environment Division.
3. Data Division.
4. Procedure Division.
Identification Division.
This is the first division and the program is identified here. Paragraph PROGRAM-ID followed by
user-defined name is mandatory. All other paragraphs are optional and used for documentation.
The length of user-defined name for IBM COBOL is EIGHT.
IDENTIFICATION DIVISION.
PROGRAM-ID.
PROGRAM NAME.
AUTHOR.
COMMENT ENTRY.
INSTALLATION. COMMENT ENTRY.
DATE-WRITTEN. COMMENT ENTRY.
DATE-COMPILED. COMMENT ENTRY.
SECURITY.
COMMENT ENTRY.
Security does not pertain to the operating system security, but the information that is passed to
the user of the program about the security features of the program.
- 10 -
Environment Division.
Only machine dependant division of COBOL program. It supplies information about the hardware
or computer equipment to be used on the program. When your program moves from one
computer to another computer, the only section that may need to be changed is ENVIRONMENT
division.
Configuration
Section.
Input-Output
Section.
Data Division.
Data division is used to define the data that need to be accessed by the program. It has three
sections.
FILE SECTION
describes the record structure of the files.
WORKING-STORAGE SECTION is used to for define intermediate variables.
is used to access the external data.
LINKAGE SECTION
Ex: Data passed from other programs or from PARM of JCL.
Literals, Constants, Identifier,
1. Literal is a constant and it can be numeric or non-numeric.
2. Numeric literal can hold 18 digits and non-numeric literal can hold 160 characters in it.
- 11 -
Declaration of variable
Level# $ {Variable/Filler} $ Picture clause $ Value clause $ Usage Clause $ Sync clause.
Level#
It specifies the hierarchy of data within a record. It can take a value from the set of integers
between 01-49 or from one of the special level-numbers 66 77 88
01 level
02-49
levels
66 level
77 level
88 level
Specifies the record itself. It may be either a group item or an Elementary item. It
must begin in Area A.
Specify group or elementary items within a record. Group level items must not have
:picture clause.
:- Identify the items that contain the RENAMES clause.
:- Identify independent data item.
:- Condition names.
:-
- 12 -
PICTURE Clause
Describes the attributes of variable.
Numeric
Numeric
Edited
Non
Numeric
Exclusive
sets
1. + - CR DB
2. V '.'
3. $ + - Z * (But $ Can appear as first place and * as floating. $***.**)
DBCS (Double Byte Character Set) is used in the applications that support large character sets.
16 bits are used for one character. Ex: Japanese language applications.
Refreshing Basics
Nibble
Byte
Half word
Full word
Double word
:::::-
4 Bits is one nibble. In packed decimal, each nibble stores one digit.
8 Bits is one byte. By default, every character is stored in one byte.
16 bits or 2 bytes is one half word. (MVS)
32 bits or 4 bytes is one full word. (MVS)
64 bits or 8 bytes is one double word. (MVS)
Usage Clause
DISPLAY :- Default. Number of bytes required equals to the size of the data item.
Binary representation of data item.
PIC clause can contain S and 9 only.
S9(01) - S9(04) Half word.
COMP
:- S9(05) - S9(09) Full word.
S9(10) - S9(18) Double word.
Most significant bit is ON if the number is negative.
COMP-1 :- Single word floating point item. PIC Clause should not be specified.
COMP-2 :- Double word floating-point item. PIC Clause should not be specified.
Packed Decimal representation. Two digits are stored in each byte. Last nibble is for
COMP-3 :- sign. (F for unsigned positive, C for signed positive and D for signed negative)
Formula for Bytes: Integer ((n/2) + 1)) => n is number of 9s.
It is used for preserve the index value of an array. PIC Clause should not be
INDEX :specified.
- 13 -
VALUE Clause
It is used for initializing data items in the working storage section. Value of item must not exceed
picture size. It cannot be specified for the items whose size is variable.
VALUE IS literal.
Syntax: VALUES ARE literal-1 THRU | THROUGH literal-2
VALUES ARE literal-1, literal-2
Literal can be numeric without quotes OR non-numeric within quotes OR figurative constant.
SIGN Clause
Syntax - SIGN IS (LEADING) SEPARATE CHARACTER (TRAILING).
It is applicable when the picture string contain 'S'. Default is TRAILING WITH NO SEPARATE
CHARACTER. So 'S' doesn't take any space. It is stored along with last digit.
+1=A, +2=B, +3=C, +4=D, +5=E, +6=F, +7=G, +8=H, +9=I, -0=}, -1= J, -2= K, -3=L, -4=M, -5=N, 6=O, -7=P, -8=Q, -9=R
Number TRAILING SIGN (Default) LEADING SIGN LEADING SEPARATE
-125
12N
J25
-125
+125
12E
A25
+125
SYNC Clause and Slack Bytes
SYNC clause is specified with COMP, COMP-1 and COMP-2 items. These items are expected to
start at half/full/double word boundaries for faster address resolution. SYNC clause does this but
it may introduce slack bytes (unused bytes) before the binary item.
01 WS-TEST.
10 WS-VAR1 PIC X(02).
10 WS-VAR2 PIC S9(6) COMP SYNC.
Assumes WS-TEST starts at relative location 0 in the memory, WS-VAR1 occupies zero and first
byte. WS-VAR2 is expected to start at second byte. As the comp item in the example needs one
word and it is coded with SYNC clause, it will start only at the next word boundary that is 4th byte.
So this introduces two slack bytes between WS-VAR1 and WS-VAR2.
- 14 -
REDEFINES
The REDEFINES clause allows you to use different data description entries to describe the same
computer storage area. Redefining declaration should immediately follow the redefined item and
should be done at the same level. Multiple redefinitions are possible. Size of redefined and
redefining need not be the same.
Example:
01 WS-DATE
PIC9(06).
01 WS-REDEF-DATE WS-DATE.
05
WS-YEAR PIC9(02).
05
WS-MON PIC9(02).
05
WS-DAY
PIC9(02).
RENAMES
It is used for regrouping of elementary data items in a record. It should be declared at 66 level. It
need not immediately follows the data item, which is being renamed. But all RENAMES entries
associated with one logical record must immediately follow that record's last data description
entry. RENAMES cannot be done for a 01, 77, 88 or another 66 entry.
01
WS-REPSONSE.
05 WS-CHAR143
PICX(03).
05 WS-CHAR4
PICX(04).
SEX
88 MALE
PICX.
VALUE '1'
- 15 -
JUSTIFIED RIGHT
This clause can be specified with alphanumeric and alphabetic items for right justification. It
cannot be used with 66 and 88 level items.
OCCURS Clause
OCCURS Clause is used to allocate physically contiguous memory locations to store the table
values and access them with subscript or index. Detail explanation is given in Table Handling
section.
LINKAGE SECTION
It is used to access the data that are external to the program. JCL can send maximum 100
characters to a program thru PARM. Linkage section MUST be coded with a half word binary
field, prior to actual field. If length field is not coded, the first two bytes of the field coded in the
linkage section will be filled with length and so there are chances of 2 bytes data truncation in the
actual field.
01
LK-DATA.
05 LK-LENGTH
Meaning
Direct the program to take a specific action.
Ex: MOVE ADD EXIT GO TO
Decide the truth or false of relational condition and based on it, execute
different paths
. Ex: IF, EVALUATE
Directs the compiler to take specific action during compilation.
Ex: COPY SKIP EJECT
Terminate the scope of conditional and imperative statements.
Ex: END-ADD END-IF END-EVALUATE
The period at the end of any sentence, terminates the scope of all previous
statements not yet terminated.
MOVE Statement
It is used to transfer data between internal storage areas defined in either file section or working
storage section.
- 16 -
Syntax:
MOVE identifier1/literal1/figurative-constant TO identifier2 (identifier3)
Multiple move statements can be separated using comma, semicolons, blanks or the keyword
THEN.
Numeric move rules:
A numeric or numeric-edited item receives data in such a way that the decimal point is aligned
first and then filling of the receiving field takes place. Unfilled positions are filled with zero. Zero
suppression or insertion of editing symbols takes places according to the rules of editing pictures.
If the receiving field width is smaller than sending field then excess digits, to the left and/or to the
right of the decimal point are truncated.
Alphanumeric Move Rules:
Alphabetic, alphanumeric or alphanumeric-edited data field receives the data from left to right.
Any unfilled field of the receiving filed is filled with spaces. When the length of receiving field is
shorter than that of sending field, then receiving field accepts characters from left to right until it is
filled. The unaccomodated characters on the right of the sending field are truncated. When an
alphanumeric field is moved to a numeric or numeric-edited field, the item is moved as if it were in
an unsigned numeric integer mode. CORRESPONDING can be used to transfer data between
items of the same names belonging to different group-items by specifying the names of groupitems to which they belong.
MOVE CORRESPONDING group-1 TO group-2
Group Move rule
When MOVE statement is used to move information at group level, the movement of data takes
place as if both sending and receiving fields are specified as alphanumeric items. This is
regardless of the description of the elementary items constituting the group item.
Samples for understanding MOVE statement (MOVE A TO B)
Picture of A
Value of A
PIC 99V99
12.35
PIC 99V99
12.35
PIC99V999
12.345
PIC9(05)V9(03) 54321.543
PIC9(04)V9(02) 23.24
PIC99V99
00.34
PICX(04)
MUSA
Picture of B
Value of B after Move
PIC 999V99
012.35
PIC 9999V9999 0012.3500
PIC9V99
2.34
PIC 9(03)V9(03) 321.543
PICZZZ99.9
23.2
PIC$$$.99
$.34
XBXBXB
MUS
- 17 -
ARITHMETIC VERBS
All the possible arithmetic operations in COBOL using ADD, SUBTRACT, MULTIPLY and DIVIDE
are given below:
Arithmetic Operation
AB
ADD A TO B
A A+B
ADD A B C TO D
ADD A B C GIVING D
AB
AB
ADD A TO B C
A A+B A+C
SUBTRACT A FROM B
A B-A
SUBTRACT A B FROM C
AB
C-(A+B)
AB
MULTIPLY A BY B
A A*B
MULTIPLY A BY B GIVING C
AB
DIVIDE A INTO B
A B/A
AB
B/A
DIVIDE A BY B GIVING C
AB
A/B
C
C
A+B+C+D
A+B+C
C-(A+B)
A*B
ON SIZE ERROR
If A=20 (PIC 9(02)) and B=90 (PIC 9(02)), ADD A TO B will result 10 in B where the expected
value in B is 110. ON SIZE ERROR clause is coded to trap such size errors in arithmetic
operation.
If this is coded with arithmetic statement, any operation that ended with SIZE error will not be
carried out but the statement follows ON SIZE ERROR will be executed.
ADD A TO B ON SIZE ERROR DISPLAY 'ERROR!'.
- 18 -
COMPUTE
Complex arithmetic operations can be carried out using COMPUTE statement. We can use
arithmetic symbols than keywords and so it is simple and easy to code.
+ For ADD, - for SUBTRACT, * for MULTIPLY, / for DIVIDE and ** for exponentiation.
Rule: Left to right 1.Parentheses
2.Exponentiation
3.Multiplication and Division
4.Addition and Subtraction
Caution: When ROUNDED is coded with COMPUTE, some compiler will do rounding for every
arithmetic operation and so the final result would not be precise. 77 A PIC 999 VALUE 10
COMPUTE A ROUNDED = (A+2.95) *10.99
Result: (ROUNDED(ROUNDED(12.95) * ROUNDED(10.99)) =120 or ROUNDED(142.3205) =
142 So the result can be 120 or 142.
Be cautious when using ROUNDED keyword with COMPUTE statement.
All arithmetic operators have their own explicit scope terminators. (END-ADD, END-SUBTRACT,
END-MULTIPLY, END-DIVIDE, END-COMPUTE). It is suggested to use them.
CORRESPONDING is available for ADD and SUBTRACT only.
INITIALIZE
VALUE clause is used to initialize the data items in the working storage section whereas
INITIALIZE is used to initialize the data items in the procedure division. INITIALIZE sets the
alphabetic, alphanumeric and alphanumeric-edited items to SPACES and numeric and numericedited items to ZERO. This can be overridden by REPLACING option of INITIALIZE. FILLER,
OCCURS DEPENDING ON items are not affected.
Syntax:
ACCEPT
ACCEPT can transfer data from input device or system information contain in the reserved data
items like DATE, TIME, DAY.
ACCEPT WS-VAR1 (FROM DATE/TIME/DAY/OTHER SYSTEM VARS).
If FROM Clause is not coded, then the data is read from terminal. At the time of execution, batch
program will ABEND if there is no in-stream data from JCL and there is no FROM clause in the
ACCEPT clause. DATE option returns six digit current date in YYYYMMDD
DAY returns 5 digit current date in YYDDD
TIME returns 8 digit RUN TIME in HHMMSSTT
DAY-OF-WEEK returns single digit whose value can be 1-7 (Monday-Sunday respectively)
- 19 -
DISPLAY
It is used to display data. By default display messages are routed to SYSOUT.
Syntax: DISPLAY identifier1| literal1 (UPON mnemonic name)
STOP RUN, EXIT PROGRAM & GO BACK
STOP RUN is the last executable statement of the main program. It returns control back to OS.
EXIT PROGRAM is the last executable statement of sub-program. It returns control back to main
program.
GOBACK can be coded in main program as well as sub-program as the last statement. It just
gives the control back from where it received the control.
Collating Sequence
There are two famous Collating Sequence available in computers. IBM and IBM Compatible
machine use EBCDIC collating sequence whereas most micro and many mainframe systems use
ASCII collating sequence. The result of arithmetic and alphabetic comparison would be same in
both collating sequences whereas the same is not true for alphanumeric comparison
EBCDIC (Ascending Order) ASCII (Ascending Order)
Special Characters
Special Characters
a-z
0-9
A-Z
A-Z
0-9
a-z
Default collating sequence can be overridden by an entry in OBJECT-COMPUTER and SPECIAL
NAMES paragraphs.
1. Code the PROGRAM COLLATING SEQUENCE Clause in the Object computer paragraph.
PROGRAM COLLATING SEQUENCE IS alphabet-name
2. Map the alphabet-name in the SPECIAL-NAMES paragraph as follows:
ALPHABET alphabet-name is STANDARD-1 | NATIVE
NATIVE stands for computer's own collating sequence whereas STANDARD-1 stands for ASCII
collating sequence.
IF/THEN/ELSE/END-IF
The most famous decision making statement in all language is 'IF'. The syntax of IF statement is
given below: IF can be coded without any ELSE statement. THEN is a noise word and it is
optional.
If ORs & ANDs are used in the same sentence, ANDs are evaluated first from left to right,
followed by ORs.
This rule can be overridden by using parentheses. The permitted relation conditions are =, <, >,
<=, >=, <>
CONTINUE is no operation statement. The control is just passed to next STATEMENT.
NEXT SENTENCE passes the control to the next SENTENCE.
If you forgot the difference between statement and sentence, refer the first page. It is advised to
- 20 -
use END-IF, explicit scope terminator for the IF statements than period, implicit scope terminator.
IF condition1 AND condition2 THEN
Statement-Block-1
ELSE
IF condition3 THEN
CONTINUE
ELSE
IF condition4 THEN
Statement-Block-2
ELSE
NEXT SENTENCE
END-IF
END-IF
END-IF
Statement-Block-2 will be executed only when condition 1, 2 and 4 are TRUE and condition 3 is
FALSE.
Implied operand: In compound conditions, it is not always necessary to specify both operands for
each condition.
IF TOTAL=7 or 8 is acceptable. Here TOTAL=8 is implied operation.
SIGN test and CLASS test
SIGN test is used to check the sign of a data item. It can be done as follows IF identifier is POSITIVE/NEGATIVE/ZERO
CLASS test is used to check the content of data item against pre-defined range of values. It can
be done as follows IF identifier is NUMERIC/ALPHABETIC/ALPHABETIC-HIGHER/ALPHABETIC-LOWER
You can define your own classes in the special names paragraph. We have defined a class
DIGIT in our special names paragraph. It can be used in the following way. IF identifier is DIGIT
Negated conditions.
Any simple, relational, class, sign test can be negated using NOT.
But it is not always true that NOT NEGATIVE is equal to POSITIVE. (Example ZERO)
EVALUATE
With COBOL85, we use the EVALUATE verb to implement the case structure of other languages.
Multiple IF statements can be efficiently and effectively replaced with EVALUATE statement. After
the execution of one of the when clauses, the control is automatically come to the next statement
after the END-EVALUATE. Any complex condition can be given in the WHEN clause. Break
statement is not needed, as it is so in other languages.
General Syntax
- 21 -
EVALUATE
END-EVALUATE.
1.Number of Subjects in EVALUATE clause should be equal to number of objects in every WHEN
clause.
2.Subject can be variable, expression or the keyword TRUE/ FLASE and respectively objects can
be values, TRUE/FALSE or any condition.
3.If none of the WHEN condition is satisfied, then WHEN OTHER path will be executed.
Sample
EVALUATE
END-EVALUATE.
PERFORM STATEMENTS
PERFORM will be useful when you want to execute a set of statements in multiple places of the
program. Write all the statements in one paragraph and invoke it using PERFORM wherever
needed. Once the paragraph is executed, the control comes back to next statement following the
PERFORM.
1.SIMPLE PERFORM.
PERFORM PARA-1.
DISPLAY 'PARA-1 executed'
STOP RUN.
PARA-1.
Statement1.
Statement2.
It executes all the instructions coded in PARA-1 and then transfers the control to the next
instruction in sequence.
2.INLINE PERFORM.
When sets of statements are used only in one place then we can group all of them within
PERFORM END-PERFORM structure. This is called INLINE PERFORM. This is equal to
DO..END structure of other languages.
- 22 -
PERFORM
ADD A TO B
MULTIPLE B BY C
DISPLAY 'VALUE OF A+B*C ' C
END-PERFORM
3. PERFORM PARA-1 THRU PARA-N.
All the paragraphs between PARA-1 and PARA-N are executed once.
4. PERFORM PARA-1 THRU PARA-N UNTIL condition(s).
The identifiers used in the UNTIL condition(s) must be altered within the paragraph(s) being
performed; otherwise the paragraphs will be performed indefinitely. If the condition in the UNTIL
clause is met at first time of execution, then named paragraph(s) will not be executed at all.
5. PERFORM PARA-1 THRU PARA-N N TIMES.
N can be literal defined as numeric item in working storage or hard coded constant.
6. PERFORM PARA-1 THRU PARA-N VARYING identifier1
FROM identifier 2 BY identifier3 UNTIL condition(s) Initialize identifier1 with identifier2 and test
the condition(s). If the condition is false execute the statements in PARA-1 thru PARA-N and
increment identifier1 BY identifier3 and check the condition(s) again. If the condition is again
false, repeat this process till the condition is satisfied.
7.PERFORM PARA-1 WITH TEST BEFORE/AFTER UNTIL condition(s).
With TEST BEFORE, Condition is checked first and if it found false, then PARA-1 is executed
and this is the default. (Functions like DO- WHILE) With TEST AFTER, PARA-1 is executed once
and then the condition is checked. (Functions like DO-UNTIL)
EXIT statement.
COBOL reserved word that performs NOTHING. It is used as a single statement in a paragraph
that indicate the end of paragraph(s) execution. EXIT must be the only statement in a paragraph
in COBOL74 whereas it can be used with other statements in COBOL85.
GO TO Usage:
In a structured top-down programming GO TO is not preferable. It offers permanent control
transfer to another paragraph and the chances of logic errors is much greater with GO TO than
PERFORM. The readability of the program will also be badly affected.
But still GO TO can be used within the paragraphs being performed. i.e. When using the THRU
- 23 -
100-STEP-1.
ADD A TO B GIVING C.
IF D = ZERO DISPLAY 'MULTIPLICATION NOT DONE'
GO TO 300-STEP3
END-IF.
200-STEP-2.
MULTIPLY C BY D.
300-STEP-3.
DISPLAY 'VALUE OF C:' C.
Here GO TO used within the range of PERFORM. This kind of Controlled GO TO is fine with
structured programming also!
TABLES
An OCCURS clause is used to indicate the repeated occurrences of items of the same format in a
structure. OCCURS clause is not valid for 01, 77, 88 levels.
It can be defined as elementary or group item. Initialization of large table occurrences with
specific values are usually done using perform loops in procedure division. Simple tables can be
initialized in the following way.
01
Dynamic array is the array whose size is decided during runtime just before the access of first
element of the array.
01
WS-MONTH-DAY-CAL.
05 WS-DAYS OCCURS 31 TIMES DEPENDING ON WS-OCCURENCE.
Sl
Subscript
#
1 Working Storage item
Index
Internal Item-No need to declare it.
- 24 -
2 It means occurrence
Occurrence, in turn translated to displacement to
3 access elements and so slower than INDEX
access.
It can be used in any arithmetic operations or for
4
display.
Subscripts can be modified by any arithmetic
5
statement.
It means displacement
Faster and efficient.
It cannot be used for arithmetic operation
or for display purpose.
INDEX can only be modified with SET,
SEARCH and PERFORM statements.
Sometimes, you may face a question like how to randomly access the information in the
sequential file of 50 records that contains all the designation and the respective lower and higher
salary information.
Obviously, OS does not allow you to randomly access the sequence file. You have to do by
yourself and the best way is, load the file into a working storage table in the first section of the
program and then access as you wish.
The table look-up can be done in two ways.
-Sequential search.
-Binary search.
Sequential SEARCH
During SERIAL SEARCH, the first entry of the table is searched. If the condition is met, the table
look-up is completed. If the condition is not met, then index or subscript is incremented by one
and the next entry is searched and the process continues until a match is found or the table has
been completely searched.
SET indexname-1 TO 1.
SEARCH identifier-1 AT END display 'match not found:'
WHEN condition-1 imperative statement-1 /NEXT SENTENCE
WHEN condition-2 imperative statement-2 /NEXT SENTENCE
END-SEARCH
Identifier-1 should be OCCURS item and not 01 item.
Condition-1, Condition-2 compares an input field or search argument with a table argument.
Though AT END Clause is optional, it is highly recommended to code that. Because if it is not
coded and element looking for is not found, then the control simply comes to the next statement
after SEARCH where an invalid table item can be referred and that may lead to incorrect results /
abnormal ends.
SET statement Syntax:
SET index-name-1 TO/UP BY/DOWN BY integer-1.
Binary SEARCH
When the size of the table is large and it is arranged in some sequence -either ascending or
descending on search field, then BINARY SEARCH would be the efficient method.
SEARCH ALL identifier-1 AT END imperative-statement-1
WHEN dataname-1 = identifier-2/literal-1/arithmetic expression-1
AND dataname-2 = identifier-3/literal-2/arithmetic expression-2
END-SEARCH.
- 25 -
Identifier-2 and identifier-3 are subscripted items and dataname-1 and dataname-2 are working
storage items that are not subscripted.
Compare the item to be searched with the item at the center. If it matches fine, else repeat the
process with the left or right half depending on where the item lies.
Sl
Sequential SEARCH
#
1 SEARCH
2 Table should have INDEX.
Table need not be in
3
SORTED order.
Multiple WHEN conditions
4
can be coded.
Any logical comparison is
5
possible.
Index should be set to 1
6
before using SEARCH
Prefer when the table size
7
is small
Binary SEARCH
SEARCH ALL
Table should have INDEX.
Table should be in sorted order of the searching argument. There
should be ASCENDING/DESCENDING Clause.
Only one WHEN condition can be coded.
Only = is possible. Only AND is possible in compound conditions.
Index need not be set to 1 before SEARCH ALL.
Prefer when the table size is significantly large.
01
EMP-TABLE.
05
77
- 26 -
IDENTIFICATION DIVISION.
Example: PROGRAM-ID. PGMA
.....
IDENTIFICATION DIVISION.
PROGRAM-ID. PGMB
.....
END PROGRAM PGMB.
....
END PROGRAM PGMA.
If you want access any working storage variable of PGMA in PGMB, then declare them with the
clause 'IS GLOBAL' in PGMA. If you want to access any working storage variable of PGMB in
PGMA, declare them with the clause 'IS EXTERNAL' in PGMB. Nested Programs are supported
only in COBOL85.
If there is a program PGMC inside PGMB, it cannot be called from PGMA unless it's program id is
qualified with keyword COMMON.
SORT and MERGE
The programming SORT is called as internal sort whereas the sort in JCL is called external sort.
If you want to manipulate the data before feeding to sort, prefer internal sort. In all other cases,
external sort is the good choice. Internal sort, in turn invokes the SORT product of your
installation. (DFSORT). In the run JCL, allocate at least three sort work files. (SORT-WKnn => nn
can be 00-99).
FASTSRT compiler option makes the DFSORT to do all file I-O operation than your COBOL
program. It would significantly improve the performance. The result of the SORT can be checked
in SORT-RETURN register. If the sort is successful, the value will be 0 else 16.
Syntax:
SORT SORTFILE ON ASCENDING /DESCENDING KEY sd-key-1 sd-key2
USING file1 file2 / INPUT PROCEDURE IS section-1
GIVING file3 / OUTPUT PROCEDURE is section-2
END-SORT
File1, File2 are to-be-sorted input files and File3 is sorted-output file and all of them are defined in
- 27 -
FD.SORTFILE is Disk SORT Work file that is defined at SD. It should not be explicitly opened or
closed.
INPUT PROCEDURE and USING are mutually exclusive. If USING is used, then file1 and files
should not be opened or READ explicitly. If INPUT PROCEDURE is used then File1 and file2
need to be OPENed and READ the records one by one until end of the file and pass the required
records to sort-work-file using the command RELEASE.
Syntax:
RELEASE sort-work-record from input-file-record.
OUTPUT Procedure and GIVING are mutually exclusive. If GIVING is used, then file3 should not
be opened or WRITE explicitly. If OUTPUT procedure is used, then File3 should be OPENed and
the required records from sort work file should be RETURNed to it. Once AT END is reached for
sort-work-file, close the output file.
Syntax:
RETURN sort-work-file-name AT END imperative statement.
- 28 -
STRING MANIPULATION
A string refers to a sequence of characters. String manipulation operations include finding a
particular character/sub-string in a string, replacing particular character/sub-string in a string,
concatenating strings and segmenting strings. All these functions are handled by three verbs
INSPECT, STRING and UNSTRING in COBOL. EXAMINE is the obsolete version of INSPECT
supported in COBOL74.
INSPECT- FOR COUNTING
It is used to tally the occurrence of a single character or groups of characters in a data field.
INSPECT identifier-1 TALLYING identifier-2 FOR ALL/LEADING literal-1|identifier-3
[BEFORE|AFTER INITIAL identifier-4|literal-2] - Optional.
INSPECT identifier-1 TALLYING identifier-2 FOR CHARACTERS [BEFORE|AFTER INITIAL
identifier-4|literal-2] - Optional.
Main String is identifier-1 and count is stored in identifier-2. Literal-1 or Identifier-3 is a character
or group-of-characters you are looking in the main-string. INSPECT further qualifies the search
with BEFORE and AFTER of the initial occurrence of identifier-4 or literal-2.
Example:
WS-NAME - 'MUTHU SARAVANA SURYA CHANDRA DEVI'
INSPECT WS-NAME TALLYING WS-COUNT ALL 'S'
BEFORE INITIAL 'SARAVANA' AFTER INITIAL 'CHANDRA'
END-INSPECT
Result:
WS-COUNT contains - 1
INSPECT- FOR REPLACING
It is used to replace the occurrence of a single character or groups of characters in a data field.
INSPECT identifier-1 REPLACING ALL|LEADING literal-1|identifier-2 BY identifier-3|literal-2
[BEFORE|AFTER INITIAL identifier-4|literal-2] - Optional.
INSPECT identifier-1 REPLCING CHARACTERS BY identifier-2 BEFORE|AFTER INITIAL
identifier-3|literal-1
INSPECT-FOR COUNTING AND REPLACING It is a combination of the above two methods.
INSPECT identifier-1 TALLYING (tallying part ) REPLACING (replacing part)
STRING
STRING command is used to concatenate one or more strings.
Syntax:
STRING identifier-1 / literal-1, identifier-2/ literal-2 DELIMITED BY (identifier-3/literal-3/SIZE)
INTO identifier-4 END-STRING.
01 VAR1 PIC X(10) VALUE 'MUTHU '
01 VAR2 PIC X(10) VALUE 'SARA '
01 VAR2 PIC X(20).
- 29 -
Syntax:
String(Starting-Position:Length)
MOVE '18' TO AGE-OUT(1:2) does the same as what we did with STRING command.
When it is used in array elements, the syntax is Array-element (occurrence) (StartingPosition:Length)
UNSTRING
UNSTRING command is used to split one string to many strings.
Syntax:
UNSTRING identifier-1 [DELIMITED BY (ALL/) identifier2/literal1 [,OR (ALL/) (identifier-3/literal2),..]] INTO identifier-4 [,DELIMITER IN identifier-5, COUNT IN identifier-6] [,identifier-7
[,DELIMITER IN identifier-8, COUNT IN identifier-9]
01 WS-DATA PIC X(12) VALUE '10/200/300/1'.
UNSTRING WS-DATA DELIMITED BY '/'
INTO WS-FLD1 DELIMITER IN WS-D1 COUNT IN WS-C1
WS-FLD2 DELIMITER IN WS-D2 COUNT IN WS-C2
WS-FLD3 DELIMITER IN WS-D3 COUNT IN WS-C3
END-UNSTRING.
Result:
WS-FLD1 = 10 WS-FLD2 =200 WS-FLD3=300 WS-C1 = 2 WS-C2=3 WS-C3=3 WS-D1 = '/' WSD2='/' WS-D3 ='/'
ON OVERFLOW can be coded with STRING and UNSTRING. If there is STRING truncation then
the imperative statements followed ON OVERFLOW will be executed.
- 30 -
COPY Statement
A COPY statement is used to bring a series of prewritten COBOL entries that have been stored in
library, into a program.
1.Common routines like error routine, date validation routine are coded in a library and bring into
the program by COPY.
2. Master files are used in multiple programs. Their layout can be placed in one copybook and be
placed wherever the files are used. It promotes program standardization since all the programs
share the same layout and the same data names.
This reduces coding and debugging time. Change in layout needs change in copybook only. It is
enough if we just recompile the program for making the new copy effective.
Syntax:
COPY copybook-name [(OF/IN) library name]
[REPLACING string-to-be-replaced BY replacing-string]
Copybooks are stored as members in PDS library and during compilation time, they are included
into the program. By default, the copybook library is SYSLIB and it can be changed using IN or
OF of COPY statement.
Copybooks can be used in the following paragraphs.
SOURCE-COMPUTER, OBJECT-COMPUTER, SPECIAL-NAMES, FILE-CONTROL, IOCONTROL, FD SECTION, PARAGRAPHS IN PROCEDURE DIVISION.
If the same copybook is used more than once in the program, then there will be "duplicate data
declaration" error during compilation, as all the fields are declared twice. In this case, one
copybook can be used with REPLACING verb to replace high-level qualifier of the all the
variables with another qualifier.
Example:
COPY CUSTOMER REPLACING 'CUST1-' BY 'CUST2-'.
Delimiter '= =' should be used for replacing pseudo texts. The replacing option does not alter the
prewritten entries in the library; the changes are made to the user's source program only.
CALL statement (Sub-Programs)
When a specific functionality need to be performed in more than one program, it is best to write
them separately and call them into each program. Sub Programs can be written in any
programming language. They are typically written in a language best suited to the specific task
required and thus provide greater flexibility.
Main Program Changes:
CALL statement is used for executing the sub-program from the main program. A sample of
CALL statement is given below:
CALL 'PGM2' USING BY REFERENCE WS-VAR1, BY CONTENT WS-VAR2.
PGM2 is called here. WS-VAR1 and WS-VAR2 are working storage items.
WS-VAR1 is passed by reference. WS-VAR2 is passed by Content. BY REFERENCE is default
- 31 -
in COBOL and need not be coded. BY CONTENT LENGTH phrase permits the length of data
item to be passed to a called program.
Sub-Program Changes:
WS-VAR1 and WS-VAR2 are working storage items of main program.
As we have already mentioned, the linkage section is used for accessing external elements. As
these working storage items are owned by main program, to access them in the sub-program, we
need to define them in the linkage section.
LINKAGE SECTION.
01
LINKAGE SECTION.
05 LK-VAR1 PIC9(04).
05 LK-VAR2 PIC9(04).
In addition to define them in linkage section, the procedure division should be coded with these
data items for address-ability.
PROCEDURE DIVISION USING LK-VAR1,LK-VAR2
There is a one-one correspondence between passed elements and received elements (Call
using, linkage and procedure division using) BY POSITION. This implies that the name of the
identifiers in the called and calling program need not be the same (WS-VAR1 & LK-VAR1) but the
number of elements and picture clause should be same.
The last statement of your sub-program should be EXIT PROGRAM. This returns the control
back to main program. GOBACK can also be coded instead of EXIT PROGRAM but not STOP
RUN. EXIT PROGRAM should be the only statement in a paragraph in COBOL74 whereas it can
be coded along with other statements in a paragraph in COBOL85.
PROGRAM-ID. IS INITIAL PROGRAM.
If IS INITIAL PROGRAM is coded along with program-id of sub program, then the program will be
in initial stage every time it is called (COBOL85 feature). Alternatively CANCEL issued after
CALL, will set the sub-program to initial state.
If the sub program is modified then it needs to be recompiled. The need for main program
recompilation is decided by the compiler option used for the main program. If the DYNAM
compiler is used, then there is no need to recompile the main program. The modified subroutine
will be in effect during the run. NODYNAM is default that expects the main program
recompilation.
Difference between Pass-by-reference and Pass-by-content
Sl
Passl By Reference
#
CALL 'sub1' USING BY REFERENCE
1
WS-VAR1
It is default in COBOL. BY REFERENCE
2
is not needed.
3 Address of WS-VAR1 is passed
Pass By Content
CALL 'sub1' USING BY CONTENT WS-VAR1 (BY
CONTENT keyword is needed)
BY CONTENT key word is mandatory to pass an
element by value.
Value of WS-VAR1 is passed
- 32 -
3
4
5
6
7
8
DYNAMIC Call
INTRINSIC FUNCTIONS:
LENGTH
MAX
MIN
NUMVAL
NUMVAL-C
CURRENT
DATE
INTEGER OF
DATE
INTEGER OF
DAY
DATE OF
INTEGER
DAY OF
INTEGER
Returns the length of the PIC clause. Used for finding length of group item
that spanned across multiple levels.
:- Returns the content of the argument that contains the maximum value
:- Returns the content of the argument that contains the minimum value
Returns the numeric value represented by an alphanumeric character string
:specified in the argument.
Same as NUMVAL but currency and decimal points are ignored during
:conversion.
:-
- 33 -
Steps in file-handing
1.Allocation: The files used in the program should be declared in FILE-CONTROL paragraph of
environment division. The mapping with JCL DDNAME is done here. The file is allocated to your
program by this statement.
2.Definition. The layout of the file and its attributes are defined in the FILE SECTION of DATA
DIVISION.
3.Open: Dataset is connected/readied to your program using OPEN statement. The mode of
OPEN decides the operation allowed and the initial pointer in the dataset. For example, EXTEND
mode allows only write access and the pointer is kept on the end of file to append.
4.Process: Process the file as per requirement, using the I-O statements provided by COBOL.
(READ, WRITE, REWRITE and DELETE)
5. Close: After the processing, close the file to disconnect it from the program.
Allocation of file - SELECT Statement
(ENVIRONMENT-> INPUT-OUTPUT-> FILE-CONTROL)
SELECT [OPTIONAL] FILENAME ASSIGN to DDNAME
:- ALL Files
ORGANIZATION IS SEQUENTIAL/INDEXED/RELATIVE
:- ALL Files
ACCESS IS SEQUNETIAL/RANDOM/DYNAMIC
:- ALL Files
RECORD KEY IS FILE-KEY1
:- KSDS
RELATIVE KEY IS WS-RRN
:- RRDS
ALTERNARE RECORD KEY IS FILE-KEY2 WITH DUPLICATES
:- KSDS
ALTERNARE RECORD KEY IS FILE-KEY3 WITHOUT DUPLICATES :- AIX
FILE STATUS IS WS-FILE-STAT1
:- ALL Files
[,WS-FILE-STAT2]
:- VSAM Files
SELECT Statement- OPTIONAL Clause
This can be coded only for input files. If OPTIONAL is not coded, then the input file is expected to
present in JCL. If not, an execution error will occur. If OPTIONAL is coded, then if the file is not
mapped in JCL, it is considered as empty file and the first read results end of file. The file can
also be dynamically allocated instead of static allocation in JCL.
- 34 -
SELECT Statement-ORGANIZATION
It can be SEQUENTIAL (PS or VSAM ESDS), INDEXED (VSAM KSDS), RELATIVE (VSAM
RRDS). Default is Sequential.
SELECT Statement-ACCESS MODE
SEQUENTIAL.
It is default access mode and it is used to access the records ONLY in sequential order. To read
100th record, first 99 records need to be read and skipped.
RANDOM.
Records can be randomly accessed in the program using the primary/alternate key of indexed file
organization or relative record number of relative organization.100th record can directly be read
after getting the address of the record from the INDEX part for INDEXED files.100th record can
directly be read for RELATIVE files even without any index.
DYNAMIC.
It is mixed access mode where the file can be accessed in random as well as sequential mode in
the program. Example: Reading the details of all the employees between 1000-2000. First
randomly access 1000th employee record, then read sequentially till 2000th employee record.
START and READ NEXT commands are used for this purpose in the procedure division.
SELECT Statement-RECORD KEY IS
It is primary key of VSAM KSDS file. It should be unique and part of indexed record structure.
SELECT Statement-ALTERNATE RECORD KEY IS
This phrase is used for KSDS files defined with AIX. Add the clause WITH DUPLICATES if the
AIX is defined with duplicates. Referring to VSAM basics, every alternate index record has an
associated PATH and the path should be allocated in the JCL that invokes this program. The
DDNAME of the path should be DDNAME of the base cluster suffixed with 1 for the first alternate
record clause, suffixed with n for nth ALTERNATE RECORD KEY clause in SELECT clause.
- 35 -
Advantage of Blocking:
1.I-O time is reduced as n numbers of records are read into main memory buffer during an I-O.
2.Inter record gap is removed and the gap exist only between blocks. So memory wastage due to
IRG is avoided.
FD-RECORDING MODE IS
It can be F (FIXED) V(VARIABLE) FB(FIXED BLOCK) VB(VARIABLE BLOCKED)
If there is no recording mode/record contains clause, it is still possible to identify variable length
records. If there is an OCCURS depending on clause or there are multiple 01 levels and every 01
level is of different size, then the file would be of variable length. Multiple 01 level in File section is
an example for implicit redefinition.
FD-LABEL RECORDS Clause
As a general rule, LABEL RECORDS are STANDARD is coded for Disk and Tape files, LABEL
RECORDS ARE OMITTED is coded for printer files. In COBOL74, this clause is a mandatory
clause whereas COBOL85 made this as optional.
FD-DATA RECORD IS Clause
It is used to name the data record(s) of the file. More than one record can be coded here.
OPEN STATEMENT
Syntax:
OPEN OPENMODE FILENAME
OPENMODE can be INPUT OUTPUT I-O EXTEND
Syntax:
CLOSE FILENAME
OPEN and CLOSE for TAPE files - Advanced
If more than one file is stored in a reel of tape, it is called as multi-file volume. When one file is
stored in more than one reel of tape, it is called as multi-volume label. One reel is known as one
volume. When the end of one volume is reached, automatically the next volume opens. So there
is no special control is needed for multi volume files.
OPEN INPUT file-1 [WITH NO REWIND | REVERSED]
OPEN OUTPUT file-2 [WITH NO REWIND]
- 37 -
CLOSE file-3
CLOSE file-3
Syntax:
READ FILENAME [INTO ws-record] [KEY IS FILE-KEY1]
[AT END/INVALID KEY imperative statement1]
[NOT AT END/NOT INVALID KEY imperative statement2]
END-READ
If INTO clause is coded, then the file is directly read into working storage section record. It is
preferred as it avoids another move of file-section-record to working-storage-record followed by
simple READ. READ-INTO is not preferred for variable size records where the length of the
record being read is not known.
KEY IS clause is used while accessing a record randomly using primary/alternate record key.
AT END and NOT AT END are used during sequential READ of the file.
INVALID KEY and NOT INVALID KEY are used during random read of the file. Before accessing
the file randomly, the key field should have a value before READ.
- 38 -
WRITE Statement
Write statement is used to write a new record in the file. If the file is opened in EXTEND mode,
the record will be appended. If the file is opened in OUTPUT mode, the record will be added at
the current position.
Syntax:
WRITE FILE-RECORD [FROM ws-record]
[INVALID KEY imperative statement1]
END-WRITE
FROM clause avoids the explicit move of working storage record to file section record before
WRITE.
REWRITE Statement
REWRITE is used to update an already read record. To update a record in a file, the file should
be opened in I-O mode.
Syntax:
REWRITE FILE-RECORD [FROM ws-record]
[INVALID KEY imperative statement1]
END-REWRITE
START Statement
START is used with dynamic access mode of indexed files. It establishes the current location in
the cluster for READ NEXT statement. START itself does not retrieve any record.
Syntax:
START FILENAME KEY is EQUAL TO/NOT LESS THAN/GREATER THAN key-name
[INVALID KEY imperative statement1]
END-START.
DELETE Statement
DELETE is used to delete the most recently read record in the file. To delete a record, the file
should be opened in I-O mode.
Syntax:
DELETE FILENAME RECORD
[INVALID KEY imperative statement1]
END-DELETE.
- 39 -
Syntax:
- 40 -
Syntax:
SAME AREA FOR file-1 file-2 file-3.
If SAME RECORD AREA is coded, then the buffer is not shared but only the record area is
shared. So more than one file can be in open state. We should be careful while filling in the
record area of the output file. This may destroy the record read most recently.
Syntax:
SAME RECORD AREA FOR file-1 file-2 file-3.
SAME SORT AREA allows more than one sort/merge work files to use the same area. The sort
work files are automatically allocated when file is opened and de-allocated when file is closed. As
the sort file is automatically opened and closed during a SORT and two sort files cannot be
opened at a time, this clause may not be useful.
Syntax:
SAME SORT|SORT-MERGE AREA for file-1 file-2. File-1 or file-2 should be a SD file.
I-O CONTROL- RERUN Clause
RERUN ON rescue FOR EVERY integer RECORDS on file-1
This will cause checkpoint to be taken for every interger-1 records processing of file-1. If the
program ABENDED before the complete processing of the file-1, then the program will restart
from integer+1ST record instead of first record. The rescue file details should be mentioned
outside the program and it varies from installation to installation.
- 41 -
ENTRY statement
ENTRY statement establishes an alternate ENTRY point in a COBOL called sub-program. When
a CALL statement naming the alternate entry point is executed in a calling program, control is
transferred to the next executable statement following the entry statement. Except when a CALL
statement refers to an entry name, the ENTRY statements are ignored at run-time.
Matching Logic
If you have been given two files of similar type, say master and transaction file and you are
requested to update the master file with transaction file information for existing records and
prepare a report of new transactions and deleted transactions, then you should go for what is
called Matching logic. This is also known as co-sequential processing.
Sort both the files on key and compare the keys. If the keys are matching then update the file. If
you find any record that is found in transaction but not in master file, then that is new addition and
the reverse is deletion. If the master key is greater than transaction key, then that corresponds to
the first case and reverse is the second case.
This can be easily done in JCL using ICETOOL.
- 42 -
Explanation
N/A
N/A
INCONSISTENCY IN STORAGE
DEVICE.
N/A
10
14
16
20
INVALID KEY.
N/A
DUPLICATE KEY
23
24
30
No further information
34
21
22
- 43 -
ATEEMPTING TO OPEN AN
EMPTY FILE IN INPUT OR I/O
MODE. DD NAME IS MISSING OR
WRONGLY GIVEN.
37
37
39
ERROR DURING
OPENING.INCONSISTENCY
BETWEEN FILE DESC AND
ACTUAL FILE
40
41
ATTEMPT TO OPEN A FILE WHICH An OPEN statement was attempted for a file in the
IS ALREADY OPENED
open mode.
42
ATTEMPT TO CLOSE A FILE THAT A CLOSE statement was attempted for a file not in
IS NOT OPEN.
the open mode.
43
44
35
- 44 -
46
47
48
49
88
N/A
90
No further information.
91
PASSWORD FAILURE.
92
Logic error.
93
94
95
CONFLICTING ATTRIBUTES.
96
NO CORRESPONDING DD
STATEMENT FOR THE FILE.
97
Advertisement
- 45 -
Cobol Coding
Good COBOL Coding practices for better Modularity and Performance.
1.
Do not use 66 level. Planning of data definition should make this redundant
2.
Do not use 77 level. Collect all these together and group under a 01 level.
3.
4.
01
LEVEL1.
05
LEVEL-2.
10 LEVELPIC 9(02) COMP-3 VALUE ZEROES.
3
5.
PARAGRAPHs or SECTIONs should be used; they should not be mixed except when the
PARAGRAPH names are used to subdivide the SECTION. If this is used then only the SECTIONs
should be performed.
6.
It corresponds to the sequence/logical position in the structure of the code. This enables the
location to be easily ascertained in a listing and also allows the user to see where the program
has progressed to in the event of any problems.
7.
The SORT and MERGE statements should be avoided if at all possible, it is more efficient to use
an external sort, e.g. SYNCSORT/DFSORT, rather than calling the internal sort which also uses
one of these sorts. This is because with an internal sort, control is passed back to the program
after each record reducing the speed of the sort. It is also easier to debug a COBOL program than
it is to debug the dump from an internal sort abend. If SORT routines are used then the maximum
key length is 4092 bytes with no maximum number of keys. To increase the efficiency of the sort,
keep the key fields at the start of the record and as contiguous as possible.
8.
GOTO should never be used; a structured program should not need to use this command. If
however because of coding or processing constraints, then the only possible use is to transfer
control to the end of the SECTION or PARAGRAPH being processed. It MUST NOT be used in
any other case.
9.
Nested IF statements should be avoided and consideration should be given to the use of
EVALUATE as an alternative. The other option is to restructure the logic of the program so that
the if statement is either eliminated or simplified. The WHEN OTHER must always be coded; if
this is not present then if none of the prior conditions are satisfied then the program will fall
through with no processing occurring. The WHEN OTHER statement should always be the last
option; if it is not then all conditions following are irrelevant as they will not be tested.
- 46 -
Care should be taken when using STRING and UNSTRING as this may hide data structures.
When using these operations then the ON OVERFLOW clause should always be used; if this is
10.
not used then you are not notified of the incomplete operation and control passes to the next
sequential statement.
11. All structures are terminating with END-XXX.
12. The READ and WRITE PARAGRAPH/SECTIONS should be grouped together
For each file there should be a separate READ PARAGRAPH/SECTION with an AT END clause;
this should be performed in all cases and the AT-END condition tested for sequential files or the
return code. For each file there should be a separate READ section. This is to reduce the size of
13.
the load module as the machine instructions generated for the execution of a perform are less
than that for a READ; it also means that the file is only read in the one place rather than it
scattered throughout the program, easing maintenance.
An initial value of spaces or zero can be given to an item either in the DATA DIVISION or the
PROCEDURE DIVISION. In the latter division then there are two options for doing this, to move
14. an initial value to the individual items or to use in COBOL II onwards, the INITIALIZE statement.
The use of the VALUE field of the data division should be used to give an initial value to
constants.
For variables that are used in working storage the INITIALIZE statement should be used. The
INITIALIZE statement is limited in that it will only move spaces (to alphanumeric) or zeros (to
numeric) depending on the item definition. All numeric types are supported for this statement,
15.
zoned, packed, binary. If any other value is required as an initial value then this must be moved
separately, it is still the case that this should be done in the initialization PARAGRAPH or
SECTION that is performed prior to processing and at any other time as required.
How the table has been defined in the DATA DIVISION controls the access method used to
retrieve the data. If an index has been defined then the method used is SEARCH ALL if the data
16. is in key sequence (and BATCH), else use SEARCH; if there are more than 10 entries, and the
table will be heavily accessed consider sorting the data; if no index is present then use
PERFORM VARYING to retrieve the data.
An index is more efficient than a subscript; this is because a factor of the element size for the
table is built into the index, ensuring that the displacement from the start of the table is known for
the element and does not have to be calculated at run time as it does with subscripts. This
17. increases the speed at which the elements can be accessed when an index is used. If a table is to
be searched sequentially, then if possible put the occurrences that are more likely to satisfy the
requirements when a table is checked at the start. If the table is to be searched using a binary
search, then the items must be stored in ASCENDING/DESCENDING key sequence.
18.
Static call should be used when size is not an issue but speed is, or the program is called often.
Or else use Dynamic call.
- 47 -
Advertisement
- 48 -
JCL is not used to write computer programs. Instead it is most concerned with input/output--telling the operating system everything it needs to know about the input/output requirements. It
provides the means of communicating between an application program and the operating system
and computer hardware.
1.2 IS JCL DIFFICULT? ... NOT NECESSARILY!
The role of JCL sounds complex and it is---JCL can be downright difficult.
JCL can be difficult because of the way it is used. A normal programming language, however
difficult, soon becomes familiar through constant usage. This contrasts with JCL in which
language features are used so infrequently that many never become familiar.
JCL can be difficult because of its design - JCL:
consists of individual parameters, each of which has an effect that may take pages to
describe
has few defaults--must be told exactly what to do
requires specific placement of commas and blanks
is very unforgiving--one error may prevent execution
JCL is not necessarily difficult because most users only use a small set of similar JCL that never
changes from job to job.
1.3 HOW DO YOU SEND INFORMATION TO THE COMPUTER?
BATCH PROCESSING VS. INTERACTIVE PROCESSING
Interactive Processing means that you give the computer a command and the computer
responds to your command request. It is more like a conversation.
Batch Processing means that you give the computer a whole group of commands, usually in the
form of some sort of program you have written, and have the computer process this group of
commands. It is more like writing a letter.
- 49 -
OPERATION
OPERAND,OPERAND,OPERAND
COMMENTS
|
name
field
|
operation
field
|
operand field
|
comment
field
name field - identifies the statement so that other statements or the system can refer to it. The
name field must begin immediately after the second slash. It can range from 1 to 8 characters in
length, and can contain any alphanumeric (A to Z) or national (@ $ #) characters.
operation field - specifies the type of statement: JOB, EXEC, DD, or an operand command.
operand field - contains parameters separated by commas. Parameters are composites of
prescribed words (keywords) and variables for which information must be substituted.
comments field - optional. Comments can be extended through column 80, and can only be
coded if there is an operand field.
Interrupt the field after a complete operand (including the comma that follows it) at or
before column 71
Code // in columns 1 and 2 of the following line
Continue the interrupted statement beginning anywhere in columns 4 to 16.
- 50 -
4.1.1 MSGCLASS
The MSGCLASS parameter allows you to specify the output class to which the operating system
MVS is to write the job log or job entry subsystem (JES) messages. If you do not code the
MSGCLASS parameter, MSGCLASS=J is the default and will be used. MSGCLASS=J indicates
the output will be printed on 8 1/2" by 11" hole paper.
- 51 -
A greenbar paper
5-9 TSO held output
C-Z IBM page printer output classes. See chart in section "Sys-out Classes for IBM Print"
on page 28.
5. THE EXEC STATEMENT
Use the EXEC (execute) statement to identify the application program or cataloged or in-stream
procedure that this job is to execute and to tell the system how to process the job.
//stepname EXEC procedure,REGION=####K
or
//stepname EXEC PGM=program,REGION=####K
stepname - an optional 1 to 8 character word used to identify the step
EXEC - indicates that you want to invoke a program or cataloged procedure
procedure - name of the cataloged procedure to be executed
program - name of the program to be executed
REGION=####K - amount of storage to allocate to the job
5.1 PROGRAMS AND CATALOGED PROCEDURES
// EXEC PGM=pgmname
A program referred to on the EXEC PGM= statement is a compiled and linked version of a set of
source language statements that are ready to be executed to perform a designed task. It is also
known as an executable load module. It must reside in a partitioned dataset.
// EXEC cataloged-procedure-name
Because the same set of JCL statements are often used repeatedly with little or no change they
can be stored in cataloged procedures. JCL provides programmers with the option of coding
these statements only once, recording and cataloging the statements under an appropriate name
in a procedure library, and then invoking these statements through an EXEC statement. Such a
previously established set of JCL statements is known as a "cataloged procedure." The effect of
- 52 -
using a cataloged procedure is the same as if the JCL statements in the procedure appeared
directly in the input stream in place of the EXEC statement calling the procedure. This saves the
user from writing lengthy error-prone JCL statements. In short, this is JCL that does not have to
be included in batch jobs.
* Note that within cataloged procedures a program will be executed.
To modify an existing DD statement, only those operands to be changed need be coded on the
modifying DD statement. The remaining operands of the DD statement within the procedure will
be unchanged. If more than one DD statement in a procedure is to be modified, the modifying DD
statements must be placed in the same order as the original DD statements occur in the
procedure.
To add a DD statement to an existing procedure, place the DD statement after the procdure
invocation EXEC statement and any modified DD statements within the job step.
// EXEC SAS
//NEWDD DD DSN=user.file,DISP=SHR
When looking at your output, the following symbols will determine what kind of statement is
indicated when your job runs:
// Indicates JCL statements
XX Indicates cataloged procedure statements
X/ Indicates a modified cataloged procedures statement
6. DATA DEFINITION (DD) STATEMENT
- 53 -
A DD (Data Definition) statement must be included after the EXEC statement for each data set
used in the step. The DD statement gives the data set name, I/O unit, perhaps a specific volume
to use, and the data set disposition. The system ensures that requested I/O devices can be
allocated to the job before execution is allowed to begin.
The DD statement may also give the system various information about the data set: its
organization, record length, blocking, and so on.
//ddname DD operand,operand,etc.
ddname - a 1 to 8 character name given to the DD statement
DD - DD statement identifier
operand - parameters used to define the input or output dataset
The DD Statement
- 54 -
FORTRAN statements
/*
//GO.SYSIN DD *
data lines
/*
//
- 55 -
MGMTCLAS
RETAIN0
RETAIN1
RETAIN2
RETAIN3
RETAIN4
RETAIN5
RETAIN6
RETAIN7
Days Retention
0 (DEFAULT)
1
2
3
4
5
6
7
MGMTCLAS
RETAIN8
RETAIN9
RETAIN10
RETAIN14
RETAIN28
RETAIN56
RETAIN95
STANDARD
Days Retention
8
9
10
14
28
56
95
(18 months past last use)
- 56 -
//
read from
write to
create and catalog; delete if
- 57 -
// DISP=(OLD,PASS)
// DISP=MOD
secondary receive this amount of space each time more is needed (up to 15 times)
directory reserve this amount of blocks to keep the directory of a partitioned dataset (NOT
USED for a sequential dataset)
1 directory block allows for 5 members in a partitioned dataset
Total Space = (1 * primary) + (15 * secondary)
Sequential Dataset
- 58 -
PARTITIONED DATASET
DSN='userid.data-setname(member)'
SEQUENTIAL DATASET
DSN='userid.data-set-name'
______________
| DIRECTORY |
|-----------------|
| MEMBER1 |
|-----------------|
| MEMBER2 |
|-----------------|
|
.......
|
|-----------------|
| MEMBERn |
|--------------------------|
|_______________|
______________
|
|
|
|
|
|
| DATASET |
|
|
|
|
|
|
|
|
|
|
|_______________|
A partitioned dataset differs from a sequential dataset in that it has a directory of its members.
Whenever you refer to a member of a partitioned dataset, you include the member name in
parentheses.
Management Class
Data set Usage
Minimum percent free space on a DASD Volume
- 59 -
DFSMS records the location of each dataset it moves in a control data set. The actual migration
is handled by DFHSM (Data Facilities Hierarchical Storage Manager). DFHSM is a DASD
management product tool for managing low-activity and inactive data.
Data sets that have reached the end of their retention period (expired) will be deleted. Data sets
with a management class of STANDARD will be deleted if the data set has not been referenced
for a period of eighteen months. A notification will be sent to the user after a STANDARD data set
has not been referenced for six months informing the user of the STANDARD deletion policy. At
this time the data set will be moved to tape.
All data sets that have a management class of RETAIN95 or STANDARD will be automatically
backed up by DFHSM. Two copies of each will be kept. The change indicator will trigger the
backup after the first backup is made. A user can use the HBACK command to add nonSTANDARD and non-RETAIN95 data sets to this.
This SPACE example allows a total of 100 tracks for the dataset with 8 blocks reserved for the
directory.
// SPACE=(TRK,(25,5,8))
Total Space = (1*25) + (15*5) = 25 + 75 = 100 tracks
Directory = (8*5) = 40 members/dataset
* Note that the track capacity for 3380 is 1 track = 47,476 characters.
- 60 -
- 61 -
- 62 -
- 63 -
10
write(8,10) x,y
format(1x,f4.1,1x,f4.1)
/*
//GO.FT08F001 DD DSN=UGABC.NEWFILE,UNIT=SYSDA,
// DISP=(NEW,CATLG,DELETE),
- 64 -
// SPACE=(TRK,(40,10),RLSE),
// RECFM=FB,LRECL=80,MGMTCLAS=RETAIN7
/*
//
- 65 -
A greenbar paper
5-9 TSO held output
C-Z IBM page printer output classes. See chart in section "Sysout Classes for IBM Print"
on page 28.
SYSOUT*
CLASS
C
D
F
G
H
I
J
K
Q
S
W
X
Y
Z
landscape
portrait
landscape
portrait
landscape
portrait
landscape
portrait
landscape
portrait
portrait
portrait
landscape
landscape
1
1
2
2
2
2
2
2
1
1
2
2
2
2
1
1
1
1
2
1
1
1
1
1
2
2
1
1
132
80
132
80
90
80
132
80
132
80
132
132
132
132
62
62
62
62
80
70
62
62
62
62
62
62
62
62
Graybar Overlay: The paper used for classes C,F,H,J, and Q is shaded to mimic standard
greenbar paper.
Service Site Page Printers: To route your output to one of the page printers in the Journalism or
Aderhold sites, you must use a SYSOUT class or message class (MSGCLASS) with a paper type
of "hole" (C, D, J, K, W, or Z).
Line Printer SYSOUT Class: To route your output to a line printer, use a SYSOUT class or
message class (MSGCLASS) of A. Your output will be printed on greenbar paper.
Special Hold Classes: To route your output to a hold queue, use a SYSOUT class or message
class (MSGCLASS) of 5, 6, 7, 8, or 9.
-----------------------* SYSOUT class values may be used for message class (MSGCLASS).
- 66 -
- 67 -
DEFAULT=dd - specifies that this OUTPUT statement can or cannot be referenced by a sysout
DD statement
YES specifies that this is the default OUTPUT statement for for all print files within a job
NO specifies that this is not the default OUTPUT statement
* Note if you are going to HOLD a print dataset with an OUTPUT statement associated with it,
you will have to fully specify all of the parameters on the OUTPUT statement. Contact the UCNS
Helpdesk for more details.
To request simplex (one sided) printing for a duplex sysout class for all print files, code:
//OUT1 OUTPUT FORMDEF=SMP1,DEFAULT=YES
- 68 -
CPU Time
(seconds)
Region (K)
Estimated
Lines
Setups
Required
0-30
0-2048
0-5000
32-120
2049-3072
5001-10000
- 69 -
121-300
3073-4096
10001-40000
1-3
301+
4097+
40000+
4+
- 70 -
- 71 -
/*
//
11. SOURCES OF HELP
11.1 UCNS HELPDESK
The UCNS Helpdesk, located in the Computer Services Annex on the corner of East Campus
Road and Cedar Street and on the first floor of the Boyd Graduate Studies Research Center,
function as the initial contact point for all computer related needs associated with the University of
Georgia computer systems. The primary purpose of the Helpdesk is to aid faculty, staff, and
students with the use of our computer systems through general consulting and information
requests. Assistance is provided through telephone contacts, walkins, and electronic mail.
Hours: Monday - Friday, 8:00AM - 5:00PM
Phone: (404) 542-3106
E-mail Address: HELPDESK@UGA
Internet Address: HELPDESK@ARCHES.UGA.EDU
Limited assistance is available at all staffed UCNS Computer Service Sites.
IBM MVS JCL Publication No. GC28-1300 - This manual is the basic reference document
on the syntax and usage of IBM JCL. This manual is available for reference at the Client
Services Help Desk.
- 72 -
Naming conventions :Jobs will be held in datasets with .cntl or .jcl extension
e.g. ORSDEVP.REL#15.JCL
Procedures will be held in datasets with .proclib or .proc extension
e.g. ORSTEST.REL#15.PROCLIB
Parameters used will be held in datasets with .parm or .parmlib extensions
e.g ORSLIVE.REL#1.PARMS
- 73 -
Parameters :There are two kinds of parameters in the operand field :- positional and keyword
parameters. The operating system recognizes positional parameters by their position in the
operand field. Keyword parameters can be coded in any order. Positional parameters must be
coded in a specific order before any keyword parameter.
Consider the job statement :Positional parameters
Keyword parameters
- 74 -
Abbrv Meaning
NAME
LIMIT
EMPTY
NOEMPTY
GDD name.
The no. Of generations permitted for this gdg
The max is 255.
If empty is specified, all data sets are to beremoved
EMP
from the index when the limit is reached.
NEMP NOEMPTY is the default.
LIM
OWNER
SCR
TO (date
FOR(days)
- 75 -
Libraries
Another name for a library is a partitioned data set(PDS).
Libraries can be created,accessed & modified using utility programs like IEFBR14, IEBGENER,
IEBPTPCH, IEBUPDTE, IEBCOPY, etc.
IEFBR14, IEBGENER & IEBCOPY are the most frequently used utilities on any project.
IEFBR14
Strictly speaking it is not a utility program because it does nothing. It clears register 15 and
BR(branch) 14.
It is used to create or delete a library based on the DD statement parameters.
IEBGENER
IEBGENER uses four data sets described by SYSPRINT, SYSIN, SYSUT1 & SYSUT2.
SYSPRINT is the DDNAME of the data set that IEBGENER uses to write messages.
SYSIN is the DDNAME of the data set that contains the control statements to tell IEBGENER
how the input data set should be modified while it is being copied.
SYSUT1 is the DDNAME of the input data set that IEBGENER is to copy.
SYSUT2 is the DDNAME of the output data set that is to be created.
IEBCOPY
IEBCOPY is a utility program that may be used to copy one or more members from an existing
PDS to a new or existing PDS, to make a backup copy of a PDS, and to reorganize a PDS in
order to reclaim the unused space.
DFSORT
Sorting means putting records in a data set into a specified order.
Merging is closely related to sorting;it means combining records from two or more sorted
datasets into one data set that is in the same order.
The sort program requires three pieces of information:where to find the input data,which fields in
the records to do the sorting on, and where to put the sorted output data set.
- 76 -
- 77 -
Merging
When you merge, you start with two or more sorted data sets and create a new data set that is in
the same sorted order.
While merging you must specify more than one input data set. These data sets have the DD
names SORTINnn, where nn may range from 01 to 16.
SKIPREC & EQUALS / NOEQUALS options are not used on the merge statement.
The sort control statements are normally coded in a parameter file.
DEFINE CLUSTER
is the command using which all the descriptive information about the VSAM data set is supplied.
REPRO
command may be used to load data into a VSAM data set.
PRINT
command is used to obtain a listing of a VSAM data set.
FILE-AID
utility from ISPF primary menu(v.1) can be used to allocate / manage VSAM data sets.
- 78 -
S001
S002
S004
S013
S0C1
S0C4
S0C7
Sx22
S806
S80A
S822
S878
S913
Sx37
U1020
U1035
An I/O error ocurred. Check reason code for exact cause. Examples are
trying to read beyond End of File, trying to write to an input file or a file
length error.
Invalid I/O record, eg attempting to write a record that is longer than the
maximum record length.
Error occured during OPEN. Eg Invalid DCB.
Error OPENing a dataset, eg PDS member does not exist, record length
in program doesnt match datasets record length.
Operation Exception. Check for subscript errors, missing DD card, file
not opened.
Protection Exception/Storage Violation. Trying to access storage not
available to the program. Can be caused by a subscripting error or
reading/writing a file that isnt open.
Program Check Exception - Data. Check for spaces in a packed
decimal or numeric field. Check to see if record layouts or file layouts
have been changed.
Job has been cancelled. The value of x will vary depending on the way
the job was cancelled. S222 means job was cancelled by a user or
operator without a dump. If a TSO session times out you will probably
get an S522 abend code.
Unable Link or Load. The job was unable to find the specified load
module. Check that the job is looking at the correct Load Libraries,
specify a STEPLIB if required.
Not enough Virtual Sorage to satisfy a GETMAIN or FREEMAIN
request.
Unable to obtain to obtain enough space to satisfy a REGION= request
May need to change REGION statement in the JCL..
Not enough storage available to satisfy a GETMAIN or FREEMAIN
request.. Job was anable to allocate an area of memory of the correct
size. Try Specifying or amending the REGION= JCL statement.
You are trying to access a dataset which you are not authorized to use.
Unable to allocate enough storage for a dataset. You might need to
increase the amount of primary and secondary space to be allocated for
a dataset in the SPACE= parameter, or you may have to move the
dataset to a different DASD devive which has enought space to store
the dataset. x will vary, likely Abends are SB37, SD37 or SE37.
I/O Logic error. Typical reasons are; trying to write to a file opened as
input; Rewrite without a previous read. See the message IGZ020I for
details of the exact reason.
Inavlid OPEN/CLOSE. Check there is a DD statement for the file. See
the message IGZ035I for more detailed information.
- 79 -
001
002
004
008
013
028
0CX
706
804
806
80A
878
737
A14
B37
D37
E37
I/O ERROR
I/O INVALID RECORD
OPEN ERROR
I/O SYNAD ERROR
OPEN ERROR
PAGING I/O ERROR
PROGRAM CHECK EXCEPTIONS:
0C1
0C4
0C5
OPERATION
PROTECTION / ADDRESSING
ADDRESSING
NON-EXECUTABLE PROGRAM
INSUFFICIENT VIRTUAL STORAGE
UNABLE TO LOAD (LINK ETC) PROGRAM
INSUFFICIENT VIRTUAL STORAGE
INSUFFICIENT VIRTUAL STORAGE
I/O ERROR
I/O ERROR
INSUFFICIENT DASD SPACE
INSUFFICIENT DASD SPACE
INSUFFICIENT DASD SPACE
012(0C)
016(10)
020(14)
024(18)
028(1C)
036(24)
040(28)
- 80 -
068(44)
074(4A)
076(4C)
080(50)
084(54)
088(58)
92(5C)
96(60)
104(68)
112(70)
116(74)
120(78)
136(88)
140(8C)
144(90)
148(94)
152(98)
156(9C)
192(C0)
196(C4)
200(C8)
204(CC)
252(FC)
- 81 -
152(98)
164(A4)
168(A8)
176(B0)
180(B4)
184(B8)
188(BC)
192(C0)
232(E8)
236(EC)
244(F4)
- 82 -
JCL FAQ's :Question: What is the parameter to be passed in the job card for the unlimited time, irrespective
of the job class?
Answer: TIME=1440
Question: How do you submit JCL via a Cobol program?
Answer: Use a file //dd1 DD sysout=(*,intrdr)write your JCL to this file.
Question: Definition of COND p-r in JCL and a correction to a previously posted question
Answer: COND is a condition parameter, consists of 2 subparameters,
1st - return code from the previous step,
2nd - condition. If COND is true, the step on which COND is coded will be BYPASSED.
Question: Q) WHAT IS MEANT BY S0C7 AND S0C30 SYSTEM ABEND CODES.
Answer: A) S0C7 - Data exception error - you will get it whenever you are trying to move the low
values or spaces into the numeric field, or compare the numeric fields with low values, or try to do
some arithmetic operations on the low values. To avoid this you have to always initialize the
numeric fields otherwise they will contain the low values.
B)S0C 30 - I have never heard of it, let you know if I come accross it.
Question: How to pass the temp dataset form one JOB step to another?
Answer: By specifying the DISP as PASS for the temp dataset
Question: What is a COND parameter in JCL?
Answer: COND means condition parameter. It is compared with system return code of previous
step. //step1 exec pgm=abcd//step2 exec pgm=xyz, cond=(4,lt) step2 will be executed when
system return code of step1 is less than 4.
Question: WRITE A JCL TO EXECUTE A JOB BY 7 A.M ON JAN 20,1986?
Answer: THE code IS: //*MAIN DEADLINE=(0700,B, 012086)
- 83 -
- 84 -
- 85 -
Answer: It is used as an alternative for steplib.When we specify the dataset name in include, it will
search in all the datasets specified in the include dataset.
Question: IS IT POSSIBLE TO KNOW THE REMAINING FREE SPACE IN AN CONTROL
INTERVAL/CONTROL AREA ONCE AN INSERTION HAS BEEN MADE.
Answer: NOT POSSIBLE
Question: what does soc04 error mean?
Answer: This error is faced when we execute the cobol program.the main reason for this error is
that a variable is defined with less characters and we are trying to move data which is larger than
the actual storage space.
Question: What is JCL
Answer: JCL is Job Control Language and is used for Batch processing. The startup procedures
of OS and standard products like CICS etc are written in JCL.
Question: In which table PLAN is registered in?
Answer: RCT
Question: GDG?
Answer: GDG - group of dataset that are logically or chronologically related, referred by name
and a relative generation number - an integer which identifies the generation of a dataset and is
coded in parentheses after dataset name. Absolute GDG name - GxxxxVyy, where xxxx-absolute
gen.number, yy-version number. Can be sequential, direct, partitioned. (VSAM - no). Must always
be cataloged. Advantage - all datasets have the same name and system keeps track of adding
new and retaining previous generations and deleting oldest successive generation. To create a
GDG we create a GDG index in the system catalog with IDCAMS utility and then a model
(prototype, DSCB) on the same volume to supply DCB information. Empty - when limit is reached
all members are removed from the index, otherwise-only oldest. Scratch-removed members are
uncataloged & deleted, otherwise - removed & uncataloged, but remain in the system (not
members of GDG any more). GDG number is updated at the end of the job. If number is not
specified all generations will be processed from the beginning.
Question: what is jcl
Answer: It is used to communicate between the terminals.
- 86 -
- 87 -
- 88 -
- 89 -
- 90 -
Question: What is STEPLIB, JOBLIB? What is it used for? What is order of searching of the
libraries in a JCL?
Answer: Specifies that the private library (or libraries) specified should be searched before the
default system libraries in order to locate a program to be executed.
STEPLIB applies only to the particular step, JOBLIB to all steps in the job.First any private
libraries as specified in the STEPLIB or JOBLIB, then the system libraries such as
SYS1.LINKLIB. The system libraries are specified in the linklist.
Question: What is primary allocation for a data set?
Answer:The space allocated when the data set is first created.
Question: What is the difference between primary and secondary allocations for a data set?
Answer:Secondary allocation is done when more space is required than what has already been
allocated.
Question: How many extents are possible for a sequential file ? For a VSAM file ?
Answer:16 extents on a volume for a sequential file and 123 for a VSAM file.
Question: What does a disposition of (NEW,CATLG,DELETE) mean?
Answer:That this is a new dataset and needs to be allocated, to CATLG the Data set if the step is
successful and to delete the data set if the step abends
- 91 -
ONLINE SYSTEM
DEFINITION : ONLINE processing allows a user to interact with a computer and access its
resources via a terminal.
Example : Railway Reservation system.
BATCH & ONLINE SYSTEM
BATCH
ONLINE
WHAT IS CICS?
Note : Role of CICS is to interface between application programs and the DB/DC control system.
CICS SERVICES & THE OPERATING SYSTEM
- 92 -
CICS START UP
CICS SHUTDOWN
ROLE OF CICS
MULTI TASKING
o More than one task can be executed concurrently.
MULTI THREADING
o Tasks share the same program under the multi tasking environment.
RE-ENTRANT PROGRAM
- 93 -
o Program when does not modify itself in any way during execution.
QUASI RE-ENTRANT
o Is a reentrant program under the CICS environment.
MAPS AND DISPLAYS
INTRODUCTION TO BMS
To make the application program device independent and format independent CICS
provides Basic Mapping Support (BMS)
BMS is a standard facility, to deal with the formatted screen operations
Screen defined through BMS is called a "MAP"
SYMBOLIC MAP
1.
- 94 -
Halfward binary
Contain the length of data entered by the terminal operator
F One byte flag field
I Contains the data entered by the operator
A One byte field that contains Attribute byte
O Contains data to be sent to terminal
L
OUTPUT MAPPING
MAP ONLY
EXEC CICS SEND
MAP (mapname1)
MAPSET (mapset1)
MAPONLY
END-EXEC
DATA ONLY
EXEC CICS SEND
MAP (mapname1)
MAPSET (mapset1)
DATA ONLY.
END-EXEC.
1.
- 95 -
The physical map and the data from symbolic map is sent to the terminal.
ERASE: Current screen is erased before the map specified appears on the screen
ERASEAUP: erase all the unprotected fields.
FREEKB: to free the keyboard
ALARM: to make an alarms sound.
FRSET: to reset MDT to zero
CURSOR: to place the cursor in a specified field
CURSOR POSITIONING
Static positioning
o If IC option is specified in the ATTRB field of DFHMDF macro the cursor will be
placed at this field.
Dynamic / symbolic positioning.
o Place (-1) into the field length field (L suffix). Cursor will be placed in the field.
Dynamic / Relative positioning.
o Cursor (data-value) option is used.
o Data-Value will have the value at which the cursor has to be positioned.
o E.g.. EXEC CICS SEND
MAP (..)
MAPSET (..)
CURSOR (100)
ERASE
END-EXEC.
MAPFAIL condition will caused in RECEIVE MAP command.
o If the data to be mapped has a length of zero.
o If the operator presses any key (clear, PA, PF, ENTER, Keys) without entering
any data.
- 96 -
LINKAGE SECTION
o Copying a symbolic description map structure here does NOT mean the storage
will be available. Some methods for providing storage are passing a
COMMAREA, acquiring temporary storage with the SET option, or using a GET
MAIN command.
SEND / RECEIVE
SEND MAP Coding Alternatives You can code the SEND MAP command to
locate the symbolic description map in several ways:
Using constants in the name field for MAP and MAPSET(FROM is not
required)
Using variables in the name field for MAP and MAPSET (This makes
FROM a required parameter)
Using only the MAP parameter. In this case the name in the MAP option
must be the MAPSET name.
RECEIVING into the symbolic description map
RECEIVE MAP(`MAP1')
MAPSET(`SET1') ... MAP1 I
Move `MAP1' to MAPVAR
Move `SET1' to SETVAR ..... MAP1 I
RECEIVE MAP (MAPVAR)
MAPSET(SETVAR)
INTO (MAP1 I)
Receive MAP (`SET1') ... SET1 I
o
RECEIVE MAP coding alternatives You can code the RECEIVE MAP
command to locate the symbolic description map in several ways:
Using constants in the name field for map and mapset (INTO/SET is not
required) This is the most commonly used format.
Using variables in the name field for MAP and MAPSET. This makes
INTO (database) or SET a required parameter.
Using only the MAP parameter. In this case the name in the MAP option
must be the MAPSET name.
Linkage Section.
- 97 -
01 DFHCOMMAREA
01 LST
02 PTR-2-LIST PIC S 9(8) COMP.
02 PTR-2-BMS PIC S 9(8) COMP.
RECEIVE MAP (`MAP1') MAPSET (`SET1')
SET (PTR-2-BMS) ..... MAP1 I
Using the SET option requests CICS to get the storage and return a
pointer to it. The symbolic description map must be in the LINKAGE
SECTION.
OUTBOUND FUNCTIONS
SEND MAP (`MAPA') MAPSET (`SETA')
[ERASE/ ERASEAUP]
[FREEKB]
[ALARM]
[FRSET]
[PRINT]
ERASE
Erase Buffer, place cursor in upper left corner then write
ERASEAUP Erase all the unprotected fields before the Write
FREEKB
Unlock Keyboard after the write
ALARM
Active alarm with the write
FRSET
Set all MDT currently on to off
PRINT
Start the 3270 print operation.
Control Functions:
Typically the first type of command in the program is a SEND MAP. Certain control
functions may be included in that command.
ERASEAUP will clear out each field whose attribute is unprotected. It will NOT alter any
attribute settings.
If you do not free the keyboard using FREEKB, the operator will have to press the
RESET key before entering data.
If you code FRSET, all attribute bytes currently having Modified Data Tags (MDT) set on
will be set off. Selective resetting of the MDT's must be done another way.
When sending data to a 3270 screen the actual printing from the buffer will occur when
the PRINT function is requested.
Attributes :
The `A' suffixed field is an attribute field which controls the following:
PROTECTED/UNPROTECTED
ASKIP
NUM
MDT
Non Display (dark)DISPLAY (normal/bright)
- 98 -
If the color or highlighting of a field has to be changed, additional symbolic fields are
needed which are called the EXTENDED ATTRIBUTES.
EXTENDED ATTRIBUTES
DSATTS (for symbolic map) and MAPATTS (for physical map) support the extended
attribute characteristics
The MAPATTS allows you to set up the physical map with any of the characteristic(s)
coded.
The DSATTS will create appropriate suffixed labels for the attribute characteristic(s)
coded.
EIBAID/CURSOR
WORKING-STORAGE SECTION.
COPY DFHAID.
......
PROCEDURE DIVISION.
IF EIBAID = DFHPF12 THEN
......
IF EIBAID = DFHENTER THEN
......
IF EIBCPOSN LESS THAN 80 THEN
......
When you first enter your program as a result of a transaction id, you can test EIBAID
and/or EIBCPOSN. This may be done prior to issuing a RECEIVE command, if so
chosen.
If the operator uses any PA key or presses the CLEAR key, no data is transmitted
EIBAID is useful when function keys are defined for the user.
for eg. PF12 may be the exit function
PF3 may be an update function etc.
Thus testing for the type of AID will alter the logic flow.
EIBCPOSN can be used to determine where the cursor was positioned on the screen.
This information is especially useful with screens containing an action bar.
- 99 -
CURSLOC
Sample Map
MAPSETA DFHMSD TYPE=&SYSPARM, MODE= INOUT,
TERM=ALL, LANG=COBOL, TIOAPFX=YES,
STORAGE=AUTO
MAP1
DFHMDI SIZE=(24,80), LINE=1, COLUMN=1,
CURSLOC=YES
DFHMDF POS(2,1), LENGTH=4, INITIAL=`NAME',
ATTRIB=ASKIP
NAME
DFHMDF POS(2,6),LENGTH=20,
ATTRB=(UNPROT, IC)
DFHMDF POS(2,27), LENGTH=1,
ATTRB=PROT
CURSLOC= YES allows you to determine after a RECEIVE MAP command, which map
field had the cursor in it.
CURSLOC=NO is the default.
CURSLOC=(NO/YES) may be coded on the DFHMSD or the DFHMDI macro. If coded
on the DFHMSD macro, it will provide a default for all the maps in that mapset.
When CURSLOC=YES, BMS will set the `F' suffix field to X'02' indicating that field
contained the cursor. If the cursor is in a field for which there is no symbolic label i.e. a
DFHMDF with no label the program will not be notified.
Note : The `F' suffix field continues.
To be used to indicate the operator pressed the erase to end of fixed (EOF) key by being
set to X'80'.
Therefore, if CURSLOC=YES it is possible to have both these conditions occur for the
same field, in which case the `F' suffix field will contain a X'82'.
EDITING
If PICIN/PICOUT is not coded in the macro, the pic generated is always PIC X (length of
field)
By using PICIN/PICOUT BMS can be forced to generate the appropriate PIC.
PICIN tells BMS how to move data into the `I' suffix field.
- 100 -
PICOUT tells COBOL how to edit your data move to the `O' suffix field.
BIF DEEDIT is used to remove the special characters from the input field.
The Amount field displayed has a dollar sign and a decimal point
By using BIF DEEDIT dollar sign and decimal point is removed. Thus the number can be
used for arithmetic operations.
COBOL compiler requires LENGTH specification:
VS COBOL-II uses the implied length of the data-area used in the field parameter.
CICS PROGRAM COMPONENTS
OBJECTIVES
Environment Division
Other requirements:
- 101 -
Notes :This is not the way to terminate a CICS program. CICS has a command for that purpose.
Nevertheless, COBOL and VS COBOL II have three statements to conclude programs.
Control must not be allowed to pass beyond the last statement of a CICS Program.
STOP RUN in COBOL uses operating system facilities, and therefore, is discouraged.
EXIT program is ignored if the program has not been called.
CICS RETURN COMMAND and/or GOBACK statement is recommended.
Transactions
Task
Program
Transactions
An exchange between a terminal and a data base representing an application process. For
example, an inquiry or a deposit and balance update
Task
A specific instance of a transaction i.e. a unique unit of work.
Program
Prepared statements compiled or assembled into an executable module of machine instructions.
CONVERSATIONAL TRANSACTION
- 102 -
The task is terminated after a message is sent with a linkage for the next task. CICS
provides a facility (COMMAREA) to made it easier to accomplish this.
When the user completes response (by pressing enter) reset task is automatically
initiated by CICS.
The task receives the message from the terminal & processes it.
This is a multitask operation from system's point of view.
PROGRAM PREPARATION
Running the DB2 precompiler first is the preferred method. DB2 precompiler precedes
another process, binding, not mentioned here.
Output of the DB2 precompiler can serve as input to the translator.
Output of the translator will be input to the compiler.
Messages or warnings are provided on all the listings.
TRANSLATOR recognizes EXEC CICS and EXEC DLI statements. They are commented
out and replaced with statements in the appropriate language. Here, COBOL MOVE
instructions and a CALL are inserted and passed on to the COBOL compiler.
DB2 Precompiler is supplied by the relational data base managers, DB2 and SQL/DS. It
recognizes EXEC SQL statements which it will comment out and replace with in our
case. COBOL PERFORM and CALL statements.
Output of the transaction is i/p to the compiler
The o/p of the linkage editor is executable. The load module is placed in the CICS online
program library.
Messages or warnings are provided on all the listings. The compiler listing is or limited
use if the translator listing would not process all commands.
TESTING
CEMT set program (prg1) New comp
Or
CEMT S PR (prg1) N
After making changes to a program the new version replaces old version, but CICS which
is currently executing has no way of knowing this automatically. The CICS processing
program table PPT still points to the old-version.
To avoid testing with the old version, you must use the CICS-provided CEMT transaction
to update the pointer to the program.
COMMON FORMAT
A CICS command consists of a keyword phrase, delimiter, function, options and their
argument values.
Be careful about periods. Avoid them after END-EXEC. Where you don't really want
them.
For eg. within an If .... then ... else statement
The translator will place a period into the generated code if a period follows end-exec.
- 103 -
ARGUMENT VALUES
PIC S9(4) comp Halfword binary
data - value PIC S9(8) comp Fullword binary
PIC X(15) character string constants permitted
COBOL data name
(Not a constant)
eg :data - area 01
Record-area.
05 Fld 1
05 Fld 2
name
label
RECEIVE command is used to receive incoming data from the terminal to which this
CICS transaction is associated.
A receiving area must be defined in working storage section and has to be specified in
the INTO parameter.
Length field must be defined in working storage section as a S9(4) comp. It has to be
specified in length option.
SEND COMMAND
EXEC CICS SEND
FROM (data area)
LENGTH(ln)
END-EXEC
The data to be sent must be stored in working storage section, and this field name has to
be specified in the FROM parameter.
Length must be specified the same as that of the Receive command.
- 104 -
EXCEPTIONAL CONDITIONS
RESP option
o Define a full word binary field S9(8) comp in the working storage section as the
response field.
o Place RESP option with the response field in any CICS command.
o After command execution, check the response code in the response field with
DFHRESP (xxxx)where xxxx is
NORMAL for normal completion or Any exceptional condition
HANDLE CONDITION
Handle condition command is used to transfer control to the procedure label specified if
the exceptional condition, specified occurs.
Remains active until the end of program or another handle condition request overrides it.
IGNORE CONDITION
Ignore condition command causes no action to be taken if the condition specified occurs
in the programs.
Request by the IGNORE CONDITION command is valid until the subsequent HANDLE
CONDITION command for the same condition.
NO HANDLE OPTION
If NOHANDLE option is specified in any CICS command, no action will be taken for any
exceptional condition occurring during execution of this command.
o Eg : EXEC CICS SEND
From (...)
Length (...)
NOHANDLE
END-EXEC
ASKTIME Command
o used to request the current date and time
o EIBDATE and EIBTIME fields have the values at the task initiation time.
FORMAT EXEC CICS ASKTIME END-EXEC
- 105 -
DELAY COMMAND
used to delay the processing of a task for the specified time interval or until the specified
time.
FORMAT
EXEC CICS DELAY
INTERVAL (002000)
TIME (152000)
End - EXEC
Task will be suspended for 20 minutes if INTERVAL is specified or until 15:20:00 if TIME
is specified.
COMMAREA
PSEUDO CONVERSATIONAL
Pseudo conversational technique is uses the multiple transaction identifiers(pct entries) and
multiple program (pct entries). It performsthe terminal conversation in the following way:
A conversational program is logically and physically divided into separte programs after sending a
message and before receving the message. For each separate program, a unique cics trasction
identifier is assigned. before terminating the program, each program issues the RETURN
command with the next transaction identifier which is associated with the next program, unless it
is the least return to CICS itself. in this way, a series of terminal conversations can be carried out
continuously.
- 106 -
Notes :
o The first time commarea is passed, it must begin as an area of storage in the
working storage section of the program passing it.
o A commarea parameter in the RETURN will pass the area to the program
associated with the subsequent transaction. In this case, itself.
o The subsequent program (in this case the same program) must define access to
all the commarea that was passed to it.
PAYROLL as both the sender and the receiver of the COMMAREA needs the working
storage definition to send and the linkage section DFHCOMMAREA to receive.
PAYROLL must therefore be able to distinguish between FIRST TIME into the program.
When there is no COMMAREA and subsequent times in. Where one exists in the
Linkage section. The EIB field, EIBCALEN indicates the length of the commarea.
EIBCALEN
To pass control from one program to another and then return to the original like executing
a subroutine.
The link command passes control to another program defined in CICS PPT expecting
that the program will return to the linking program instruction following the LINK
command. This happens when the linked program issues a RETURN command.
Data may be passed using the commarea.
The commarea is shared between the two program regains control may changes made to
the commarea by the linked program are accessible.
The two programs executive under the same task.
The working storage section for the linking program is retained. Working storage for the
linked program is automatically released after its RETURN command is executed.
To pass control from one program to another and then return to the original like executing
a subroutine.
The link command passes control to another program defined in CICS PPT expecting
that the program will return to the linking program instruction following the LINK
command. This happens when the linked program issues a RETURN command.
- 107 -
DIRECT RETRIEVAL
o VSAM DATA STRUCTURES
DIRECT RETRIEVAL
o RELATIONAL TABLE ROW
BROWSE
o VSAM DATA STRUCTURE
BROWSE
o RELATIONAL TABLE ROWS
Entry for VSAM file has to be there in FCT (File Control Table)
Each entry contains all descriptive information for the file it represents. So, programmer
need not define the physical organization and other attributes of the files.
o The File parameter coded in the program must be the same as the file name in
the FCT.
o Interface between CICS and Relational Database is called CICS attachment
Facility. Statement are coded in SQL language in the application program to
Communicate data requests to the database.
TOPICS
DIRECT RETRIEVAL
o VSAM FILE RECORD
o RELATIONAL TABLE ROW
BROWSE
o VSAM FILE RECORDS
o SET OF RELATIONAL TABLE WORKS
PROGRAM ORGANIZATION
- 108 -
RECORD IDENTIFICATION
RECORD KEY
RELATIVE BYTE ADDRESS
RELATIVE RECORD NUMBER
PARTIAL KEY
o key of the record to be read is specified in the RIDFLD. for KSDS
o Key specified can be a full key or partial key
o If partial key, key length has to be provided
o RBA (Relative Byte Address)
o Can also be used instead of actual key value
For ESDS
o RIDFLD contain a 4 byte RBA
For RRDS
o RIDFLD contains 4 Byte binary relative record number.
RIDFLD must be set to the value of the key of the record to be retrieved.
RIDFLD must be large enough to hold a full record key even when a partial key is used.
READ COMMAND
- 109 -
EXCEPTIONAL CONDITIONS
The exceptional condition can be trapped using RESP option in the READ command.
ADDRESSABILITY TECHNIQUES
EXEC CICS XCTL
PROGRAM (PROGRAM NAME)
RESP (EXCEPTION)
END-EXEC.
IF EXCEPTION = DFHRESP (PGMIDERR)
a module given control through the use of a CICS XCTL command will not return to the
program that issued the XCTL.
The required. program name is character string constant (max 8 characters)
The PGMIDERR exception condition occurs when the name is not in the PPT.
LOGICAL LEVELS
The linked to program runs at a new logical level and returns to a logical level back to the
linking program.
The linking program and its storage area remain available.
Notes :
To quit the repeated execution simply RETURN without the TRANSID option.
Any linked program could use the same COMMAREA of the parameters so indicated.
The transid & commarea option easy enough to use to make this method practical.
CICS LINK
CICS XCTL
COBOL CALL
Alternative to XCTL or LINK ? COBOL CALL
COBOL CALL passes control to other programs.
INPUT MSG & INPUT LEN PARAMETERS USED WITH XCTL OR LINK.
- 110 -
ADDRESSABILITY
- 111 -
Interface among CICS transaction. Applicati on program 1 TDQ Appl . Pgm 2 report
Automatic task Initiation (ATI)
Message routing
Message Broad cast.
DCT determines the initial open / close status of a file while the file can be opened or
closed through the master terminal transaction during CICS session.
TDQ can be defined as an Input or output but not both.
Records are fixed, variable, blocked or unblocked.
EXCEPTIONAL CONDITIONS
1.
- 112 -
WRITEQ TS
READQ TS
DELETEQ TS of TSQ
EXEC CICS
DELETEQ TS
QUEUE (NAME)
END-EXEC.
All records is TSQ are deleted.
All associated storage is released.
- 113 -
EXCEPTIONAL CONDITIONS
CEBR can be invoked while you are already in the CEDF mode.
Press the PF5 key to display the working storage section.
- 114 -
EXCEPTION HANDLING
CICS to respond to exceptional conditions in one of three ways:
RESP option: - The RESP option can be specified in any CICS command. Its function is
similar to the return code in the batch program.
o Define a fullword binary field (S9(8)COMP) in the working storage section as a
response field.
Place the RESP option with the response filed in a command.
After command execution, check the response code in the response field
with DFHRESP (xxxx), where xxxx is the - NORMAL
- Any exceptional condition
HANDLE CONDITION This command is used to transfer control to the procedure label
specified if the exceptional condition specified occurs.
IGNORE CONDITION This command causes no action to be taken if the condition
specified occurs in the program.
EXEC CICS HANDLE CONDITION
Condition (Label)
[Condition (Label)]
[Error (Label)]
END-EXEC.
or
EXEC CICS IGNORE CONDITION
Condition
[Condition]
END-EXEC.
ABEND CODE
If an exceptional condition occurs during execution of a CICS application program and if
the program does not check the exceptional condition, CICS may continue executing the
program or terminate abnormally the execution of the program, depending on the
exceptional condition and the command involved.
- 115 -
:-
ASRA
This is the most common abend in CICS. It indicates a Program Check Exception, roughly
equivalent to having an S0C7 in a batch program. Check for spaces in a packed decimal
numeric field and changes to the file and record layouts.
AEI0
indicates a PGMIDERR.
AEI9
is a MAPFAIL condition,
AEIO
indicates a duplicate key (DUPKEY) condition.
AEIN
indicates a duplicatebrecord (DUPREC) condition.
AEID
indicates an End of file condition.
AEIS
indicates that a file is not open (NOTOPEN)
- 116 -
AEIP
indicates an invalid request condition (INVREQ)
AEY7
indicates that you are not authorised to use a resource (NOTAUTH)
AICA
This abend usually occurs if your program is looping. There are CICS parameters that
determine how long a task can run without giving up control. The ICVR parameter in the CICS
SIT table can be used to specify a value for all tasks running in CICS, or you can specify a
RUNAWAY value when you define a transaction . If a program is looping then you may not get
an AICA abend, because the timer can be reset when certain events occur, eg some EXEC
CICS commands may reset the timer to zero.
APCT
A program was not found or was disabled. Check the transaction definition to see if the
program name was misspelled. Check that the program is enabled. Check that the program is
in an appropriate Load Library (ie one defined to the current CICS system).
AFCA
A dataset could not be accessed because it was disabled.
ABM0
The specified map was not found in the specified mapset. Check that you have not misspelled
the map name.
- 117 -
The Execute Interface Block (EIBLK) contains a variable called EIBFN.This contains a value
that tells you what CICS command was last executed. This value can be displayed as part of an
error message, to aid in the debugging of your code or when an exception condition occurs
The values for EIBFN are show below.
Code Command
0202 ADDRESS
0204 HANDLE CONDITION
0206 HANDLE AID
0208 ASSIGN
020A IGNORE CONDITION
020C PUSH
020E POP
0210 ADDRESS SET
0402 RECEIVE
0404 SEND
0406 CONVERSE
0408 ISSUE EODS
040A ISSUE COPY
040C WAIT TERMINAL
040E ISSUE LOAD
0410 WAIT SIGNAL
0412 ISSUE RESET
0414 ISSUE DISCONNECT
0416 ISSUE ENDOUTPUT
0418 ISSUE ERASEAUP
041A ISSUE ENDFILE
041C ISSUE PRINT
041E ISSUE SIGNAL
0420 ALLOCATE
0422 FREE
0424 POINT
0426 BUILD ATTACH
0428 EXTRACT ATTACH
042A EXTRACT TCT
042C WAIT CONVID
042E EXTRACT PROCESS
0430 ISSUE ABEND
0432 CONNECT PROCESS
0434 ISSUE CONFIRMATION
0436 ISSUE ERROR
0438 ISSUE PREPARE
043A ISSUE PASS
043C EXTRACT LOGONMSG
043E EXTRACT ATTRIBUTES
0602 READ
- 118 -
0604 WRITE
0606 REWRITE
0608 DELETE
060A UNLOCK
060C STARTBR
060E READNEXT
0610 READPREV
0612 ENDBR
0614 RESETBR
0802 WRITEQ TD
0804 READQ TD
0806 DELETEQ TD
0A02 WRITEQ TS
0A04 READQ TS
0A06 DELETEQ TS
0C02 GETMAIN
0C04 FREEMAIN
0E02 LINK
0E04 XCTL
0E06 LOAD
0E08 RETURN
0E0A RELEASE
0E0C ABEND
0E0E HANDLE ABEND
1002 ASKTIME
1004 DELAY
1006 POST
1008 START
100A RETRIEVE
100C CANCEL
1202 WAIT EVENT
1204 ENQ
1206 DEQ
1208 SUSPEND
1402 WRITE JOURNALNUM
1404 WAIT JOURNALNUM
1602 SYNCPOINT
1802 RECEIVE MAP
1804 SEND MAP
1806 SEND TEXT
1808 SEND PAGE
180A PURGE MESSAGE
180C ROUTE
180E RECEIVE PARTN
1810 SEND PARTNSET
1812 SEND CONTROL
1C02 DUMP
- 119 -
- 120 -
If an EXEC CICS command must be continued onto a second line a hyphen (-) must be
coded in column 7 of the continued line.
If an EXEC CICS command must be continued onto a second line an 'X' must be coded
in column 72 of each line to be continued.
An EXEC CICS command CANNOT be coded within a COBOL IF statement,between the
IF command and the period (.) ending it.
The END-EXEC delimiter is optional and never needs to be placed at the end of a CICS
command.
The options specified within an EXEC CICS command can be in any order. For example
'EXEC CICS SEND FROM(MSG1) LENGTH(30) END-EXEC' can also be coded
'EXEC CICS SEND LENGTH(30) FROM(MSG1) END-EXEC'
Question: .A CICS program ABENDS with an ASRA ABEND code. What is its meaning?
Answer:
1.
2.
3.
4.
5.
A link was issued to a program whose name does not exist in the PPT (Program
Processing Table).
A program attempted to use a map that is not defined in the PCT (Program Control
Table).
A security violation has occurred. The operator is not defined with the proper authority in
the SNT (Sign-on Table) to use a particular file.
A program interrupt (0C0 or 0C1 or 0C2 or ...) has occurred in a CICS program.
An I/O error has occurred when attempting to use a VSAM file from a CICS program
- 121 -
Question: Which of the following commands, when issued by 2 different programs running at the
same time, will prevent simultaneous use of resource 'SINGLE'?
Answer:
1.
embedding four character transid on the top left most corner of the screen.
making use of EXEC CICS START TRANSID ( )
making use of EXEC CICS RETURN TRANSID ( )
By defining the transid in DCT ( destination control table) to enable ATI (AUTOMATIC
TASK INITIATION)
Making use of PLT ( program list table)
By associating four character transid in PCT (program control table)
- 122 -
files. and the DB2 changes are committed. Usually CICS signals Db2 to complete the next phase
and release all the locks.
Question: Answer to ANON's question, diference between TSQ & TDQ
Answer: TDQ is read destructive, TSQ is not. TSQ can be created dynamically, TDQ cannot be
created dynamically. TSQ is temporary in nature (i:e it will be deleted when the program finishes
execution, unless it is made permanent by making a entry in the Temporary Storage Table), TDQ
is not. Hope this will suffice
Question: What is ENQ in CICS?
Answer: If any one want to restrict Trans-Id to single user, enter trans-id with ENQ. It won't allow
any one else to use the same trans-id.
Question: In SYMBOLIC Cursor Positioning after moving -1 to the length field also the cursor is
not positioned in that particular field.Give reasons?
Answer: You have to explicitly specify the word CURSOR between your EXEC CICS and ENDEXEC in the program.
Question: What does EIB mean?
Answer: The EIB is the EXECUTIVE INTERFACE BLOCK. It is not the EXECUTE INTERFACE
BLOCK. All TP monitors or transaction processors are know as EXECUTIVEs as they carry out
process on behalf of a program module. CICS and DB2 are excutives.
Question: How many exceptional condition can be given in a HANDLE CONDITION?
Answer: Max. of 12 exceptional conditions can be given in a single HANDLE CONDITION.
Question: What command do you issue to delete a record in a transient data queue ?
Answer: READQ TD, the read is destructive. Yes it is correct but there is a restriction.U can
deletethe records sequentially.. For example if one want to delete 10 th record directly it is not
possible with this..
Question: How do you access the records randomly in TSQ ?
Answer: By specifying the ITEM option
Question: What command do you issue to delete a record in a transient data queue ?
Answer: READQ TD, the read is destructive.
Question: WHAT ARE DIFFERENT WAYS OF INITIATING TRANSACTION IN CICS
Answer: WE CAN INITIATE CICS TRANSACTION
1.
BY GIVING TRANSACTION ID
2. BY GIVING CICS START COMMAND
3. AUTOMATIC TASK INITIATION.
Question: What is the difference between LINK and XCTL ?
Answer: The XCTL command passes control to another program, but the resources requested by
the first program may still be allocated. A task does not end until a RETURN statement is
- 123 -
executed. While in LINK command, program control resumes its instruction following the LINK
parameter. The disadvantage of LINK is that it requires that both the calling program and the
called program remain in main memory even though both are no longer needed.
Question: What is the difference between CICS Program Control Table (PCT) and CICS
Processing Program Table (PPT) ?
Answer: PCT contains a list of valid transaction ID. Each transaction ID is paired with the name of
the program ,CICS will load and execute when the transaction is invoked. On the other hand,
PPT indicates each program's location which pertains to a storage address if the program has
already been loaded or a disk location if the program hasn't been loaded. PPT will also be used
to determine whether it will load a new copy of the program when the transaction is invoked.
Question: What are the 3 common ways to create maps?
Answer: The first way is to code a physical map and then code a matching symbolic map in your
COBOL program. The second way to create a physical map along with a matching symbolic map
is to code only the physical map using the &SYSPARM option, CICS will automatically create a
member in a COPY library. And the third way is to use a map generator such as SDF (Screen
Definition Facility)
Question: What is Quasi-reentrancy?
Answer: There are times when many users are concurrently using the same program, this is what
we call MultiThreading. For example, 50 users are using program A, CICS will provide 50
Working storage for that program but one Procedure Division. And this technique is known as
quasi-reentrancy
Question: What is the difference between a physical BMS mapset and a logical BMS mapset?
Answer: The physical mapset is a load module used to map the data to the screen at execution
time. The symbolic map is the actual copybook member used in the program to reference the
input and output fields on the screen.
Question: How To Set MDT(Modified Data Tag) Thru Application Program?(Dynamically).
Answer: You have to move the following macro DFHBMFSE to the Attribute field of that particular
Variable.
Question: What CICS facilities can you use to save data between the transactions?
Answer: COMMONAREA, TSQ & TDQ.
Question: How would you release control of the record in a READ for UPDATE?
Answer: By issuing a REWRITE,DELETE, or UNLOCK command or by ending the task.
Question: How would you release control of the record in a READ for UPDATE?
Answer: By issuing a REWRITE,DELETE, or UNLOCK command or by ending the task.
Question: What is the difference between a RETURN with TRANSID and XCTL ?For example
prog. A is issuing REUTRN with TRANSID to prog B. Prog A. is issuing XCTL to prog B.
Answer: In RETURN with TRANSID the control goes to the CICS region and the user have to
transfer the control to prog. B by pressing any of the AID KEYS.In XCTL the control is directly
transfer to prog. B.
- 124 -
Question: What is the maximum number of exceptions that can be specified with a single
HANDLE CONDITION command in CICS ?
Answer: SIXTEEN (16)
Question: WHAT WILL BE THE LENGTH OF THE EIBCALEN ,IF THE TRANSACTION IS USED
TO CICS FIRST TIME?
Answer: THE LENGTH WILL BE 0(ZERO)
.
Question: WHAT IS DFHEIBLK?
Answer: DFHEIBLK is Execute Interface Block. It is placed in the linkage section automatically by
CICS translator program. It must be the first entry in linkage section. CICS places values prior to
giving control to the program and we can find almost any information about our transaction.
Question: What is the difference between the XCTL and LINK commands?
Answer: The LINK command anticipates return of control to the calling program, theXCTL
command does not. Return to the calling program will be the result of the CICS RETURN
command, specifying TRANSID(name of the calling program).
Question: What CICS command would you use to read a VSAM KSDS sequentially in ascending
order?
Answer: First issue a STARTBR(start browse), which will position the browse at the desired
record. Retrieve records by using subsequent READNEXT commands. Indicate the end of
sequential processing with the ENDBR command. If the generic key is specified in the STARTBR
command positioning in the file will be before the first record satisfying the generic key.For
reading in descending order use the READPREV instead ofREADNEXT.
Question: What is the difference between pseudo-conversational and conversational?
Answer: Pseudo-conversational will start a new task for each input. By coding a CICS RETURN
command specifying TRANSID(itself). Conversational will have an active task during the duration
of the data entry.
Question: What is the COMMAREA(communications area)?
Answer: An area used to transfer data between diffrent programs or between subsequent
executions of the same program. Needs to be defined in the Linkage Section.
- 125 -
What is a database?
An integrated and shared repository for stored data or collection of stored operational
data used by application systems of some particular enterprise.
Nothing more than a computer-based record keeping system
Data redundancy
Multiple Views
Shared data
Data independence (logical/Physical)
Data dictionary
Search versatility
Cost effective
Security and Control
Recovery ,restart & Backup
Concurrency
Hierarchical Model
Network Model
Relational Model
Object-Oriented Model
HIERARCHICAL MODEL
- 126 -
NETWORK MODEL
Does not distinguish between parent and child.Any record type can be associated with
any number of arbitrary record types
Enhanced to overcome limitations of other models but in reality there is minimal
difference due to frequent enhancement
Example: IDMS
RELATIONAL MODEL
Data stored in the form of table consists of multiple rows and columns.
Examples: DB2,ORACLE,SYBASE
OBJECT-ORIENTED MODEL
Data attributes and methods that operate on those attributes are encapsulated
instructions called objects.
Types of Integrity
Entity Integrity
Referential Integrity
Domain Integrity
Entity Integrity
Is a state where no column that is part of a primary key can have a null values.
Referential Integrity
Is a state where every foreign key in the first table must either match a primary key value
in the second table or must be wholly null.
Domain Integrity
- 127 -
OBJECTS
Stogroup(Storage group)
Database
Table Space
Table
View
Index
Database
A collection of logically related objects like table spaces, index spaces,tables etc.
Not a physical kind of object, may occupy more than one disk space.
A STOGROUP & BUFFER POOL must be defined for each database.
In a given database, all the spaces need not have the same STOGROUP.
TABLE SPACES
- 128 -
Usually only one table is preferred. This is because a single page can contain rows from
all tables defined in the database.
Can contain more than one stored tables , but in a segmented space.
A segment consists of a logically contiguous set of n pages.
No segment is allowed to contain records for more than one table.
Sequential access to a particular table is more efficient.
Lock Table on table locks only the table, not the entire table space.
If a table is dropped ,the space for that table can be reclaimed within minimum
reorganization.
TABLES
VIEWS
Views can be very practical ways of simplifying queries by reducing the number of
different tables.
Views can also hide sensitive data from users who dont need access to it.
SELECT
- 129 -
EMP
SYNONYMS
Synonym is like a nick name to a table name and when no longer needed it can be
dropped. Synonym access is specific to the user who has created it.
STRUCTURED QUERY LANGUAGE(SQL)
SQL TYPES(Others)
As an end-user you will be using SQL on-line to access data and produce formatted
reports.
As an application programmer, you will use SQL to extract data from one or more tables
and pass these data to another program for additional processing.
SQL task is center about four basic functions & these functions correspond to the four
basic SQL command (SELECT, UPDATE, INSERT, DELETE)
- 130 -
Using the * to indicate all columns should be displayed is inefficient if you dont need to
see all the columns.
You can put the columns in the order you want them.
It is better to specify just those column you want.
- 131 -
Example:
SELECT SNAME ,STATUS, CITY FROM SUPPLIERS ORDER BY STATUS,SNAME
Sometimes a single search condition is not precise enough to select only the rows you
need.So you need to use the logical operator AND and OR.
You can link as many search expression as you want using AND and OR.
Using both operator together , searched expression linked by AND are paired up
first.Parentheses can be used to force expression to be paired together.
By adding the keyword DISTINCT immediately following SELECT , you suppress any
duplicates. SELECT DISTINCT STATUS FROM SUPPLIERS
IN
Lets you retrieve data from each row whose columns has a value equal to one of the
several listed values.
Example: WHERE STATUS IN (20,10,30)
Any row with STATUS column value of 20,10, 30 is selected.
Each character value must be in quotes.
Values are separated by comma & values list is enclosed in parenthesis.
BETWEEN
Lets you retrieve data from each row whose columns has a value with two limits.
Example: WHERE STATUS BETWEEN 10 AND 30
Any row with STATUS column value of 10 thru 30 is selected.
- 132 -
LIKE
Lets you retrieve data from each row whose columns has a value similar to the value
specified in the WHERE CLAUSE.
Example: WHERE SNAME LIKE B%C
Any row with name column beginning with B followed by ANY VALUE of ANY LENGTH,
and ending with C is selected.
A % represents any value of any length,where as an underscore _ represents any
single character LIKE cant use for any numeric column.
What is NULL?
To select all rows with a NULL value in the COMM column, you must use WHERE
COMM IS NULL as your search condition
To select all rows that do NOT have a NULL value, you must use WHERE COMM IS
NOT NULL as your search condition
Note:
WHERE COMM = 0 Who has earned no commission?
WHERE COMM IS NULL Who is ineligible for commission?
ARITHMETRIC EXPRESSIONS
An arithmetic expression is a calculation using numeric values and one or more of the
arithmetic operators :addition (+), subtraction (-), multiplication (*), and division (/).
Example: SELECT SALARY + COMM,NAME,DEPT
Arithmetic expressions can also be used in a WHERE clause: WHERE SALARY +
COMM >5000.00
- 133 -
SQL works from left to right, evaluating multiplication and division before addition and
subtraction (*, / , +, -).
However any expressions in parentheses are evaluated first.
BUILT IN FUNCTION
SUM
MAX
MIN
AVG
COUNT(*)
COUNT(DISTINCT col name)
SUM
Display either the highest or lowest value found in the rows selected by the query.
SELECT MAX(SALARY),MIN(SALARY) FROM EMP
AVG
COUNT(*)
- 134 -
It counts only those rows that have a unique value in the specified column
SELECT COUNT(DISTINCT STATUS) FROM SUPPLIERS
COUNT (*) counts all the rows selected
COUNT(DISTINCT col name) does not count rows with a duplicate value in the specified
column.
COUNT(DISTINCT col_name) does not count rows that have NULLS in the specified
column.
When you request a built-in summary functions, SQL goes through several steps to reach
a result.
First, all the rows and columns are selected. This intermediate result is kept in a
temporary table.
Next, the system process your GROUP BY request, creating a temporary table for each
GROUP and putting the appropriate rows in each table.
Then the built-in functions are calculated.
If, for example you requested an AVG, then the average for each temporary sub group is
calculated.
GROUP BY
HAVING
JOINING
Joining tables involves matching the rows of one table with related rows of another table
to produce a table consisting of rows with columns from both the original tables.
It will combine related information from two tables into a single row.
- 135 -
If a value appears once in the joining column of one table, but several times in the
other, the higher number of occurrences will appear in the output table.
If a value exists in the joining column of one table, but not in the other, no row appears
in the output table with that value.
JOINING COLUMN
It is a column that is common to all the tables being joined and contains the row values
that tie one table to next.
MERGING
Merging tables also involves combining data from two tables, but the rows are not joined
together.
Example:SELECT *FROM EMP UNION SELECT * FROM SUPPLIER
UNION sorts the result tables, UNION ALL does not. In other words, UNION mixes rows
together in the output. UNION ALL outputs all the rows from the first table that meet the
search condition. UNION removes duplicate rows, UNION ALL does not.
Each column selected from first table must be compatible with the corresponding
columns from the second table.
A numeric column are compatible with numeric column, a character column to a
character column, and so on.
Numeric data types need not be the same column length You must select the same
number of columns from each tables.
- 136 -
To create a new table you must use the SQL statement CREATE TABLE. You must
specify the table name and the names and attributes of each column.
Maximum 18 characters
Permissible characters
o letters of the alphabet
o @, #, and $
o numbers
o underscore (_)
The first character must be alphabetic or @,#, or $
DATA TYPES
Data type depends on the nature of the data itself and will always be one of two types
NUMERIC or CHARACTER
o Types of CHARACTER column
CHAR Allows any values to be entered in the column. All entries are
the same length
VARCHAR Allows any values to be entered in the column. All entries
are the varying length
o Types of NUMERIC columns
INTEGER - For very large integers up to 2,147,483,647
SMALLINT - For small integer up to 99999 Table Space
DECIMAL - For numbers with a fixed number of decimal places after the decimal point.
The number can have a total of 15 digits
FLOAT -For very large numbers with an undetermined number of decimal places after
the decimal point
Types of DATE/TIME columns
o DATE - Dates are stored in YYYYMMDD format
o TIME - Times are stored on a 24-hour clock in HHMMSS format
TIMESTAMP TIMESTAMP columns contain both date and time information, with the
time value accurate to the millisecond.
- 137 -
PRIVILEGES
The only change you can make to a table or view after it has been created is to add an
additional column.
This is done with the SQL command ALTER
o ALTER TABLE EMP ADD COMM DECIMAL (7 ,2)
DROP
When you no longer need a TABLE, VIEW, or SYNONYM you can DROP them.
o DROP TABLE SUPPLIER
o DROP VIEW EMP_VIEW
o DROP SYNONYM S
INSERTING A TABLE
UPDATE
SQL provides two commands for updating row values UPDATE and SET.
UPDATE tells SQL which table you want to update and SET provides the name of the
column to update and the new value for the column.
You tell SQL which row to update with a WHERE clause can be very specific, so that a
single row gets changed, or it can be very general, so that many rows get updated.
o <B>UPDATE SUPPLIER SET STATUS = 40 WHERE S# = S1
o UPDATE EMP SET SALARY = SALARY + SALARY *.01
DELETE
Using the DELETE command you can delete rows and using WHERE clause you can
specify which rows you want to delete.
o DELETE FROM SUPPLIER WHERE S# = S1
- 138 -
Complex SQLs
One terms a SQL to be complex when data that is to be retrieved comes from more than
one table.
SQL provides two ways of coding a complex SQL
o Subqueries and Join
SUB QUERIES
JOINS
OUTER JOIN
INNER JOIN
OUTER JOIN
For one or more tables being joined both matching and the non-matching rows are
returned.
Duplicate columns may be eliminated.
Non-matching columns will have nulls.
INNER JOIN
Here there is a possibility one or more of the rows from either or both tables being joined
will not be included in the table that results from the join operation
QMF- Query Management Facility
- 139 -
SPUFI menu contains the input file in which the SQL statements are coded , option for
default settings and editing and output file.
Program Preparation
Precompile
Compile & Link
Bind
o Package
o Plan
Precompile
Searches all the SQL statements and DB2 related INCLUDE members and comments
out every SQL statement in the program.
The SQL statements are replaced by a CALL to the DB2 runtime interface module along
with parameter.
All SQL statements are extracted and put in a DBRM.
Places a time stamp in the modified source and the DBRM so that these are tied.
All DB2 related INCLUDE statements must be placed between EXEC SQL & END-EXEC
key words for the precompiler to recognize them.
Bind
Package
Advantages of Package
- 140 -
Plan
DB2 Optimizer
Analyzes the SQL statements and determines the most efficient way to access data,
gives physical data independence.
It evaluates the following factors: CPU cost, I/O cost, DB2 catalogue statistics & the SQL
statements
It estimate CPU time , cost involved in applying predicates traversing pages & sorting.
It estimates the cost of physically retrieving and writing data.
Host Variables
These are variables defined in the host language to use the predicates of a DB2 table.
These are referenced in the SQL statement.
A means of moving data from and to DB2 tables.
DCLGEN produces host variables the same as the columns of the tables.
DCLGEN
- 141 -
SQLCA
CURSOR
DECLARE:
EXEC SQL
DECLARE empcur CURSOR FOR
SELECT empno, ename, dept, job
FROM emp WHERE dept=D11
FOR UPDATE OF job
END-EXEC.
OPEN: for the OPEN statement
EXEC SQL
OPEN empcur
END-EXEC.
FETCH: for the FETCH statement
EXEC SQL
FETCH empcur
INTO :empno, :ename, :dept, :job
END-EXEC.
- 142 -
DB2 LOCKING
Catalogue Tables
- 143 -
DB2 Utilities:UTILITIES
CHECK
COPY
MERGECOPY
RECOVER
LOAD
REORG
RUNSTATS
EXPLAIN
CHECK
COPY
Used to create an image copy for the complete table space or a portion of the table
space- full image copy or incremental image copy.
Every successful exception of COPY utility places in the table, SYSIBM.SYSCOPY, at
least one row that indicates the status of the image copy.
MERGECOPY
The MERGECOPY utility combines multiple incremented image copy data sets into a
new full or incremental image copy dataset.
RECOVER
LOAD
- 144 -
REORG
To reorganize DB2 tables and indexes and there by improving their efficiency of access
re-clusters data, resets free space to the amount specified in the create DDL ,statement
and deletes and redefines underlying VSAM datasets for stogroup defined objects.
EXPLAIN
Explain can be used to obtain the details about the access paths chosen by the DB2
optimizer for SQL statements.
Used specifically for performance monitoring.
When EXPLAIN is requested the access paths that the DB2 chooses are put in coded
format into the table PLAN_TABLE, which is created in the default database by the user.
The other method is specifying EXPLAIN YES with BIND command
The PLAN_TABLE is to be queried to get the required information
Since the EXPLAIN results are dependent on the DB2 catalogue, it is better to run
RUNSTAT before running EXPLAIN.
- 145 -
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
How would you find out the total number of rows in a table?
o Use SELECT COUNT(*) ...
How do you eliminate duplicate values in SELECT?
o Use SELECT DISTINCT ...
How do you select a row using indexes?
o Specify the indexed columns in the WHERE clause.
What are aggregate functions?
o Built-in mathematical functions for use in SELECT clause.
How do you find the maximum value in a column?
o Use SELECT MAX(...)
Can you use MAX on a CHAR column?
o Yes.
My SQL statement SELECT AVG(SALARY) FROM EMP yields inaccurate results. Why?
o Because SALARY is not declared to have NULLs and the employees for whom
the salary is not known are also counted.
How do you retrieve the first 5 characters of FIRSTNAME column of EMP table?
o SELECT SUBSTR(FIRSTNAME,1,5) FROM EMP;
How do you concatenate the FIRSTNAME and LASTNAME from EMP table to give a
complete name?
o SELECT FIRSTNAME ' ' LASTNAME FROM EMP;
What is the use of VALUE function?
o Avoid -ve SQLCODEs by handling nulls and zeroes in computations
o Substitute a numeric value for any nulls used in computation
What is UNION,UNION ALL?
o UNION : eliminates duplicates
UNION ALL: retains duplicates
Both these are used to combine the results of different SELECT statements.
Suppose I have five SQL SELECT statements connected by UNION/UNION ALL, how
many times should I specify UNION to eliminate the duplicate rows?
o Once.
What is the restriction on using UNION in embedded SQL?
o It has to be in a CURSOR.
In the WHERE clause what is BETWEEN and IN?
o BETWEEN supplies a range of values while IN supplies a list of values.
Is BETWEEN inclusive of the range values specified?
o Yes.
What is 'LIKE' used for in WHERE clause? What are the wildcard characters?
o LIKE is used for partial string matches. '%' ( for a string of any character ) and '_'
(for any single character ) are the two wild card characters.
When do you use a LIKE statement?
o To do partial search e.g. to search employee by name, you need not specify the
complete name; using LIKE, you can search for partial string matches.
What is the meaning of underscore ( '_' ) in the LIKE statement?
- 146 -
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
- 147 -
Yes.
32. How do you leave the cursor open after issuing a COMMIT? (for DB2 2.3 or above only )
Use WITH HOLD option in DECLARE CURSOR statement. But, it has not effect
in psuedo-conversational CICS programs.
33. Give the COBOL definition of a VARCHAR field.
o A VARCHAR column REMARKS would be defined as follows:
10 REMARKS.
49 REMARKS-LEN
34. What is the physical storage length of each of the following DB2 data types: DATE, TIME,
TIMESTAMP?
DATE:
4bytes
TIME:
3bytes
TIMESTAMP: 10bytes
35. What is the COBOL picture clause of the following DB2 data types: DATE, TIME,
TIMESTAMP?
DATE:
PIC X(10)
TIME :
PIC X(08)
TIMESTAMP: PIC X(26)
36. What is the COBOL picture clause for a DB2 column defined as DECIMAL(11,2)?
- 148 -
39. Can I alter a table (e.g. adding a column) when other user is selecting some Columns or
40.
41.
42.
43.
44.
DSN SYSTEM(DSP3)
RUN PROGRAM(EDD470BD) PLAN(EDD470BD)
LIB ('EDGS01T.OBJ.LOADLIB')
END
o
Use IKJEFT01 utility program to run the above DSN command in a JCL.
45. Is it mandatory to use DCLGEN? If not, why would you use it at all?
46.
47.
48.
49.
- 149 -
50. How do you simulate the EXPLAIN of an embedded SQL statement in SPUFI/QMF? Give
SELECT EMP_NAME
FROM EMP
WHERE EMP_SALARY > ?
51. What is ACQUIRE/RELEASE in BIND?
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
Determine the point at which DB2 acquires or releases locks against table and
Table spaces, including intent locks.
In SPUFI suppose you want to select max. of 1000 rows, but the select returns only 200
rows. What are the 2 sqlcodes that are returned?
o 100 (for successful completion of the query), 0 (for successful COMMIT if
AUTOCOMMIT is set to Yes).
How would you print the output of an SQL statement from SPUFI?
o Print the output data set.
What does it mean if the null indicator has -1, 0, -2?
o -1 : the field is null
o 0 : the field is not null
o -2 : the field value is truncated
How do you retrieve the data from a nullable column?
o Use null indicators. Syntax ... INTO :HOSTVAR:NULLIND
What else is there in the PLAN apart from the access path?
o PLAN has the executable code for the SQL statements in the host program
What is lock escalation?
o Promoting a PAGE lock-size to table or table space lock-size when a transaction
has aquired more locks than specified in NUMLKTS. Locks should be taken on
objects in single table space for escalation to occur.
When is the access path determined for dynamic SQL?
o At run time, when the PREPARE statement is issued.
What are the various locks available?
o SHARE, EXCLUSIVE, UPDATE
What is sqlcode -811?
o SELECT statement has resulted in retrieval of more than one row.
What are the advantages of using a PACKAGE?
o Avoid having to bind a large number of DBRM members into a plan
o Avoid cost of a large bind
o Avoid the entire transaction being unavailable during bind and automatic rebind
of a plan
o Minmize fallback complexities if changes result in an error.
What is REORG? When is it used?
o REORG reorganizes data on physical storage to re-cluster rows, positioning
oveflowed rows in their proper sequence, to reclaim space, to restore free space.
It is used after huge updates, inserts and delete activity and after segments of a
segmented table space have become fragmented.
How does DB2 store NULL physically?
- 150 -
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
as an extra-byte prefix to the column value. physically, the nul prefix is Hex '00' if
the value is present and Hex 'FF' if it is not
What is CHECK PENDING?
o When a table is LOADed with ENFORCE NO option, then the table is left in
CHECKPENDING status. It means that the LOAD utility did not perform
constraint checking.
When do you specify the isolation level? How?
o During the BIND process. ISOLATION (CS/RR)...
What is a DBRM, PLAN?
o DBRM: DataBase Request Module, has the SQL statements extracted from the
host language program by the pre-compiler.
o PLAN: A result of the BIND process. It has the executable code for the SQL
statements in the DBRM.
Is DECLARE TABLE in DCLGEN necessary? Why it used?
o 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.
What do you need to do before you do EXPLAIN?
o Make sure that the PLAN_TABLE is created under the AUTHID.
What is a collection?
o a user defined name that is the anchor for packages. It has not physical
existence. Main usage is to group packages.
How can you quickly find out the # of rows updated after an update statement?
o Check the value stored in SQLERRD(3).
What is EXPLAIN?
o EXPLAIN is used to display the access path as determined by the optimizer for a
SQL statement. It can be used in SPUFI (for single SQL statement ) or in BIND
step (for embedded SQL ).
Where is the output of EXPLAIN stored?
o In userid.PLAN_TABLE
Suppose I have a program which uses a dynamic SQL and it has been performing well till
now. Off late, I find that the performance has deteriorated. What happened?
o Probably RUN STATS is not done and the program is using a wrong index due to
incorrect stats. Probably RUNSTATS is done and optimizer has chosen a wrong
access path based on the latest statistics.
What are the contents of a DCLGEN? - GS
o EXEC SQL DECLARE TABLE statement which gives the layout of the table/view
in terms of DB2 data types.
o A host language copy book that gives the host variable definitions for the column
names.
Will pre-compile of an DB2-COBOL program bomb, if DB2 is down?
o No. Because the pre-compiler does not refer to the DB2 catalogue tables.
What are the isolation (also called isolation parameters) levels possible?
o CS: Cursor Stability
o RR: Repeatable Read
What is the picture clause of the null indicator variable?
o S9(4) COMP.
EXPLAIN has output with MATCHCOLS = 0. What does it mean?
- 151 -
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
o
92. What is FREEPAGE and PCTFREE in TABLESPACE creation?
- 152 -
Outer join is one in which you want both matching and non matching rows to be
returned. DB2 has no specific operator for outer joins, it can be simulated by
combining a join and a correlated sub query with a UNION.
96.
o
97. What is the difference between primary key & unique index?
- 153 -
Changman frame:CHANGEMAN
Change Man is a system that manages and automates the process of migrating
software, or applications, from a development environment to a production environment. Change
Man can manage the installation of a variety of components, such as:
- 154 -
The first step is to Create a Change Package. A Change Package contains all of the
elements to be edited and installed into production, and is identified by a unique package ID
automatically generated by Change Man. When a Change Package is created, the
information that Change Man needs in order to track and control the package is entered. This
includes the implementation instructions, whether it is a temporary or permanent change, the
installation date and time, etc.
The typical next step is to Checkout components from baseline. With checkout,
components from your baseline libraries are copied to either a Change Man staging library or
to a personal development library where changes can be made.
Changes may now be Edited in either the Change Man staging or in the development
libraries.
Once editing is completed, the components are ready to Staged. We use the STAGE
function within Change Man to edit a component, compile and link edit a program.
Components such as copy members are simply copied into the staging libraries, if they arent
there already. The Change Package is now ready for Testing.
The audit process ensures that no unexpected problems will occur. For example, if a
component in the production library has been changed since it was checked out, Change
Man alerts you to the problem by creating an out-of-sync condition for the package.
After successfully passing the audit, the next step is to Freeze the Change Package. This
locks the package(prohibiting further changes), and makes the package available for the
promotion and approval processes. Promotion allows a Change Package to be moved
through various levels of testing (e.g. promote from system testing to acceptance testing).
Once all of the necessary Approvals have been done, the package is ready to be installed.
The installation process depends upon the option used for installation, while creating
package.
Once the package has been installed, Change Man will perform the Baseline Ripple.
Baseline Ripple is the process that Change Man executes to version all package
components, i.e.: 0 becomes 1, -1 becomes 3, etc. and the new baseline 0 version is
installed.
- 155 -
1 Build
- 156 -
NOTIFICATION UPDATED
0 Dates
1 Create
2 Update
3 Custom
- 157 -
When you create the Change Package, you are defining the outer structure of the change
Package. You specify the date and time for installations, whether the package is temporary or
permanent, the installation site, and implementation instructions, etc. Once you have completed
the following four panels, the package is automatically assigned a unique Change Package ID.
Create a New Package:
This panel is to allow you to define package control information. This panel is displayed when
option 1 is selected form the previous menu (Build Change Package)
Panel 1 of 4.
------------------------- CREATE: CREATE A NEW PACKAGE -----------------------OPTION ===>
L Long method - Prompt for package description and special instructions
PACKAGE TITLE ===>
APPLICATION
REQUESTER'S NAME
REQUESTER'S PHONE
WORK REQUEST ID
DEPARTMENT
PACKAGE LEVEL
===>
===>
===>
===>
===>
===>
(1-Simple, 2-Complex,
3-Super, 4-Participating)
PACKAGE TYPE
===>
(Planned or Unplanned,
===>
(Permanent)
===>
- 158 -
All the fields are required for the first time you create a Change Package. SO Enter the Relevant
data and press Enter.
General Information:
This panel allows you to enter a description of the Change Package. It should be as complete
and descriptive as possible.
Panel 2 of 4
------------------------- CREATE: PACKAGE DESCRIPTION ------ Row 1 to 12 of 12
COMMAND ===>
- 159 -
'''' ________________________________________________________________________
'''' ________________________________________________________________________
******************************* Bottom of data ********************************
Implementation Instructions:
Use this panel to specify how the package is to be installed. This include the installation
method,and specific implementation instructions to be used by in the individual overseeing the
installation
Panel 3 of 4
---------------------- CREATE: INSTALLATION INSTRUCTIONS --- Row 1 to 12 of 12
COMMAND ===>
(CMN)
- 160 -
'''' ________________________________________________________________________
'''' ________________________________________________________________________
'''' ________________________________________________________________________
'''' ________________________________________________________________________
'''' ________________________________________________________________________
'''' ________________________________________________________________________
'''' ________________________________________________________________________
'''' ________________________________________________________________________
Create onsite information:
Use this panel to select the install date and time. Ensure that these fields are correct, and modify
them or the contacts fields as necessary.
Panel 4 of 4
------------------------- CREATE: ON SITE INFORMATION ------------------------COMMAND ===>
INSTALL DATE/TIME
YYMMDD FROM TO
990316 0400 0415
PRIMARY/BACKUP CONTACTS
PHONE NUMBERS
- 161 -
After the information in the above panel is filled, press ENTER Change man will then
automatically create your change package, return you to the first CREATE panel, and display the
change package number in the upper right hand corner of the panel.
The Checkout Process:
Once the package is created next process Is checkout. select option 1.5 from primary option
menu. Use this panel to select the list of components to be viewed. Select from components in
the baseline libraries, or components already defined to the Change Package from a previously
coped package.
------------------------------- CHECKOUT OPTIONS -----------------------------OPTION ===>
Checkout:
Use this panel to enter the checkout information, such as the package to which the component is
to be checked out, the type of component, how the component is to be checked out(foreground of
batch), and the name of the component that is to be checked out, etc.,
- 162 -
PACKAGE ID
===> CP1
===>
CHECK OUT TO
===> S
===> PDS
===> 1
(Y/N)
(1-Online, 2-Batch)
- 163 -
Stage:
Once the components have been check out, they must be STAGED. you will use the STAGE
function within Change Man to edit a component, compile and link edit a program, or to submit
another transformation type of process like a JCL scan etc.
Use the panels on the following page to complete the staging process for your Change Package
components. Once these panels are completed, the component list will be displayed. From it you
may browse ,edit,delete,recompile,display the source/load relationship, or stage a component for
a list of valid selection codes.
The Staging Process:
Stage Options:
Use this panel to tell Change Man where to get the components that are to be staged. Choose
from a personal library or from existing components within the Change Package option is 1.6
Panel 1 of 1
-------------------------------- STAGE OPTIONS -------------------------------OPTION ===>
1 Dev
- 164 -
CHANGED
LANGUAGE PROCNAME ID
990403 045047
REQUEST
VEN214
990403 045220
VEN214
990403 045057
VEN214
STATUS: DEV
- 165 -
STAGED NAME:
LIBRARY TYPE:
LANGUAGE:
LCC261
HI3 - IMS Online COBOL LE/370 load to ILM
COBOL370
DATASET NAME:
D131.CP000000.CMN.HFCG.#003411.HI3
COMPILE PROCEDURE ===> COBOL370 (Blank for list; ? for designated procedure)
COMPILE PARMS OR JOB NAME ===>
(Enter JOB Name for PROCs requiring associated JOB for JCLCHECK)
LINK EDIT PARMS ===>
DB2 PRE-COMPILE ===> NO
(Y/N)
OTHER OPTIONS
===> YES
(050D,WD1A),'CHNGMAN
===>
MSGCLASS=T,NOTIFY=VEN080___________________________________________
//
===> //*_____________________________________________________________________
===>
/*ROUTE
PUNE______________________________________________________
- 166 -
NAME: LCC261
COMPILE ONLY
CICS PRE-COMPILE
TYPE: HI3
===>
===>
LANGUAGE: COBOL370
===>
USER OPTION 10
===>
USER OPTION 11
===>
USER OPTION 12
===>
USER OPTION 13
===>
USER OPTION 14
===>
USER OPTION 15
===>
USER OPTION 16
===>
USER OPTION 17
===>
USER OPTION 18
===>
USER OPTION 19
===>
USER OPTION 20
===>
- 167 -
===> HFCG
===>
PACKAGE STATUS
===>
WORK REQUEST ID
DEPARTMENT
===>
===>
PACKAGE LEVEL
===>
(1-Simple, 2-Complex,
3-Super, 4-Participating)
PACKAGE TYPE
===>
(Planned or Unplanned)
===>
(Permanent or Temporary)
===>
(YYMMDD)
TO INSTALL DATE
===>
===>
===>
===>
(YYMMDD)
(YYMMDD)
(YYMMDD)
(Y/N)
- 168 -
VEN214
VEN214
PACKAGE ID
===> HFCG003411
COMPONENT NAME
===>
- 169 -
===>
===>
(Baseline 0, Promotion 1 to n)
blank - Display LCT member selection list for multiple member processing
PACKAGE ID
RELINK FROM
LCT MEMBER LIST
library type)
===> HFCG003411
===> S
(S-Staging or B-Baseline)
===>
===>
COMPILE PROCEDURE
LINK EDIT PARMS
===>
===>
- 170 -
DB2 PRE-COMPILE
===>
OTHER OPTIONS
===> YES
(Y/N)
(Y/N for additional user options)
(050D,WD1A),'CHNGMAN
===>
MSGCLASS=T,NOTIFY=VEN080___________________________________________
//
===> //*_____________________________________________________________________
===>
/*ROUTE
PUNE______________________________________________________
- 171 -
KEY FEATURES:
o Eliminates ISPF editing restrictions
-
provides on-line editing of sequential, BDAM, PDS, ISAM, IAM, and VSAM files using
formatted, full-screen displays
provides optional audit trail of all records updated, inserted, and deleted while editing a
data file
superimposing
files
the
record
layout
over
raw
data
brings
meaning
to
that
data
may
be
printed
in
formatted
- 172 -
manner
using
the
record
layout
- 173 -
This option consists of the ISPF-provided parameter option screens and several screens to
specify File-AID default parameters.
OPTION 1 - BROWSE FILE
This option is used to display but not change the contents of files using any of three display
modes - formatted, vertical, and character.
OPTION 2 - EDIT FILE
This option is used to create, display and change the contents of files using the formatted,
vertical, and character display modes.
OPTION 3 - UTILITIES/E
This option accesses a menu of dataset management utilities. Included are:
3.1 Library (PDS directory management and CSECT info),
3.2 Dataset (Non-VSAM dataset allocation, information),
3.3 Copy (Selective record copying for all file types including PDS members),
3.4 Catalog (search catalog using pattern characters)
3.5 VSAM (Define VSAM clusters, indexes, and paths online or in batch),
3.6 Search/Update (Scan or perform global changes for any dataset),
3.7 VTOC (Search volumes for datasets using pattern characters, analyze space),
3.8 Interactive (run File-AID/Batch online),
3.9 Submit (create batch JCL).
OPTION 5 - PRINT FILE
This option is used to print data file contents, the selection criteria and rcd/layout XREFs
created in options 6 and 7 of File-AID, formatted record layouts, and audit trail datasets created
while editing a data file in option 2 (Edit) or 3.6 (Update) of File-AID.
OPTION 6 - EDIT SELECTION CRITERIA
This option is used to create and maintain selection criteria for use in the Browse, Edit, Copy,
Print, and Compare functions.
OPTION 7 - EDIT RCD/LAYOUT XREF
- 174 -
This option is used to create and maintain rcd/layout XREFs for use in other File-AID
functions.
OPTION 8 - VIEW RECORD LAYOUT
This option is used to display the contents of COBOL or PL/I layouts as interpreted by File-AID.
OPTION 9 - REFORMAT FILE
This option allows the records of an input file to be reformatted and written to an output file
based on record layouts defining the input and output files.
OPTION 10 - COMPARE
This option is used to compare two files and report the differences between
them.
OPTION C - File-AID CHANGES
This option documents changes made in the various releases of File-AID.
GENERAL INFORMATION SCREEN FORMATS
File-AID uses the full screen for display and entry of data.
The first three lines of each display, called the heading lines, have a common format for all FileAID displays. The remainder of the screen may contain a list of options, input fields and prompts,
or scrollable data.
The first three lines of each display are formatted as follows:
|----------------------------------------|------------------------ --|
line 1: | TITLE
| SHORT MESSAGE |
---|
| SCROLL |
|-----------------------------------------------------------------------|
The TITLE area (line 1) identifies the function being performed and, where appropriate, library or
dataset information.
- 175 -
|************************************************
The example at the right
| COMMAND ===>
specification screen.
|
| Edit Mode
===> C (F=Format
|
| Specify Edit Information:
|
===> FASAMP.*
Member name
===>
Volume serial
Disposition
|
===>
(Blank or
(If datas
- 176 -
===> N (Y = Yes;
Several fields on dataset specification screens are pre-entered with values that you entered the
last time on that screen or on a similar screen. If the values are correct, simply press ENTER. If
the values are not correct, overtype the fields that need to be changed before pressing
ENTER.
The pre-entered information comes from your user profile, which File-AID automatically builds
and maintains across sessions. Information that is maintained in your user profile
includes:
|************************************************
The example at the right
| COMMAND ===>
partitioned dataset
| TEST1
01.04
08/17/93 09/23/
PROJECT.TEST.DATA
| TEST2
01.02
06/12/93 09/13/
NAME
VER.MOD
| S TESTFIL3
| TESTFIL4
01.13
01.07
- 177 -
CREATED
LAST M
07/29/93 09/20/
08/01/93 08/29/
| TESTFIL5
01.11
07/01/93 09/01/
Scrollable data display screens show file contents or record layouts and allow up/down
scrolling, and in some cases left/right scrolling. On many scrollable data display screens, you can
also update file contents by typing over fields on the screen.
The example below shows the edit formatted screen. You can scroll using the UP and DOWN
commands, and can update file contents by typing over the FIELD VALUE column.
File-AID ---- EDIT - PROJECT.TEST.DATA(TESTFL3) -------------------- LINE 00001
COMMAND ===>
RCD SEQ NO 1
--------LEVEL NUMBER/DATA-NAME--------- -OFFSET- ---------FIELD VALUE---------01 ORDER-LINE
05 ITEM-NO
PS/2 MOD50
05 QTY-ORDERED
11
100
05 LIST-PRICE
14
2400.00
===>
OR at the following RBA
- 178 -
Starting RBA
===>
===> 0
- 179 -
UP
* Causes scrolling toward the top of a record, file, record layout, or member list.
DOWN * Causes scrolling toward the end of a record, file, record layout, or member list.
LEFT * Causes scrolling toward the left margin of the data or causes backward scrolling
towards the beginning of a file.
RIGHT * Causes scrolling toward the right margin of the data or causes forward scrolling
towards the end of a file.
FORWARD
BACK
LOCATE
name.
LOCATE
Causes up or down scrolling to the record with a label (dataname) or exclude
classification. Also causes scrolling to a data-name that contains, in part or full, the data
name(occ) string.
LR
Causes forward or backward scrolling to a specified record number, label, or any record
with a label classification.
RECORD MANIPULATION COMMANDS
Record manipulation commands allow you to update file contents and to find and change
occurrences of a string in a file.
The record manipulation commands are:
INSERT
files)
Causes "n" records to be inserted after the current record (not supported for BDAM
DELETE Causes "n" records to be deleted beginning with current record (not supported for
BDAM files)
REPEAT
files)
FIND
- 180 -
SAVE
UNDO
When using an XREF to work with "segmented" records the following are valid:
ADD
NEXT
REMOVE
TOP
USE
MISCELLANEOUS COMMANDS
Miscellaneous commands cover a variety of functions. They are listed and briefly described
below.
- 181 -
KEY
Causes a specified key to be retrieved or the key specification screen to be displayed
(applies to BDAM, ISAM, VSAM-KSDS, VSAM-RRDS, and IAM files only)
HEX
CAPS * Causes alphabetic data entered from the terminal to be either translated to upper case
or left as-is
RESET * Causes a general resetting of intensified messages and incomplete line commands
CHAR
mode
FORMAT Causes a switch from Vertical or Character editing modes to Formatted editing mode
(Aliases: FMT, MAP)
VFMT
mode
SPLIT
line
* Causes split screen mode to be entered or changes the location of the split
SWAP * Moves the cursor to wherever it was previously positioned on the other logical screen
of a split screen pair
TSO
KEYS * Causes an immediate display of a screen on which current PF key definitions are
displayed and modifiable
PANELID * Causes all subsequent screens to be displayed/not displayed with the panel identifier
shown in the upper left corner of the screen
HELP
tutorial
- 182 -
use
PA2
to
reshow
the
last
full
screen
image
displayed
by
File-
You may need to reshow the screen if you accidentally press the ERASE INPUT or CLEAR key,
or if you have typed data on the screen that you want ignored and have not yet pressed ENTER
or a PF key.
DEFAULT ASSIGNMENT
| HELP
|
|
| SPLIT
|
|
- 183 -
|--------------|-------------|---------------
| PF4/16
| PF5/17 | PF6/18
| RETURN |
RFIND
RCHANGE |
|
|
|---------------|------------|-----------------|
|
PF9/21
PF7/19
PF8/20
|
|
SWAP
UP
DOWN
|
|
|
|---------------|-------------|-----------
------|
|
PF12/24
PF10/22
PF11/23
RIGHT
|
|
LEFT
RETRIEVE |
|
|
|
|----------------|------------|-----------
------|
GENERAL INFORMATION SCROLLING
In many File-AID functions, the information to be displayed exceeds the screen size. Scrolling
allows you to move the screen "window" in as many as three dimensions across the information:
up/down, left/right, and forward/back.
You accomplish this using two basic types of scrolling:
PAGE SCROLLING
The page scrolling commands and default PF key assignments are:
UP
- 184 -
COMMAND ===> 5
- 185 -
The LEFT (PF10/PF22) and RIGHT (PF11/PF23) commands can be used in place of BACK and
FORWARD, respectively.
These commands apply to the screens where one "record" per screen is displayed formatted with
a record layout (edit/browse Formatted, edit formatted field selection criteria, define formatted
XREF) and are used to move forward or backward "n" records (or criteria sets) in a file.
You enter the scroll amount for record scrolling in the COMMAND input area (unless you have
assigned both the command and the scroll amount to a PF key). Valid scroll amounts
are:
- a number from 1 to 2,147,483,647 - specifies the number of records to scroll FORWARD or
BACK
- MAX or M - specifies scrolling to the last record (FORWARD) or the first record (BACK) in the
file
GENERAL INFORMATION SPLIT SCREEN
There may be times when you want to perform another File-AID function or ISPF/PDF function
without ending the current function. File-AID provides the ability to 'split' the physical screen
image into two logical screens that operate independently of one another, as though you had two
terminals.
In split screen mode, only one of the logical screens is considered active at a time. Any
interactions, such as pressing ENTER or a PF key, are interpreted as having meaning for the
active screen. The current location of the cursor identifies which of the two screens is active. To
switch from one screen to the other, simply move the cursor to the desired screen or enter the
- 186 -
SWAP command.
GENERAL INFORMATION TERMINATING File-AID
You can terminate File-AID in any of three ways:
1) by entering the END command on the primary option menu
2) by entering option X on the primary option menu
3) by entering the =X jump command from any screen
When you invoke File-AID from the ISPF primary option menu, eventually terminate ISPF/PDF
using the END command, and used either the log or list files, a termination screen is displayed.
GENERAL INFORMATION File-AID DATASETS
General information about the use of datasets by File-AID follows. Each topic is presented in
sequence, or may be selected by number:
1 - Conventions for Specifying Datasets
2 - Data File Dataset
3 - Record Layout Dataset and source language support
4 - Layout XREF Dataset
5 - Selection Criteria Dataset
6 - Reformat Definition Dataset
7 - Member List Processing
All datasets processed on-line must reside on a direct access storage device or on a mass
storage device. Uncataloged disk data file datasets are allowed in all functions and can be
accessed by specifying a VOLSER.
Temporary data files and tape datasets are allowed as input to independent File-AID/Batch jobs
for which you develop the JCL. File-AID/Batch JCL can be optionally generated with Copy (3.3),
Search/Update (3.6), Print (5.x), Reformat (9), and Compare (10)
- 187 -
If you omit the apostrophe(s), your TSO prefix is left-appended to the entered data set name
(unless the TSO profile option "NOPREFIX" has been specified).
If you specify a default VSAM INTERMEDIATE NAME with the 0.1 System Parameters function,
and/or your installation uses the optional File-AID VSAM high level index, and no dataset can
be
Found with the combination of "TSO-PREFIX.DATASET", a new "VSAM prefix" is constructed as
follows:
VSAM high level index.VSAM INTERMEDIATE NAME.
The constructed "VSAM prefix" is then left-appended to the entered dataset name (VSAM
prefix.dataset) and the catalog is again searched for the dataset. If allocating a VSAM cluster,
with the 3.5 VSAM utility, the VSAM prefix is always constructed when an unqualified name is
specified.
UNCATALOGED DATASETS
If the dataset is not cataloged, you must specify a Volume serial number.
USING PATTERN CHARACTERS - CATALOG SEARCH
You can use pattern characters in the dataset field to dynamically invoke File-AID's catalog
search (3.4) to look for matching dataset names. Valid pattern characters are: ? and % (single
character) * (multiple characters in one node), + (0 or more nodes). Pattern characters are used
- 188 -
to represent any or all characters which are not part of the high-level node of a dataset name.
The high-level node must be fully specified. Following are some examples of using the
asterisk (*) to retrieve a list of datasets:
COMPARE DATASET ===> FILE.*
or
COMPARE DATASET ===> 'userid.FILE.*'
or
COMPARE DATASET ===> FILE.ABC*
USING PATTERN CHARACTERS - CATALOG SEARCH (cont.)
After specifying the pattern, press ENTER. The File-AID 3.4 Catalog Utility is invoked, and a
list of datasets corresponding to the pattern that you specified is displayed. Type S in the
COMMAND column to the left of the name of the dataset you want to select and press ENTER.
The selected dataset will be used and will replace the pattern you specified on the panel for the
function you are performing.
If you are not licensed for File-AID/SPF, you will receive an error if you use a pattern
character in the dataset field.
For further information on pattern characters, explore the tutorial for the 3.4 Catalog utility or
see the File-AID Online Reference Manual, CATALOG UTILITY.
PDS DATASET(MEMBER)
A member name enclosed in parentheses may follow the data set name (within the apostrophes,
if they are present) for partitioned data sets. For selection purposes, specifying a member name
for a partitioned dataset will cause the member to be processed as a sequential dataset.
In most instances a Member Name prompt is provided under the Dataset Name prompt. If a
member name is specified in parentheses along with the dataset name, the member information
is considered as if it had been entered in the Member Name field.
PDS MEMBER NAME MASKS
When referencing a PDS dataset, you may specify a Member Name of blank, or use a pattern to
generate a list of members for selection.
PDS MEMBER NAME MASKS (cont.)
- 189 -
You can use a question mark (?) or percent (%) to represent a single character of the member
name or an asterisk (*) to represent multiple
characters in a member name. However, you must enter at least the first character of the
member name before you can use the asterisk. (Exception: in 3.3 Copy or 3.6 Search Update, a
member name of asterisk (*) means to process all members and to bypass all PDS
Processing Options screens and member lists.)
Using blank or a member name pattern will either cause a File-AID member list to be displayed or
a PDS Processing Option screen to appear to provide additional member selection options.
Once a list of members is presented, you can select a member from this list by using the S line
command.
You can also enter the full member name, in parentheses, on the same line as the dataset name.
If you do so, you can ignore the Member Name field.
GENERATION DATASETS
Generation data sets may be referenced by using a signed or
unsigned number enclosed in parens.
Example: ===> 'GDS.TEST(0)'
This example references the most recently allocated data set in
the generation data group. Minus numbers reference previously
allocated data sets and positive numbers reference unallocated
data sets of the group.
CATALOG DATASET
On some panels a catalog dataset name may be entered. In this case whether the catalog
dataset name is enclosed in quotes or not, the name is always considered to be a fully qualified
name and no prefix is appended to it.
Catalog dataset name ===> 'CATALOG.DATASET'
Catalog dataset name ===> CATALOG.DATASET
In the above example, both entries are correct and treated equally.
- 190 -
FB
VB
SPANNED
n/a
n/a
DA (BDAM) X
The table below shows the combinations of dataset organizations and record formats allowed for
VSAM data files.
RECFM
DSORG
F
AM (VSAMn/a
KSDS,ESDS)
AM (VSAMX
RRDS)
AM (IAM)
X
AM (VSAMLDS)
FB
VB
SPANNED
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
n/a
1) VSAM-KSDS and ESDS files are treated as variable length files. Also, the concept of
blocking, as applied to PS, PO, and IS files, does not apply to VSAM.
2) File-AID does not support ISAM files with OPTCD=L in the DCB information when the key
starts in the first position (RKP=0 for fixed length files, RKP=4 for variable length files)
- 191 -
3) File-AID does not support fixed length unblocked ISAM files with a relative key position of 0
(RKP=0), or variable length unblocked ISAM files with a relative key position of 4
(RKP=4).
4) File-AID supports reading a VSAM-KSDS in an alternate key sequence via a VSAM PATH. A
PATH name may be specified for the input data file name in the browse, edit, copy, print, and
compare options.
5)
File-AID treats RECFM=FB BDAM files as RECFM=F (i.e., records are not de-blocked.)
Keyed BDAM files are processed by File-AID as if the key were concatenated in front of
each data block.
6) IAM files exist as fixed or variable length files. Due to a constraint in the information available
to File-AID from the IAM access method, all files are currently handled as variable length files. If
the length is changed on an IAM file which is truly fixed, File-AID will display an error message.
IAM files are processed as VSAM-KSDS files in all functions.
OS PASSWORD PROTECTED FILES
File-AID allows you to access data file datasets with OS password protection. Any dataset may
be protected to permit read-only or read/write access. More than one password may be assigned
to the same dataset. A dataset that is read/write protected, for example, might allow several
authorized users to read it, but only one user to write.
If you attempt to access a dataset protected by an OS password, File-AID will present the OSPassword-Protected screen containing a field where you can specify a dataset password as
follows:
Dataset password ===>
A nondisplay input field is used so that the password does not appear on the screen while you
are typing it.
Note that the File-AID 3.5 VSAM utility supports specification and modification of passwords for
VSAM clusters.
RECORD LAYOUT DATASET
This dataset contains the record layouts which are used in many File-AID functions. The record
layout dataset can be one of four types:
TYPE
DSORG
RECFM
LRECL
PO
F, FB, V, VB
80
PANVALET file
LIBRARIAN file
PS
F, FB, V, VB
80
Partitioned Dataset
Standard sequential
- 192 -
dataset
Must conform to the requirements for a valid CA-PANVALET/LIBRARIAN file. CA-PANVALET
and CA-LIBRARIAN are products of Computer Associates International, Inc.
A record layout may be a separate COPYLIB member or may be hard-coded within the source
statements of a program. If the layout is in a program or if a COPYLIB member contains multiple
record layouts, you can isolate the specific layout, or portion of a layout, that File-AID should use
by specifying a starting data-name.
If you do not specify a starting data-name, File-AID uses every layout found in the program, or
COPYLIB member, to format the data, treating the second through last layouts as additional
layouts that may be manually selected and overlaid at any offset via the USE command.
Note: File-AID Release 6 "MAP" libraries containing compiled record layouts are acceptable as a
record layout library.
LANGUAGE SUPPORT
File-AID supports source record layouts coded in COBOL or PL/I.
Layouts may be used when browsing, editing, printing, reformatting and comparing data
files.
Layouts can also be used to define selection criteria and to specify tests for multiple record type
layout usage.
File-AID automatically recognizes the source language whenever a layout is referenced.
File-AID supports Format 1 of the COBOL data definition statement and ignores Formats 2 and
3. When a 66 or 88 level item is encountered File-AID skips to the end of the sentence and
performs no syntax checking.
FORMAT 1
FORMAT 2
REDEFINES clause
BLANK WHEN ZERO
JUSTIFIED clause
FORMAT 3
- 193 -
OCCURS clause
PICTURE clause
SIGN clause
SYNCHRONIZED clause
USAGE clause
VALUE clause.
The following rules apply to Format 1:
1) The first data description entry in the COBOL layout need not have level number 01.
2) If multiple data description entries have level number 01, the second through "n" 01 level
entries are treated as though they redefine the first 01 level entry. Each 01 level entry need not
be successively longer than the previous 01 level entry.
3) The clauses may be written in any order.
4) The PICTURE clause must be specified for every elementary item with the exception of
INDEX, COMP-1, and COMP-2 data items.
5)
File-AID ignores the REDEFINES clause if it is on the first data description entry in the
COBOL layout.
The level number and data-name are required in the COBOL data description entry. The format
is:
- 194 -
- 195 -
JUST
The JUSTIFIED clause is used to override normal positioning of data within a receiving
alphanumeric data item. This clause affects processing in the reformatting function (option 9)
only.
Normally data is left justified in the receiving field and either truncation or blank padding occurs
on the right. When the JUSTIFIED clause is specified, data is right justified in the receiving field
and either truncation or blank padding occurs on the left.
The OCCURS clause has two basic formats:
FORMAT 1
OCCURS integer-2 TIMES (DEPENDING ON data-name-1)
(ASCENDING KEY IS data-name-2 (data-name-3)...)...
DESCENDING
(INDEXED BY index-name-1 (index-name-2)...)
FORMAT 2
OCCURS integer-1 TO integer-2 TIMES (DEPENDING ON data-name-1)
(ASCENDING KEY IS data-name-2 (data-name-3)...)...
DESCENDING
(INDEXED BY index-name-1 (index-name-2)...)
The words "TIMES", "KEY IS", and "BY" are optional in both formats.
In FORMAT 1, integer-2 represents the exact number of occurrences if the DEPENDING ON
option is not present, or the maximum number of occurrences if the DEPENDING ON option is
present. Integer-2 must be greater than 0 and less than 32,768.
In FORMAT 2, integer-1 represents the minimum number of occurrences and integer-2
represents the maximum number of occurrences. Integer-1 must be greater than or equal to 0,
and integer-2 must be greater than integer-1 and less than 32,768.
Three nested levels of OCCURS clauses are allowed. The OCCURS clause may not be
specified on 01 level items.
The ASCENDING KEY, DESCENDING KEY, and INDEXED BY options are checked for valid
syntax, but do not affect processing in any way.
- 196 -
- CR DB $ E
are all treated as the picture character X (XX for CR and DB). For alphanumeric edited and
numeric edited data items, File-AID does not validate the character string according to the
"precedence of symbols" as COBOL does.
External floating point items are fully syntax checked and treated as picture X items. Also, the
scaling position character, P, is supported
The format of the SIGN clause is:
SIGN (IS) LEADING (SEPARATE CHARACTER)
TRAILING
The word "CHARACTER" is optional in the SEPARATE option. File-AID treats the SIGN clause
exactly as COBOL treats it.
The format of the SYNCHRONIZED clause is:
SYNCHRONIZED (LEFT)
SYNC
(RIGHT)
The SYNCHRONIZED clause may be specified at the 01 or elementary item level. When
specified at the 01 level, every elementary item within the 01 level is synchronized.
- 197 -
File-AID treats all other aspects of the SYNCHRONIZED clause exactly as COBOL treats them,
including computation of slack bytes for groups, defined with the OCCURS clause, containing
synchronized items.
The format of the USAGE clause is:
DISPLAY
DISPLAY-1
COMPUTATIONAL
COMP
COMPUTATIONAL-1
USAGE (IS)
COMP-1
COMPUTATIONAL-2
COMP-2
COMPUTATIONAL-3
COMP-3
COMPUTATIONAL-4
COMP-4
INDEX
POINTER (VS COBOL II only)
PACKED-DECIMAL (VS COBOL II only)
BINARY (VS COBOL II only)
The USAGE clause can be specified at any level of data description. However, if the USAGE
clause is written at a group level, it applies to each elementary item in the group. The usage of
an elementary item may not contradict the usage of a group to which an elementary item belongs.
If the USAGE clause is not specified for an elementary item, or for any group to which the item
belongs, usage DISPLAY is assumed.
COMPUTATIONAL-4 and COMP-4 items are treated as COMPUTATIONAL items.
- 198 -
- 199 -
Compiler options:
Language
===> COBOL
Starting level numb ===> 01
Literal delineator ===> QUOTE
Use 48 character set ===> YES
-------------------------------------------------
COBOL compiler that either the quote (") or the apostrophe (') is the character used to delineate
literals.
-Use 48 character set indicates to the PL/I compiler that the source is written in the 48-character
set.
If File-AID cannot determine the language, or if compilation fails, it will display this panel to allow
you to change source or compile options.
XREF DATASET
This dataset contains XREF members created using option 7 of
File-AID. XREF members contain information relating record data to a
record layout. The XREF dataset must have the following attributes:
TYPE
Partitioned Dataset
DSORG
PO
RECFM
VB
LRECL
300
- 200 -
3) the record layout that defines the data file is stored in a COPYLIB member that contains
multiple record layouts
4) each record in the data file requires two or more record layouts, presented in sequence, to
define it
For the first situation, the XREF contains two pieces of information:
1) the name or the length and starting position of the field(s) within each data record that FileAID should use to identify the data record's type (referred to as the "record type field(s)")
2) a list of all the possible record type values and the corresponding layout library member
which defines the data records with those values
For the second and third situations, the XREF contains the data-name that starts the data
structure you want (referred to as the "starting data-name"). File-AID reads the layout from the
source library member (containing either multiple layouts or a program) starting with the dataname you specify. File-AID stops reading when it finds a new data structure (equal or lower level
number) or when the end of the record layout, library member, or program is reached.
For the fourth situation, the XREF contains the names of the layout library members for each
segment of a data record. It also contains the rules for identifying each segment of the record
by locating the "segment type field" and field values to use for selecting a segment layout (via
NEXT command of Formatted Browse/Edit).
In any of the File-AID primary options which use layouts to define the data, the record layout
dataset and XREF dataset information are specified as shown in the example below.
Specify Record layout and XREF Information:
Record layout usage
Record layout dataset
Member name
XREF dataset name
Member name
===>
===>
===>
===>
===>
X
(S = Single; X = XREF; N = None)
'PROD.COPYLIB'
(Blank or pattern for member list)
FASAMP.XREF
ORDRFILE (Blank or pattern for member list)
RECORD LAYOUT USAGE indicates whether you will use a single record layout (usage "S"), a
layout XREF (usage "X"), or no source layouts (usage "N") to define the file.
The table below shows the valid dataset and member entries for the record layout and layout
XREF datasets, for each layout usage.
LAYOUT
USAGE
S
RECORD LAYOUT
DATASET
sequential file, or member of
partitioned/PAN/LIB file
- 201 -
XREF
DATASET
ignored
sequential file, or
partitioned/PAN/LIB file;
(required) member must be
blank
ignored
X
N
DSORG
PO
RECFM
V, VB
LRECL
300
DSORG
PO
RECFM
V, VB
LRECL
1570
- 202 -
For example, the patterns: ?RO*, ?RO, P*, PR?G%, P?O?G, PROGRAM* all match and produce
the following list:
PROGRAM1
PROGRAM2
PROGRAM3
Use the S (Select) line command to select the member you want. You may also scroll through the
member list using the UP and DOWN commands. In addition, you can enter a LOCATE primary
command and scroll directly to (or near) a specified member name.
MULTIPLE PDS DATASET MEMBER LIST CONVENTIONS:
On certain dataset specification screens, you can specify multiple partitioned datasets.
Therefore, it is possible for you to receive multiple member list screens (one for each partitioned
dataset specified without a member or with a pattern) before proceeding to the next screen in the
function. The member lists are displayed in the sequence that the datasets appear on the
dataset specification screen.
PDS PROCESSING OPTIONS FOR PROCESSING PARTITIONED DATASETS:
If the main dataset in Browse (1), Edit (2), Copy (3.3), Search/Update (3.6), and Print data (5.1),
is a PDS and an explicit member is not specified, File-AID provides a PDS Processing Options
(PPO) screen. The PPO screen lets you specify additional member qualification filters such as:
member name range, last modified userid range, create date range, and modified date range.
If you wish to bypass the PPO screen and process all members, use a member name of * on the
main entry screen (Ex. Edit DSN=MY.PDS(*) ).
Note that when multiple PDSs are specified on the entry screen the list of members matching
your PPO options may not appear until AFTER all other PDS member lists have been presented
and a member selected.
ABNORMAL TERMINATION
File-AID can abnormally terminate in one of two situations:
1) when File-AID detects an unrecoverable error
2) when File-AID itself terminates abnormally
In both situations, File-AID intercepts the abend and displays an error screen. In the first case, a
message is displayed describing the unrecoverable error encountered. In the second case, the
system and user abend codes are displayed.
- 203 -
The first keyboard interaction on the error display screen causes the ISPF abnormal termination
screen to be displayed.
File-AID attempts to close all open files prior to returning control to ISPF.
DATASET SECURITY
File-AID is completely compatible with any data security software your installation may have (Ex.
RACF, CA-ACF2/TOP Secret, etc). File-AID processing does not circumvent your security
software in any way.
File-AID provides your installation with the capability of creating its own security exit routine that
File-AID will call during its processing. This enables your installation to limit access to certain
datasets. Following are some examples of the optional security exit routine uses:
-
To allow only authorized users to browse and/or edit selected data files
If you require information on your installation's security exit routine, contact the person
responsible for File-AID at your installation.
In addition to the security exit, an audit exit is provided that can be customized for various uses
including:
- To force the creation of an audit trail when option 2 of File-AID is used to edit selected data
files, and/or to force the printing of an audit trail report upon completion of the data file updates
- To log all or selected dataset updates to the SMF log.
AUDIT TRAIL FEATURE
When you use option 2 of File-AID to edit a data file, you may specify that File-AID capture all of
your update activity in an audit trail dataset. Every insert, repeat, delete, copy, typeover, and
CHANGE command you perform causes a before and/or after image of the record(s) affected to
be written to the audit trail dataset. When you complete your edit session, a screen is displayed
giving you the option to print, delete, or keep the audit trail. If you specify that the audit trail be
printed, a batch job is submitted which produces a formatted audit trail report.
File-AID also provides your installation with the ability to force the creation of an audit trail during
any user's edit session through an audit exit routine. This is especially useful, for example, if your
installation wants to ensure that an audit trail is created whenever File-AID is used to edit certain
sensitive data files. When the edit session is complete, the audit exit routine can also be used to
force the automatic submittal of a batch job to produce the audit trail report, thereby ensuring
that a record of the edit session is printed.
- 204 -
In addition to the audit trail facility, File-AID provides the option to log all dataset updates to the
system SMF datasets.
If you require information on how your installation may be using any of these audit trail facilities,
contact the person responsible for File-AID at your installation.
COMPRESSION/ENCRYPTION EXIT
File-AID provides your installation with the capability of creating its own compression/encryption
exit routine that will act as an interface between File-AID and any compression/encryption
software you may have (e.g., SHRINK or DATA PACKER). This allows you to work with data files
that are stored on disk or tape in a compressed or encrypted format in all File-AID options. FileAID invokes the compression/encryption exit for data files only, not for record layout datasets,
record/layout cross references, or selection criteria.
If you require information on your installation's compression/ encryption exit, contact the person
responsible for File-AID at your installation.
DOUBLE-BYTE CHARACTER SUPPORT
File-AID will automatically detect and present DBCS data characters if your terminal type is set to
3277KN or 3278KN from option 0.0.1 of File-AID, or option 0.1 of ISPF (ISPF terminal
characteristics).
There are two ways File-AID presents data.
The two ways are presented in sequence, or may be selected by number:
1 - Formatted data presentation (Formatted and Vertical modes)
2 - Full-screen data presentation (Character mode)
File-AID assumes that all character fields contain a mixture of EBCDIC data and Double-Byte
Character Set (DBCS) data. The DBCS characters are enclosed with shift-out (X'0E') and shift-in
(X'0F') characters.
For PIC G(nn) fields in COBOL or GRAPHIC(nn) fields in PL/I File-AID assumes that the field
contains only Double-Byte Character Set (DBCS) data. DBCS data does not include shift-out
(X'0E') and shift-in (X'0F') characters and should be an even number of bytes in length.
Note: X'0E' and X'0F' are for IBM sites. Other platforms such as FSP and Hitachi may use other
representations for shift-in and shift-out.
FULL-SCREEN DATA PRESENTATION
When data is presented without COBOL or PL/I record layouts (three-line hexadecimal or
character format), each character line displayed is considered a character field.
- 205 -
File-AID assumes that all character fields contain a mixture of EBCDIC data and Double-Byte
Character Set (DBCS) data. The DBCS characters are enclosed with shift-out (X'0E') and shiftin (X'0F') characters.
Use caution when entering DBCS characters to ensure that the shift-out and shift-in characters
are accounted for and will not overlay other data values unexpectectly.
The command HEX ON is useful to view the location of the shift bytes.
Double-byte character support
File-AID will automatically detect and present DBCS data characters if your terminal type is set to
3277KN or 3278KN from option 0.0.1 of File-AID, or option 0.1 of ISPF (ISPF terminal
characteristics).
There are two ways File-AID presents data.
The two ways are presented in sequence, or may be selected by number:
1 - Formatted data presentation (Formatted and Vertical modes)
2 - Full-screen data presentation (Character mode)
FORMATTED DATA PRESENTATION
File-AID assumes that all character fields contain a mixture of EBCDIC data and Double-Byte
Character Set (DBCS) data. The DBCS characters are enclosed with shift-out (X'0E') and shift-in
(X'0F') characters.
For PIC G(nn) fields in COBOL or GRAPHIC(nn) fields in PL/I File-AID assumes that the field
contains only Double-Byte Character Set (DBCS) data. DBCS data does not include shift-out
(X'0E') and shift-in (X'0F') characters and should be an even number of bytes in length.
Note: X'0E' and X'0F' are for IBM sites. Other platforms such as FSP and Hitachi may use other
representations for shift-in and shift-out.
FULL-SCREEN DATA PRESENTATION
When data is presented without COBOL or PL/I record layouts (three-line hexadecimal or
character format), each character line displayed is considered a character field.
File-AID assumes that all character fields contain a mixture of EBCDIC data and Double-Byte
Character Set (DBCS) data. The DBCS characters are enclosed with shift-out (X'0E') and shift-in
(X'0F') characters. Use caution when entering DBCS characters to ensure that the shift-out and
shift-in characters are accounted for and will not overlay other data values unexpectectly.
The command HEX ON is useful to view the location of the shift bytes
- 206 -
Endevor:ENDEVOR SOFTWARE
use Endevor for
Source control
To ensure that we always work with the latest version of the source
Endevor Search
To search for a string in a large list of sources
SCL generation
This is required at the time of migration
Endevor environments
FIX
Alternate/Fix environment
TEST
Test environment
RELEASE
- Release environment
DEMOTEST - Demo test environment
DEMOPROD - Demo production envmt.
Endevor Options
0
1
2
3
4
5
U
T
C
X
DEFAULTS
DISPLAY
FOREGROUND
BATCH
PACKAGE
BATCH PACKAGE
USER MENU
TUTORIAL
CHANGES
EXIT
FIXTEST
FIXSHIP
ACCEPTANCE
INTEGRATION
- 207 -
will give a source listing of the element as it currently exists in the region specified
can be used to get details of changes made to the current source with respect to the previous
version
Can be used to get details of all changes ever made to the source. For each line of the source
code, the appropriate version number is indicated at the extreme left
Can be used to get information about the current status of the source (i.e. whether it has been
retrieved, if so, by whom and on what CCID etc.)
- 208 -
Retrieval
1.
S - Summary B - Browse
M - Master
H - History
C - Changes
FROM ENDEVOR:
ACTION OPTIONS:
ENVIRONMENT ===> RELEASE
CCID
===>
SYSTEM
===> EAS
EXPAND INCLUDES ===> N (Y/N)
SUBSYSTEM ===> EAS
SIGNOUT ELEMENT ===> N (Y/N)
ELEMENT ===> IOINTEG1
OVERRIDE SIGNOUT ===> N (Y/N)
TYPE
===> COBOL
REPLACE MEMBER ===> N (Y/N)
STAGE
===> P
S - SHIP
P - PROD
COMMENT ===>
TO ISPF LIBRARY:
LIST OPTIONS:
PROJECT ===> EASV11
DISPLAY LIST
===> Y (Y/N)
LIBRARY ===> QFIX
WHERE CCID EQ ===>
TYPE ===> COBOL
WHERE PROC GRP EQ ===>
MEMBER ===>
BUILD USING MAP ===> N (Y/N)
FIRST FOUND
===> Y (Y/N)
TO OTHER PARTITIONED OR SEQUENTIAL DATA SET:
DATA SET NAME ===>
Endevor Search
Using Endevor Search
The search option can be used to search a large list of sources for the occurence of a given
string. Follow the steps as given below:
1.
2.
3.
4.
5.
6.
7.
8.
- 209 -
9.
APPEND
===> N (Y/N)
INCLUDE JCL ===> N (Y/N)
S - Summary B - Browse
M - Master
H - History
C - Changes
FROM ENDEVOR:
LIST OPTIONS:
ENVIRONMENT ===> RELEASE
DISPLAY LIST
===> N (Y/N)
SYSTEM
===> EAS
WHERE CCID EQ ===>
SUBSYSTEM ===> EAS
WHERE PROC GRP EQ ===>
ELEMENT ===> IO*
BUILD USING MAP ===> N (Y/N)
TYPE
===> COBOL
- 210 -
STAGE
===> P
S - SHIP
P - PROD
TEXT STRING:
===> 'CONSOLLT'
SCAN COLUMNS:
START ===> END ===>
SHOW TEXT ===> Y (Y/N)
ACTION TO BE GENERATED WHEN LIST IS CREATED ===>
WRITE LIST TO OUTPUT DATA SET ===> N (Y/N)
WHERE COMPONENT EQ ===>
SCL Generation
SCLs are generally used to migrate sources from the Development region to TEST. The steps
involved in the preparation of an SCL are listed as the following
How to generate an SCL
1.
2.
3.
4.
5.
6.
7.
APPEND
===> N (Y/N)
- 211 -
A - Add an element
TO ENDEVOR:
U - Update an element
ACTION OPTIONS:
CCID
===> EASY2KUU4
SYSTEM
===> EAS0
GENERATE ELEMENT ===> Y (Y/N)
SUBSYSTEM ===> EAS
DELETE INPUT SOURCE ===> N (Y/N)
ELEMENT ===> DC1005
NEW VERSION
===>
TYPE
===> COBOL
OVERRIDE SIGNOUT ===> Y (Y/N)
STAGE:
I
PROCESSOR GROUP
===> CIINCL
UPDATE IF PRESENT ===> N (Y/N)
COMMENT ===>
FROM ISPF LIBRARY:
PROJECT ===> EASV11
LIBRARY ===> LR11
TYPE ===> COBOL
MEMBER ===> DC1005
LIST OPTIONS:
DISPLAY LIST
===> Y (Y/N)
- 212 -
Sorce Type
Processor Group
Batch COBOL Program
CIINBL
CICS COBOL Program
CIINCL
Copy Book
CPYNNN
Control card
SRCNNS
Bind card
BNDSUBX
Batch to Module (TDM)
CIITBL
CICS to Module (TDM)
CIITCL
Batch to Module (without TDM) CIIDBL
CICS to Module (without TDM) CIIDCL
NOTES
After building the SCL, it is advisable to manually browse it. For this, use the EDIT option shown
in the first screen.
Check for :
1.
- 213 -
- 214 -
Fixed Income
A type of security that pays a fixed rate of return. Examples of this include government, corporate,
or municipal bonds, which pay a fixed rate of interest until the bonds matures, or preferred stocks,
which pay a fixed dividend.
Investment Trusts
A type of investment company that pools money from it shareholders. Investment trust is also
known as a closed-end investment company, meaning only a fixed number of outstanding shares
is offered
Mutual Fund
A type of investment company that pools money from its shareholders. A mutual fund is also
known as an open-end investment company, meaning that there is a continuous offering of new
shares and redemption of outstanding shares
Value Chain
A value chain breaks down an industry to its value activities to understand the behavior of costs,
and the existing and potential sources of differentiation. It is used to compare and contrast
competitors in an industry.
Commercial Banking
The commercial bank meets the financing and cash management needs of business customers.
Customers range from small businesses to multi-national corporations in industries such as
manufacturing, wholesaling, retailing, service or agricultural entities. The commercial bank
provides credit and non-credit products and services to customers.
Accounts Receivable Financing/Collection
The process of obtaining funds for cash needs by selling or borrowing against accounts
receivable. Cash Management Services Non-credit products and services that help meet
business customers' information, transaction, and investment needs. Cash management services
are also called non-credit or treasury management services, and help businesses optimize their
use of cash through quicker collection and slower disbursement of business funds.
Cash Management Services
Non-credit products and services that help meet business customers' information, transaction,
and investment needs. Cash management services are also called non-credit or treasury
management services, and help businesses optimize their use of cash through quicker collection
and slower disbursement of business funds.
- 215 -
Commitment Fees
Fees paid by a customer in return for the bank's legal commitment to lend funds that have not yet
been borrowed by the customer. The customer pays a fee to ensure that additional funds will be
available to them if needed.
Credit Scoring
A standardized credit rating system, which analyzes applicant criteria such as income, personal
characteristics and other outstanding debt. The system produces a credit score intended to be
indicative of a borrower's ability to repay a loan.
Lease
A contract granting the use of real estate, equipment, or other assets over a fixed period of time
in exchange for payment. The borrower pays for the privilege of using the asset, and the
ownership of the asset is usually transferred to the borrower at lease end.
Letter of Credit
A bank guarantee of payment for a buyer or seller of goods. Payment for goods is guaranteed
and will be made when the terms of a contract have been met. Payment is also guaranteed if the
applicant for the letter of credit fails to uphold the terms of the contract.
Loan Syndication Fees
Fees paid by a customer to a group of banks (called a syndicate) that acts jointly to loan money
to the customer. A syndicate may result from a loan amount that is too large or too risky for one
bank to make by itself.
Margin
The amount of funds that must be deposited when purchasing securities. Also, the equity in an
investor's account.
Matched Funding
A process of matching maturing liabilities (customer deposits) with maturing assets (loans or
investments) to manage the costs associated with fluctuating interest rates. As an example, a
bank would try to fund a 3-year loan with a 3-year deposit to lock in the interest rate it will earn for
the three-year period.
Relationship Manager
Relationship managers typically serve as the primary contact between the bank and customers.
Relationship managers may also coordinate services from other areas of the bank for crossselling opportunities.
- 216 -
- 217 -
Bad Debt
Open account balance or loan receivable that is proven uncollectable and written off.
Charge Card
A short-term funding mechanism. Charges must be paid in full at the end of the monthly cycle. An
example is a corporate charge card.
Collateral
An asset pledged to a lender until a loan is repaid. If the borrower fails to make payments as
required, the lender has the legal right to seize the collateral and sell it to pay off the loan.
Credit Scoring
A standardized credit rating system, which analyzes applicant criteria such as income, personal
characteristics and other outstanding debt. The system produces a credit score intended to be
indicative of a borrower's ability to repay a loan.
Fixed-Rate Mortgage
A property loan in which the payback rate does not vary with market conditions; it is constant over
the life of the loan.
Home Equity Loan
A loan, which is secured by an independent appraisal of the property value of the customer's
home. Essentially, the customer is borrowing against the equity value of their home that is not
mortgaged.
Installment Loan
A consumer loan that has a predetermined loan maturity date (the date the loan is to be paid in
full) and repayment schedule.
Loan-to-Deposit Ratio
Percentage representing a bank's total amount of outstanding loans to the amount of deposits.
- 218 -
Overdraft Credit
A line of credit attached to a checking account. When a customer withdrawals more money than
in his account, the extra amount is covered by the overdraft credit. The customer pays interest on
the overdraft amount.
Revolving Credit
Loan amount requiring monthly payments of less than the full amount due, with the balance
carried forward subject to additional interest.
Branch/ATM
For some banks, branches are the primary distribution channel for selling products and services.
Although differences exist among banks and across regions, most branches offer a range of
products and services, including deposit accounts, transactional services, lending services,
investment services, and insurance.
Commission
Fee paid to sales personnel for executing a trade based on the number of shares traded or the
dollar amount of the trade.
Compensating Balance
Minimum balance required by a bank on certain deposit accounts. Banks require customers to
keep these balances as a stable source of funds for the bank, and impose financial penalties if
the account goes below the minimum requirement.
Computer Switch
ATM back-end equipment that allows network banks to share customer account information.
These switches allow customers to use any participating ATM, and allow the network banks to
verify funds for non-customers.
Deposit Accounts
These accounts allow customers to deposit funds that the bank must repay the customer at some
future date.
Two major types:
1.
Funds committed to the bank for a specified period of time. In return, the bank offers a
higher interest rate relative to other types of deposits. A certificate of deposit is one
common form.
2. Funds committed to the bank, which the customer has the option to withdraw at any time.
A savings account is the most common form.
- 219 -
Insurance
Most countries have an independent insurance industry. In many countries, however, the
insurance and banking industries are merging, resulting in the selling of insurance products in
banks. Some of these products include life insurance, property insurance, and casualty
insurance.
Investment Services
Banks offer services to help customers invest their excess funds. Some of these services include
brokerage services, mutual funds, annuities, personal trust, and asset management.
Lending Services
Banks provide funds to customer while charging customers interest for the use of those funds.
Some examples include mortgages, home equity loans, overdrafts, and credit cards.
Premium
Fee paid to a bank or insurance provider for insurance coverage.
Transaction Services
These accounts allow customers to deposit funds with the intention of making non-cash
payments in the near future, usually with instruments such as a check or debit card.
Two major types:
1.
Funds may be withdrawn on demand without advance notice. A checking account is the
most common form.
2. Some accounts may carry a market interest rate and allow the depositor limited checkwriting privileges. A money market deposit account is one common form.
Transfer Pricing
The internal charge to a business unit for goods or services provided by another business unit.
An example of transfer pricing would be the deposits line of business charging a lending division
for using customer deposits as the source for loans.
Electronic Banking
Electronic banking is one type of distribution channel used to deliver products and services to
customers. It brings the bank to the customer-a strategy for penetrating different customer
segments, encouraging customer loyalty, and reducing costs. Within electronic banking, several
different types of delivery mechanisms exist, such as VRU, digital TV, mobile phone, kiosk, PC,
and the Internet.
- 220 -
Digital TV (DTV)
To leverage the technology of interactive TV, some banks use the platform of the digital TV
operators, including satellite and cable, to offer home banking services. DTV combines video,
images, sound and textual information. The navigation requires the use of only five keys on the
standard pay-TV remote control. Customers can browse through account information directly on
the TV and perform transactions, such as transfers, blank check orders, or financial product
subscriptions.
Electronic Bill Presentment and Payment
EBPP provides customers or businesses with the ability to make "electronic" payments to any
vendor or any person at any time. Instead of receiving a paper bill monthly, customers receive an
electronic version of the bill. Customers can review bills and pay them online electronically,
eliminating the hassle of check writing and the possibility of lost payments or late charges.
Financial Institutions
Financial Institutions include banks, insurance companies and brokerage houses.
Internet Banking
Internet banking offers the ability for customers to conduct basic bank transactions (for instance,
balance transfers and account inquiries) through direct dial-up connections to the bank. Unlike
PC banking where access is limited to a PC equipped with the bank's software, Internet banking
allows customer access to information and services from any location with an Internet connection.
The goal for a bank's Web site is to provide many, if not all, of the services offered at a branchtransactions, account information, advice, administration, and even cross-selling. The interactive
nature of the Web not only allows banks to enhance these core services, but also enables banks
to communicate more effectively and strengthen customer relationships.
Kiosk
The kiosk multimedia application is based on a virtual branch metaphor. Existing or potential
customers can "enter" the branch by touching the doors on the kiosk's touch screen. Inside the
virtual bank branch the customer can obtain information and go through the sales process of
products. The customer will be guided by a virtual host and sales personnel through integrated
video sales person and promotion video clips. The application offers a full range of retail banking
products and services. In cases where real signature is required by law, the customer can print
out the application for signature and submission.
Mobile Phone
Banking using the mobile phone is similar to using a touch-tone phone. Customers can access
basic transactions such as check balances, loan rates, checks paid, deposit rates, and credit card
payments. Many providers also offer Internet banking over Internet enabled mobile phones.
- 221 -
Origination
Origination refers to the customer acquisition process.
PC Banking
Customers can access accounts by installing the bank's application on the PC. This allows
customers to access account information, pay bills, transfer funds, or to purchase investments
while online. Some major providers of personal management (PFM) software are partnering with
banks to offer additional services. This software may offer additional features such as creating
account registers and checkbooks, balancing accounts, setting up loan amortization schedules,
creating budgets, tracking investment performance, and estimating taxes.
PDA
Banking using a wireless PDA (personal digital assistant) offers all the capabilities of banking on
the Internet (e.g., check balancing, transferring balances, paying bills, etc.), but has a scaled
down user interface. It is very similar to doing Internet banking over a mobile phone.
Voice Response Unit (VRU)
An automated system accessed by telephone for providing basic customer service information,
such as account balances or transaction history. Call centers provide VRU's as a way to reduce
cost, since nearly 80% of customer inquiries can be handled through a VRU, and do not require
the more costly CSR interaction.
White Label Solutions
A white label solution is a solution provided by a bank that can be branded and used by the end
customer like Accenture. Accenture employees could use the 'Accenture Bank', even though all
of the processing takes place at large bank, the web interface to the banking functions would be
branded as Accenture.
Call Center
Call centers are lower cost delivery channels than branches to maintain high quality customer
service. Call centers allow other delivery channels, such as branches, to focus on marketing and
selling instead of service. Major functions supported by the call center include credit card services
(such as transaction and balance inquiries), retail and commercial account information (such as
transfers or payments), basic customer service (such as change of address) and website support.
- 222 -
Inbound
Telephone calls made from either a customer or an employee to the call center.
Outbound
Telephone calls made from the call center to a customer or potential customer.
Voice Response Unit (VRU)
An automated system accessed by telephone for providing basic customer service information,
such as account balances or transaction history. Call centers provide Vero's as a way to reduce
cost, since nearly 80% of customer inquiries can be handled through a VRU, and do not require
the more costly CSR interaction.
Distribution Channels
Banks use a variety of channels to manage products and services. Banks must define policies for
new and existing channels, determine the distribution strategies, support each channel's
operations, and manage the branch network across regions.
While the branch is the most visible distribution channel, alternative channels, such as Internet
banking and ATM's have grown substantially in the past decade. New channels have emerged
due to increasing customer sophistication in technology and product knowledge, competition for
new customers, the need to lower operating costs, to increase time in the branch for commercial
activities and evolving technology.
Multi-Channel Strategy
Retail banks use a multi-channel approach to serve a wide range of customers. Channels include
electronic banking, branch, ATM and call centers. This diversification increases bank revenues
while lowering bank costs.
Strategy & Marketing
The purpose of strategy is to define the bank's sales objectives and target markets, and to
determine product needs and enhancements. Marketing implements promotional strategies that
support these initiatives and builds brand identity for the bank.
Private Labeling
A bank's purchase of a product from a third party for use and sale under the banks own name.
Other banks can purchase the same product and private label it for their own uses. Although
- 223 -
private labeling reduces product development costs, banks usually choose to develop products
internally, rather than through private labeling, since new products often differentiate banks from
their competition.
Product Bundling
Bundling offers a complementary group of products or services to a customer. Products and
services may be bundled as a way to increase sales of a particular product (such as, bundling a
poorly selling savings account with a popular checking account), or to target specific market
segments (such as a group of products targeted at young professionals).
Risk Management
Risk management is the framework and related infrastructure by which banks plan for, acquire,
and monitor risk to achieve superior performance. Risk management integrates human
resources, technology, capital, and target marketing to balance risk against reward. Categories of
risk include economic, credit, liquidity, and operational risk.
Asset-Liability Management
Matching the maturity of deposits with the length of loan commitments to avoid adverse affects
from changes in interest rates.
Business Risk
Banks analyze a business customer's ability to repay a loan. Loan review and approval by more
than one individual helps offset business risks.
Credit Risk
The uncertainty of realizing the return of principle and the expected reward from a customer or
portfolio of customers.
Credit Risk
The uncertainty of realizing the return of principle and the expected reward from a customer or
portfolio of customers.
Economic (Market) Risk
Uncertainty associated with currency, local, regional, global, business and political conditions.
Examples include exposure or concentrations by industry, loan structure, product, interest rate, or
sovereignty.
- 224 -
Individual Risk
Banks have replaced the manual review process for individual and small business loans with new
analytical tools. Credit scoring and behavioral modeling are used to standardize the evaluation of
loan applications and to project future risks.
Industry Risk
Loans are classified by industry, and limits are established on loan amounts outstanding by
industry to offset industry risks.
Liquidity Risk
The ability to convert assets into cash or cash equivalents without experiencing significant loss.
Loan Loss Analysis
Analysis of non-performing and problem loans, including probability of default, loss rates by risk
rating, recovery rates, and time from origination of the loan to non-performing status.
Non-performing Loans
Loans for which customers are not making scheduled payments. Commercial loans that are 90
days past due and consumer loans that are 180 days past due are usually classified as nonperforming.
Operational Risk
Risk of loss associated with the failure to execute transactions due to:
1.
2.
3.
4.
5.
6.
7.
8.
Inadequate controls
Operating errors
Inaccurate information
Ineffective management
Natural disaster
Fraud
Regulatory issues
Legal considerations
- 225 -
Risk Appetite
Industry term used to describe the general level of risk acceptable to a bank. A "small risk
appetite" would mean that a bank would have little interest in a risky transaction.
Risk Rating
A rating system based on a scale of loan performance and loss experience. Limits are
established for each rating level for individual, business, industry and country risks. Stress
Testing and "What If" Scenarios Simulation of the impacts of trends and events (such as, interest
rate changes, regulatory changes, economic growth, currency fluctuations) on a loan portfolio.
Finance and Corporate Planning
Finance and Corporate Planning provides external customers with financial and credit quality
information. External customers include regulators, shareholders, and market analysts who
monitor financial performance and stability. Finance and Corporate Planning also provides
internal customers with financial management reporting. Internal customers include the CEO, the
Board of Directors, and line of business leads.
Activity-based Costing
A method of determining the total cost of providing a service to customers. These costs are
aligned to associated revenues by product, customer, and channel. Finance and corporate
planning uses activity-based costing information to help determine product prices and set interest
rates on savings products.
Capital Adequacy
A measure of an institution's capital (equity) in relation to its asset base. A higher capital
adequacy means a stronger ability to absorb losses. A bank's capital usually ranges from 2-12%
and varies based on factors, such as size and regulatory requirements.
Credit Quality
A measure of the quality of an individual loan or a loan portfolio. Good credit quality means that
the customer continues to make full loan payments on time and is not at risk for defaulting on the
loan.
Efficiency Ratio
A measure of how well a bank is managing its non-interest expenses. The lower the efficiency
ratio, the better the bank is performing. This ratio is measured by dividing non-interest expense
by the sum of the net interest income and the non-interest income. For banks, typical efficiency
ratios are .55 or lower.
- 226 -
- 227 -
Issuing Bank
The financial institution that issues the payor's check.
Magnetic Ink Character Recognition (MICR) Encoding
Magnetic Ink Character Recognition Encoding allows high-speed, check-sorting machines to read
and sort checks. Data is encoded onto the checks in this process.
Off-line Processing
ATM or debit card reader does not have a direct link to the customer's account file. Instead, the
purchase information is captured for later processing, and does not immediately post to the
account. Few off-line systems are used today.
Online Processing
ATM card or debit card readers are linked directly to the customer's files, which contain their
individual account information. At the point of sale, these transactions link directly to the bank to
determine whether the customer has funds to cover the purchase or a cash advance.
Point of Sale (POS)
Retail payment system that substitutes an electronic transfer of funds for cash, checks, or drafts
in the purchase of retail goods and services.
Society for Worldwide Interbank Financial Communication (S.W.I.F.T.)
A predominant European payment processing system, which provides the link between, the
issuing bank and the acquiring bank on an international level. The standardization of the Euro
may change the payment processes between participating countries.
Smart Cards
Credit cards with microcomputer chips. Smart cards are a recent trend that will have a substantial
impact on future banking. These cards offer a secure, personalized connection to Internet
shopping and banking and are being considered for multiple purposes across different industries.
Private Banking
The traditional private banks target high net worth (HNW) individuals and provide customized,
personal services for these clients. Although the minimum requirement varies among banks, they
typically define this specific customer segment as individuals with assets under management of
USD one million or more. Products offered include credit and deposit products, investment
products, estate and financial planning services, and trust products.
- 228 -
Advisory Management
Accounts that require clients' authorization before executing investment decisions.
Discretionary Management
Accounts that give the relationship manager full authority to make investment decisions.
Fully-Dependent Investment Style
Clients who are unable to manage their own investment decisions, for different reasons, rely on
professionals who know them well and are willing to pay for the convenience of doing so.
High Net Worth Clients (HNW)
Individual clients whose total assets under management are USD one million or more. Offshore
Private Banking Private banks that focus on wealth held abroad by residents globally; these
traditionally have been focused on avoiding taxes or foreign exchange restrictions.
Onshore Private Banking
Private banks that focus on services for individuals banking in their own country.
Opinion-Seekers Investment Style
Clients who are able to manage their own money but like to receive advice at times. Although
they are fairly price-conscious, they will pay extra for the things that they value. Opinion seekers
may shop around multiple providers for the best information.
Self-Directed Investment Style
Clients who consider themselves financially savvy, who are price-conscious and who do much of
their own investment decision-making and money management.
Bank Performance
Bank performance is important to internal and external stakeholders. A bank's performance is
often compared to other banks of similar size and product offerings.
Annual Revenue Growth
The increase in revenues from one year to the next, calculated by subtracting the previous year's
revenues from the current year's revenues, and dividing by the previous year's revenues. Banks
target revenue growth of 5-10% per year.
- 229 -
- 230 -
they will be unable to collect the loan amounts due from customers. When the loan is "officially"
not repaid, the loan amount is "written off". If the original provision was insufficient to cover the
loss, an additional charge against income will be taken. If the original provision was greater than
the write-off, the bank will either credit income or apply the provision against another loan.
Return on Equity (ROE)
Return on Equity is defined as net income divided by total equity. This ratio identifies how well a
company's equity is working to produce income. Banks try to average a minimum ROE of at least
15%.
Unemployment rate
Percentage of a country's workforce actively looking for work, but unable to find jobs. This metric
is one of the most closely watched government rates, because it has long been thought to often
give the clearest indication of the economy's direction. A rising unemployment rate is seen as a
sign of a weakening economy, which may call for an ease of government monetary policy. A drop
in the employment rate, on the other hand, shows that the economy is growing, which may spark
fears of high inflation, in which the government may increase interest rates. While this has proven
true quite often over the years, this theory did not hold true in the 1990's when the economy grew
rapidly, yet both the unemployment rate and inflation remained below 6% for many years. Thus,
rapid growth and the low unemployment rate did not spark fears of high inflation and increases in
interest rates during much of the 1990's.
Weighted Risk Assets
To calculate the level of regulatory capital required, a bank's loans are first converted into
weighted risk assets (WRA's). Amounts by loan category (such as mortgages, credit card loans,
or loans to other banks) are multiplied by a weighting percentage that reflects the different levels
of risk for each lending type. As an example, credit card lending is assigned a weighting of 100%,
while loans to other banks are weighted at 20%, to reflect the higher risk of credit card lending
relative to lending to a bank. The bank must retain a certain percentage of its capital based on the
weighted amounts outstanding.
Write-off
Charging an asset amount, such as uncollected debt, to expense or loss. Bank management will
make a "provision" for losses when they believe they will be unable to collect the loan amounts
due from customers. When the loan is "officially" not repaid, the loan amount is it "written off". If
the original provision was insufficient to cover the loss, an additional charge against income will
be taken. If the original provision was greater than the write-off, the bank will either credit income
or apply the provision against another loan
- 231 -
TELECOMMUNICATION
Telecommunication refers to long distance communication. The Greek word "tele" means "far
off". At present, such communication is carried out with the aid of electronic equipment such as
the radio, telegraph, telephone, and television. However, in earlier times, smoke signals, drums,
light beacons, and various forms of semaphores were used for the same purpose. The
information transmitted can be in the form of voice, symbols, pictures, data, or a combination of
these. The physical equipment for a telecommunications system includes a transmitter; one or
more receivers; and a channel or means of communication such as air, wire, cable,
communications satellite, or some combination of these.
Components in a telephonic conversation
The telephone is one of the most amazing devices ever created. If you want to talk to someone,
all that you have to do is pick up the phone and dial a few digits. You are instantly connected to
the person with whom you would like to talk, and you can have a two-way conversation. The
telephone network extends worldwide, so you can reach almost anyone on our planet.
The actual process of making a call involves several functions that are activated with the help of
hardware and software components in the telecom network. The network comprises of telephone
sets, transmission media such as cables, and switching systems.
Making a call
The telephone cannot by itself set up a call between two subscribers. Most of the functions occur
in cooperation with the telephone switching equipment (exchange).
When an individual lifts the cradle, a signal is sent to the exchange indicating that the user wants
to make a call. This signal is known as the hook off signal. The signaling process between the
exchange and the telephone set commences in this manner. The exchange checks for certain
parameters to authenticate the subscriber, and sends the dial tone to the user's telephone.
When the user dials a number, the exchange gets the destination address of the called
subscriber. The numbering system within the exchange routes the call to the called subscriber.
The exchange then determines the status, whether available or busy, of the called subscriber.
Based on the status, the exchange sends either a ring back tone or a busy tone to the calling
subscriber and the ring tone to the called subscriber. If the calling subscriber is available, a voice
path is created and the two parties can now communicate with each
Analog and Digital Signals
Speech signals may be transmitted through the medium either as analog or digital signals.
An analog signal is a continuously varying smooth electromagnetic wave that can be propagated
over a variety of media, including multi-wire cables, coaxial cables, and fiber optic cables. When a
person speaks into the transmitter on a telephone, voice signals made up of sound energy are
- 232 -
converted into electrical energy for transmission along a transmission medium. The conversion
from voice to analog signal is accomplished inside your telephone.
Digital signal A digital signal is a sequence of discrete voltage pulses that are transmitted over a
wire medium. The state of the digital signal is characterized by abrupt changes. For digital
signaling, voice or data is converted to a stream of binary information (0s and 1s) for
transmission. Instead of the voice signal being processed as an analog signal, it is converted into
a digital signal and handled with digital circuits throughout the transmission process. When it
arrives at the exchange that serves the called telephone, it is converted back to analog to
reproduce the original voice transmission.
Introduction - Switching Systems
It is practically impossible to connect all telephones to each other using cables. This led to the
introduction of switching systems, commonly known as exchanges.
With the introduction of switching systems, the subscribers are not directly connected to each
other. Instead, all subscribers are connected to some switching system. Therefore, only one link
is established between the subscriber and the switching system. When a subscriber wants to call
another subscriber, a connection is established between the two at the exchange. This helps in
administration, maintenance, and overall control of the telecommunication network.
Types of switching systems
The initial switching systems were manual. Many operators were involved with switching calls
manually between various subscribers. As the number of subscribers increased, the need for
automatic exchanges was felt. With the advent of computers, the exchanges were made
completely digital.
Types of switching systems
Manual
Automatic
o Electromechanical
o Electronic (Stored Program Control)
- 233 -
and one vertical bar. At every cross point, each bar had a hole. To connect line 3 to line 14, the
operator would push a metal peg into the hole where bar 3 crossed bar 14. That allowed the
current to flow between the two lines and the conversation could begin.
Disadvantages of the manual exchange
The manual exchange was unable to handle the increasing number of calls as
subscribers grew in number.
The manual exchange was unable to provide privacy as far as the subscriber was
concerned.
It was costly to handle long distance calls manually. Hence, further inventions resulted in
the automatic exchange.
Automatic Exchanges
Due to the disadvantages of manual exchanges, automatic exchanges were invented. Automatic
exchanges can be classified as Electromechanical and Electronic.
The electromechanical exchanges transmitted sound in the form of analog signals. Further, the
electromechanical switching systems can be classified into
Electronic Exchanges
The crossbar systems were found to be slow in call processing. It was realized that components
of switching systems could be replaced by a single digital computer. In electronic switching
systems, a computer performs the control functions. Hence, these systems are called Stored
Program Control (SPC) Systems.
Stored Program Control Stored-program control is a broad term designating switches where
common control is carried out to a greater extent or entirely by computer hardware. Control
functions can be carried out entirely by a central computer, or partially or fully by distributed
processing.
There are four basic functional elements in the SPC switching system.
- 234 -
Program store: The Program store contains the software needed for the operation of the
switching system.
Central processor: The Central processor is the nerve center of the switch. It controls
the operation of various entities such as the dial tone detector, the ring generator, and the
switching matrix.
Digital Technology
The idea of digital technology is to convert analog signals to digital 1's and 0's. Sound is a set of
analog events, which can be represented in a curve. A continuous analog wave can be converted
to an equivalent digital mode. This process of modulation is called Pulse Code Modulation (PCM).
The PCM Process is illustrated in the figure below.
A single conversation does not utilize bandwidth to the maximum extent. To utilize the bandwidth
to the full extent, you can combine many such conversations to transmit through a same line by
the process of Multiplexing.
The conversion of an analog voice signal for digital transmission involves three steps.
Sampling: Sampling is the process of taking readings (or 'samples') on the speech
curve. It is important to establish a set of discrete times at which the input waveform is
sampled. The Nyquist Criterion (Nyquist theorem) specifies how frequently readings need
to be taken. Thus, a suitable sampling frequency is determined. The result is a Pulse
Amplitude Modulated (PAM) signal, where each pulse corresponds directly to the
amplitude on the speech curve.
Quantization: Quantization assigns a binary value to each voltage sample. A PAM
waveform could have an infinite number of distinct voltage values between the maximum
and minimum values of the voltages. To assign a different binary sequence to each
voltage value, a code of infinite length would be required. To avoid this, we go in for
quantization. The number of bits used for transmission depends upon the number of
quantum values. For example, eight bits are sufficient to form a unique code for each
quantum value when the number of quantum values is 256 (2^8 = 256). Of these, the first
bit is used to denote the polarity of the sampled signal. The equipment needs only to
differentiate between these digits, which are sent in the form of pulses.
During quantization, the Quantizer
o Limits the input signal amplitude between upper and lower voltage values - the
dynamic input range of the ADC.
o Sets a given number of discrete values between the maximum and minimum
voltage limits.
o Compares each sample with a set of quantum values in turn and assigns it to the
one it approximates.
Thus by definition, all samples in an interval between two quantum levels are deemed to
have the same value.
- 235 -
The output of the ADC is in serial digital format, which is a unipolar Binary sequence of
0's and 1's. This sequence cannot be directly fed to any media such as PCM, Optical
Fiber Cables (OFC), or Microwave (MW). Therefore it is given to the Line Coder, which
encodes it in one of the following formats: AMI, HDB3, CMI, RZ, or NRZ.
Coding: PCM is not specially designed to digitize speech waveforms. Speech waveforms
have a lot of redundancy that can be used to design coding schemes. Speech signals
typically have non-uniform amplitude distributions, sample-to-sample correlation,
periodicity or cycle-to-cycle correlation, and speech pauses or inactivity factors. PCM
outputs very high bit rates, which consume a lot of bandwidth. To overcome this problem,
new voice coders such as ADPCM and LPC were developed. They give much lower bit
rates and are therefore bandwidth efficient.
- 236 -
Numbering Plan
With the increase in number of subscribers, it became necessary to identify each subscriber to
set up the call faster. The numbering plan provides every subscriber and every service including
call forwarding, call waiting and call queuing, in the telephone network with a unique and simple
code, which allows automatic call set up in the network.
It is necessary that each subscriber be able to call any other subscriber. This requires each
subscriber to have a unique code. Also, for the convenience of the subscriber and the telephone
exchange, a simple code is needed.
The need for a well-structured numbering plan is necessary to:
Country code: The Country code is the combination of one, two, or three digits
characterizing the called country. The first digit in the country code is the zone code of
the zone in which the country lies. For example, in zone 9, India has the country code '91'
and Maldives '960'. The zone code 9 is the first digit in the country codes of both India
and the Maldives.
National Number: The number of digits in an international subscriber number is limited
to a maximum of 12. However, in practice, world numbers are limited to 11 digits.
Therefore, the number of digits in the National Number is limited to 11 - n where n is the
number of digits in the Country Code. Therefore, the national number can contain 9-11
digits.
- 237 -
Area/Trunk code: The Area or Trunk code is the digit or combination of digits that
identifies a particular numbering area of the called subscriber in a country. This code
determines the routing for a trunk call and the charge for it. <LI</LI>Exchange Code:
The exchange code identifies a particular exchange within a numbering area.
Subscriber Line Number: The subscriber line number is used to select the called
subscriber line at the terminating exchange. In CCITT terminology, the
combination of the exchange code and the subscriber line number is known as the
subscriber number. This is the number listed in the telephone directory.
Fixed routing: The call is routed based on a pre-defined route. There is no change
in the route regardless of the time of the call, availability of the route, or call
statistics.
Dynamic routing: It is necessary to find optimal routing paths for the transport of
information.
In dynamic routing, the routing pattern varies based on factors such as:
Time: Calls are routed depending on the time of the day. For example, normally
you may be using route b to route calls. However, between 8 to 10 a.m, you may
decide to route 50% of the calls made via route a and 50% via route b. These
routing patterns are pre-planned and are implemented at a fixed time of the day.
State: Routing patterns can be varied based on network information collected by
toll exchanges. For example, if a certain route or part of it is found busy, the toll
exchange can route your call via another route.
Event: Certain events such as natural calamities or special occasions such as
Mothers Day can affect the call statistics. Routing patterns are updated locally
- 238 -
based on call statistics. Once you dial a number, all exchanges involved in routing
the call have to communicate amongst themselves. This is done through the
process of signaling.
Introduction - Signaling
In telephony, signaling refers to the passing of information and instructions from one
point to another, relevant to the setting up of a telephone call.
To initiate a call, the caller lifts the handset off the hook. This off-hook state is a signal to
the exchange to be ready to receive the number of the called subscriber. As soon as
appropriate receiving equipment is connected to the line, the exchange signals the dial
tone to the calling subscriber. The subscriber can then dial the destination number. The
subscriber receives either a ringing signal, an engaged or busy tone signal, or an
equipment busy tone indicating congestion between the called exchange and the calling
line. These are signals with which the telephone subscribers themselves are concerned.
Signaling involves sending signals between various switching systems, transmission
systems, and subscriber equipments in a network.
Signaling Tones
In older exchanges, information is passed via a rotary dial by a series of makes and breaks
of the subscriber's loop, interrupting current flow. In modern exchanges, voice-frequency
musical tones are sent to the exchange as push buttons are pressed. These tones are
usually called DTMF (Dual Tone Multi-frequency) as each time a button is pressed, two
tones are simultaneously sent out to the line. Distinctive signaling tones are provided in
all automatic exchanges.
Typically, there are four distinct signaling tones:
Dial Tone: The Dial tone is used to indicate that the exchange is ready to accept
the digits dialed by the subscriber. The subscriber should start dialing the number
only on hearing the dial tone. Otherwise, the initial digits of the dialed number may
be missed by the exchange.
Ringing Tone: When the line of the called subscriber is obtained, the exchange
sends the ringing current to its telephone set. Simultaneously, the exchange sends
a Ringing tone to the calling subscriber too. The ringing tone and the ringing
current are two similar, but independent quantities, having a double-ring pattern.
Therefore, it is possible that the calling subscriber hears the ringing tone, whereas
the called subscriber may not hear any ring.
Number unobtainable tone or Equipment busy tone: The Number unobtainable
tone may be sent to the calling subscriber due to a number of reasons. The called
subscriber line may be out of order or disconnected, or there may be an error in
dialing. It may also be due to congestion between the called exchange and the
calling line.
- 239 -
Signaling Techniques
The telecommunication network classifies signaling techniques on the basis of the
following:
Type of signaling information
Local loop signaling: Local loop signaling refers to signaling in which signals are
transmitted between telephone equipment and the exchange. For example, the Offhook, On-hook, Seize, and Clear signals are transmitted over the local loop.
Selection signaling: Selection signaling conveys information relating to the routing
of the call.
Technology
- 240 -
Introduction - Networks
Accurate network organization is very essential for call processing and routing. To have a
well-organized network, you need to plan the network carefully. Over the years, network
planning has kept varying with respect to the number of subscribers.
In the beginning, there were individual exchanges that connected limited subscribers in a
specific area. Later, the neighboring areas were connected to these exchanges. With
increasing subscribers, all the exchanges needed to be networked.
Structure of the Telephone Network
Initially, all exchanges were connected to each other directly. However, the network was
later modified to create a system of different levels. It was no longer necessary for every
exchange to be connected to every other exchange directly.
The levels in a telephone network are:
The Local exchange: The subscriber lines are connected to the local exchange.
The Tandem switch: The Tandem switch is used basically for the routing
operation. As an exception, subscriber lines may be connected to this exchange.
The Trunk exchange: Long distance calls, which need the use of trunks, go
through this exchange.
The International gateway: This is the highest level of exchanges. International
calls are routed through this exchange.
- 241 -
The invention of the Cross connection point or MDF (Main Distribution Frame) followed the
Distribution Point. At the Cross connection point, we can have more number of incoming
subscriber lines as compared to the number of lines connecting to the exchange. For
example, we can have 30 pairs terminating at the cross connection point, and only 20
going out. As the probability of all lines being busy is low, we can have this degree of
concentration.
Adding subscribers to the Subscriber Line Network
If subscribers are to be added to the existing subscriber network, the following techniques
are used:
Cable laying: You can add subscribers to the network simply by laying more
cables between the cross connection points or MDFs and the exchange.
Concentrator: Concentrators or 'line concentrators' that consolidate subscriber
loops are remotely operated and the concentration or expansion portion of the
switch is placed at a remote location. Concentration can also be effectively carried
out using carrier techniques, either pulse-code modulation (PCM) or frequency
division multiplexing (FDM). As all subscribers will not be accessing the exchange
resources simultaneously, they can be connected through a line concentrator.
Remote Survivable unit: Remote Survivable Unit (RSU) is a part of the main
exchange located away from the parent exchange. It caters to the subscribers just
like the parent exchange caters to them, and can also work as a standalone
exchange with local loops. The RSU is set up to share the load of the parent
exchange. Initialization, administration, operation, and maintenance are done from
the parent exchange.
- 242 -
In Tele-traffic theory, certain probability distributions are derived. These are designed as
mathematical models. The models are usually based on mathematical relation between
three factors:
Grade of service
Traffic interest
Equipment requirement
Traffic Intensity
The international unit of traffic is the Erlang, named after Danish mathematician Agner
Krarup Erlang, who laid the foundation of the traffic theory. An Erlang is expressed as l/m
where l is the average calls arrival rate and m is the average call service rate. From a
practical standpoint, the Erlang is a measure of traffic intensity, where one Erlang
represents one circuit occupied for one hour.
Traffic intensity can be defined in three ways:
The ratio between the period of time a switching device is occupied to the total
period of time For example, if a trunk circuit is engaged on different calls for a total
time of 25 minutes in an hour, the traffic intensity is determined as 0.4 Erlangs.
The number of simultaneously occupied devices in a group of switching devices
For example, five trunk circuits in a route are engaged at any given time. The traffic
intensity is thus 5 Erlangs.
The product of the number of calls per time unit and the mean holding time of calls
(A = y * s) For example, in a local exchange, the total number of calls during 1 hour
was 1800. The average holding time was 3 minutes. Therefore, the traffic intensity
will be calculated as 1800 * 3/60 = 90 Erlangs.
Traffic Concepts
There are three additional traffic concepts that affect the traffic intensity.
Traffic carried/traffic volume: The total traffic carried during a certain time is called
traffic volume. Mathematically, traffic volume is an integral part of the traffic curve.
Traffic offered: The concept of traffic offered is a theoretical quantity calculated on
the basis of the number of circuits that are used. It is the estimated potential of the
network.
Traffic lost: The traffic lost is also a theoretical quantity calculated from the
difference between traffic offered and traffic carried.
- 243 -
Traffic Volume
The traffic volume keeps fluctuating during the day. Traffic volume is dependent on the
subscribers' habit of using telephones. When dimensioning a network, you must consider
the following factors:
Busy hour
Occupation time
Unsuccessful call attempts
Grade of service
Subscriber reactions
Traffic Metering
Modern exchange equipment normally includes functions for traffic metering. These make
it possible to collect data on the traffic in the exchange and store it on tapes for
subsequent processing. It is also possible to collect data from many different exchanges
in special operation centers. The measurements may be taken at set various factors
concerning a network, such as call rate. You need to think about the media through which
all the information travels and make a cost/benefit analysis of various media.
Formulae used in Traffic Engineering
There are two main formulae used in traffic engineering:
Erlang B and Poisson. The Erlang B formula assumes that all blocked calls are cleared.
This means that the subscribers do not redial when they cannot get through. The Poisson
formula assumes that the subscriber simply keeps on redialing. If the Poisson method is
used, you will buy more trunks than if you use Erlang B. Poisson typically overestimates
the number of trunks you will need while Erlang B underestimates the number of trunks
that you will need. There are other more complex but more accurate ways of estimating
the number of trunks needed. Erlang C and computer simulation can be used for this.
Introduction - Transmission
You need to design a transmission system for quality transmission and efficiency of
operation. Once factors such as network and charging are determined, you need to
determine the media through which information will travel.
Transmission systems include Transmission techniques and Transmission media.
Need for Transmission Techniques
The binary code generated for each sample by the PCM encoder is not suitable for
transmission. Therefore, a suitable transmission technique has to be chosen to transmit
the signal.
- 244 -
This is because the binary output from a PCM system normally has a wide range of bit
patterns, including strings of 1s and even longer strings of 0s. However, for effective
regeneration of the signal, the signal should have a frequency of 1-to-0 and 0-to 1
transitions.
Also, the transmission of the PCM binary signal, which is made up of zero and positive
voltages, creates a line signal with a significant amount of energy in the DC and low
frequency range. The transformers on the line system cannot handle this. There may also
be other problems associated with the transmission of the low frequency power spectrum
of binary signals, such as interference with audio signals on adjacent cables.
The most common line codes are HDB3, 4B3T, ADI/AMI, and CMI.
AMI (Alternate Mark Inversion) Technique
AMI is a transmission technique in which successive 1's are represented with opposite
polarity. The efficiency of this code conversion is given by the ratio of the information
carried to the capacity of the line code. AMI has a code efficiency of 67 percent
Transmission Systems: Multiplexers
Multiplexers, Optical Systems, and Wireless systems are some of the Transmission
Systems.
A single conversation does not utilize bandwidth to the maximum extent. To utilize the
bandwidth to the full extent, you can combine many such conversations to transmit
through a same line by the process of Multiplexing. The process of conveying a number of
signals simultaneously over a single bearer is termed as multiplexing. FDM systems can
be used on different types of media such as symmetrical paired cables, coaxial cables,
radio links, and satellite links.
Multiplexing can be done by two techniques:
- 245 -
FDM was frequently used in the past, but now has been replaced with the digital
equivalent Time Division Multiplexing (TDM).
Multiplexing in a TDM system: In networks where high capacity is needed, it is more
economical to group a number of PCM systems using higher-order multiplexing. This is
done by bit interleaving. The bit rates at different multiplexing levels in a 30/32 channel
system are shown below:
The idea is to combine 'n' input signals (from each of the 'n' channels) into a single
multiplexed channel. The 'n' individual signals are separated and processed at the
distant end and fed to the appropriate output channels. A time-division-multiplexed
system has a common highway shared by a number of channels, each of which
occupies the highway during periodic slices of time, known as 'time slots' (TS).
This multiplexing technique requires that sampling be done to the input signal
first. A number of such time slots are then combined to form a frame. Each of
these time slots carries information from the corresponding channel.
Transmission Media
A suitable medium is required to transmit speech signals regardless of the technique you
use.
Transmission media can be differentiated into two main groups:
Wired media
Wireless media
- 246 -
Flat rate: The simplest possible form of charging is the flat rate charge. In this
charging plan, call charges are fixed for a period of time. Whether you make 5 or 25
calls a day, the charge is the same. One of the advantages of the model is to
stimulate the use of existing installations. If the company decides to opt for this
model, the charges for installation are usually quite high. To avoid having to lay
down new cables and other costs associated with catering to new subscribers, the
- 247 -
company may decide to charge a flat rate. Many consumers will then use the
existing phones already installed at various places.
Unit fee charging: Call charges depend only on the number of calls, not on other
factors such as the duration of the call or the distance involved. The exchange
counts each subscriber's calls. Every call costs a fixed amount regardless of
where the subscriber rings or how long the call lasts. The cost per call is always
the same.
Time charging: Under Time charging, the call is charged based on the duration of
each call. Thus, call charges depend upon the amount of time the subscriber kept
the exchange busy. The greater the distance between the called and calling
subscriber, the more the equipment involved, and the more the cost of the call. For
example, though Mumbai-Pune is a local call, these calls are time charged at a
higher rate than a normal local call within the city.
Some countries have formulated different charges for different times of the day, thus
making the charging entirely dependent on the time of the day.
Charging Methods
Calls are charged by using either a metering instrument connected to each subscriber line
or a metering register assigned to each subscriber in case of electronic exchanges. The
count in the meter or register represents the number of charging units. The subscriber is
billed by multiplying the number of charging units by the charging rate. The count in the
meter is incremented by sending a pulse to the meter. Charging methods may be duration
dependent or duration independent.
The two charging methods prevalent are:
- 248 -
Glossary
Analog:
An analog signal is a continuously varying electromagnetic wave that can propagate
through a variety of media.
Bit interleaving:
This is a form of Time Division Multiplexing (TDM) for synchronous protocols such as
HDLC. Bit interleaving retains the sequence and number of bits to achieve correct
synchronization between both ends.
Called subscriber:
In a telephone conversation, the person who receives the call is known as the called
subscriber.
Calling subscriber:
In a telephone conversation, the person who initiates the call is known as the calling
subscriber.
CCITT:
Consultative Committee on International Telegraph and Telephone. This is the principal
international standards-writing body for digital telecom networks (ISDN).
Clear:
The clear signal is sent to the exchange after the subscriber hangs up.
Digital:
The conversion of voice or data into a stream of binary information (0s and 1s).
DTMF (Dual Tone Multi-Frequency):
A term used for push button or touchtone (an AT&T trademark) dialing. The pushed button
generates a tone, actually the combination of two tones, one of high and the other of low
frequency. They are necessary to access advanced network features such as call barring
and call forwarding.
Hop distance:
Distance between 2 boosters or repeaters.
- 249 -
Multiplexing:
A technique that allows many signals to be sent along the same transmission path.
Numbering Area:
The area where two subscribers use identical dialing procedure to reach any other
subscriber in the network.
Off-Hook:
A telephone set in use - the handset is removed from its cradle, thus sending an electric
signal to the exchange that a circuit needs to be opened.
On-Hook:
The normal state of the telephone in which the handset rests on the cradle and the circuit
to the exchange conducts no electric signal.
Quantum Values:
Discrete finite digital values corresponding to the specific instance of analog signal.
Seize:
The seize signal is sent to the subscriber while the exchange is checking for resources
required for call setup.
Signal:
A signal is a sequence of electronic pulses.
Signaling:
Signaling is the transmission of information by means other than the unaided human
voice. Signals, which can be visual, audible, or electric, can be made by a variety of
means, including lighted torches, smoke, flags, lamps, drums, guns, telegraph, telephone,
and radio. Signals are used to control railroad trains and vehicular traffic on roads and
highways and to communicate with ships, airplanes, and other vehicles. Transmission of
electric signals over great distances is known as telecommunication.
- 250 -
Switching System:
A switching system is used to establish a path between a set of input and output circuits.
Tele-traffic Theory:
It is a branch of applied probability. The Tele-traffic theory is the mathematical description
of message flow in a communications network.
Trunk:
It is the line of communication between switching systems.
WAP (Wireless Application Protocol):
It is a technology that allows your mobile phone to browse the Web. It is a protocol for
data transmission over low bandwidth wireless networks.
- 251 -
PL/I
INTRODUCTION
PL/I was developed by IBM in the mid 1960s and was originally named as NPL(New
Programming Language)
It was first introduced in 1964. The name was changed to PL/I to avoid confusion of NPL with
National Physical Laboratory in England.
Previous languages had focussed on one particular area of application, such as Science or
Business. PL/I was not designed as to be used in the same way. It was the first large scale
attempt to design a language that could be used in a variety of application areas.
PL/I is used significantly in both Business and Science applications.
Marathon Oil Company, Ford Motor Company, General Motors are some of the clients.
Unlike many other languages PL/I is completely free-form.
No reserved keywords I.e PL/I determines the meaning of the keywords from the context of
usage.
E.g. : It is perfectly valid to declare a variable AREA even though it is also a PL/I keyword.
FORMAT OF A PL/1 STATEMENT
Column 2 to 72 are used for coding PL/1 statements. each statement should end
with a semicolon.
First statement of a program should be PROCEDURE or PROC. each procedure
2 :statement must begin with a label, 1 to 31 chars.
The first character of a label should always be an alphabet and the label should
3 :be followed by a colon.
Last statement of a procedure always ends with END. END ends the program
4 :and passes the control to the operating system.
1 :-
DECLARE Statement
DCL is the statement after proc which means DECLARE and is used to reserve storage for data
or variables indicating the attributes of a variable.
In PL/1 there are 2 basic data types :1. Arithmetic data and
2. String data (char strings)
DCL Arithmetic data items
Form :- DCL variable_name mode scale base precision
Mode of an Arithmetic item is either REAL or COMPLEX. default is REAL.
Scale is either FIXED or FLOAT.
Base is either DECIMAL or BINARY.
- 252 -
Precision means number of figures that a fixed point data item can hold or in case of floating
point, the minimum number of valid digits to be regarded as significant.
BIT strings
Bit strings are like char strings except that the digits represent one bit (0 and 1). Bit strings must
be enclosed in quotation marks.
- 253 -
Explenation
follows a label
separates list items
ends a statement
encloses list items
multiplication
- 254 -
- 255 -
bit string
decimal floating point number
character string
binary fixed point number
decimal fixed point number
Expressions
IF, THEN , ELSE statement
Simplest if then else statement :-
c = 100;
else do;
- 256 -
c = z + 10;
x = y;
end;
If character strings of different lengths are compared then the shorter one is padded on the right
with blank spaces.
In case of bit strings; if length differs, the shorter string is padded to the right with '0'B.
NULL statement :- null statement consists of a semicolon. it is used where logically no statement
is necessary.
e.g. :if x > y then if m = n
then;
else z = 0;
else z = z + 1;
OPERATORS
comparison operators are as follows :< less than
> greater than
= equal to
<= less than or equal to
< not less than
> not greater than
= not equal to
>= greater than or equal to
Bit string operators are as follows :NOT alt-170
AND &
OR |
Concatenation character is ||
DO groups
Iterative do group used in an IF statement is also used to put several PL/1 statements together,
but in this type of do group these statements are as a rule executed several times over a group.
e.g. :do
i = 1 to 10;
........
........
- 257 -
end;
The do group will run through 10 times.
BY statement:If the control variable is to be increased by a step other than 1, then you use by statement.
e.g. :- do count = 1 to 20 by 2;
in do groups you can also count downwards.
e.g. :- do i = 25 to 1 by -1;
in addition to constants; variables and expressions can also be written in specification.
e.g. :- do alpha = x to beta * 2 by delta;
Multiple Specification :multiple specifications can be used in a do statement. control passes to the next specification
when previous has finished.
e.g. :- do i = 1 to 5, 20 to 25, 50;
This loop is executed 5 times for i = 1 to 5,
then 6 times for i = 20 to 25,
and then again with i = 50.
Hence the loop is executed totally 12 times.
Often do groups have to be executed until a certain condition is met. these cases can be handled
with while statement.
e.g. :- do while (x < y);
This loop is executed as long as x is less than y.
e.g. :do while (x > y) until (z = 100);
............ .....
endo;
This loop runs as long as x > y and z is not equal to 100.
Nested DO groups :Nesting of do groups to a maximum of 49 is allowed by PL/1 optimizing compiler.
e.g. :outer : do i = 1 to 5;
inner : do j = 1 to 3;
.....
- 258 -
end
end
inner;
outer;
i = 1 to 100;
.....
if x > y then leave;
.....
end;
GOTO statement
With goto statement you can jump to any statement, which has a label, except an iterative do
group.
e.g. :i = 1;
a: if i > 10 then goto b;
......
i = i + 1;
goto a;
b: ......
Data Aggregates & Arrays
Data Aggregates
Two types of data aggregates are there :- arrays
- structures
An ARRAY is a collection of several elements with same attributes. They are arranged in a table
or a matrix.
When you would like to put unequal data elements together in an aggregate, you should use a
STRUCTURE.
- 259 -
i = 1 to 5;
numbers(i) = i * 2;
end;
Subscripts need not just consist of constants and variables, they can also be whole expressions.
e.g. :cost(i+j)
numbers(i+2)
numbers(costs(i))
costs(i+j*2)
Built-in functions :A built-in function replaces a number of statements which the programmer would otherwise have
to write himself.
For e.g. function ALWAYS return one value and is recognised by PL/1 thru syntax.
e.g. :dcl (a,b) fixed dec(9);
dcl x(10) fixed dec(3);
dcl y(12) fixed dec(7);
a = b + sum(x) + sum(y);
Multi-Dimensional Array :The dimension attribute states the number of the dimensions for an array and the bounds of each
dimension.
e.g. :- dcl table(7,2) fixed decimal(3);
The above mentioned array consists of 7 rows and 2 columns.
e.g. :- dcl parts(3,3,5) char(10);
The above declared parts array consist of 45 elements.
e.g. :dcl tab(3,5) fixed binary(15);
- 260 -
do
j = 1 to 3;
do k = 1 to 5;
tab(j,k) = 2;
end;
end;
x = sum(tab);
Value of 'x' after execution is 30 because each of the 15 elements in this array is set to 2.
All element of array tab can be set to 2 by one single instruction. [ tab = 2 ].
Cross section of an array :you can also address a cross section of a array.
e.g. :dcl figures(5,3) fixed dec;
dcl x(3);
x = figures(2,*);
in the above case * represents all the elements of row 2.
hence x = figures(2,*) is equal to
x(1) = figures(2,1);
x(2) = figures(2,2);
x(3) = figures(2,3);
Name of the whole structure is personnel. Each element in it, has it's own name and it's own
attribute.
During processing elements can be addressed singly or all together using the structure name. A
single element can be addressed by it's name.
for e.g. :name = 'Siva Mani';
- 261 -
dcl 1 new,
name,
payment,
3
gross,
net,
deductions;
name,
address,
payment,
gross,
net,
deductions;
There is an assignment for all the elements which have the same qualified names in the
structures new and old.
new = old, by name;
3 elements are assigned in this structure expression.
new.name = old.name;
new.payment.gross = old.payment.gross;
- 262 -
new.payment.net = old.payment.net;
Introduction to Input/Output
Basic features of Input/Output
GET :Transmits or gets data from external medium to internal storage.
PUT :Transmits data from internal to external storage.
2 types of transmission are there between internal & external storage :-
stream i/o with get & put :Data item is transmitted singly. advisable for small quantities i.e. screen & card readers.
record input/output with read & write :Complete record of data items is transmitted and copy of the record is usually kept in internal
storage. It is preferable for larger qty of data.
Basic features of Input/Output
opening & closing of files :e.g. :- dcl master file record sequential;
..........
open file(master) output;
..........
close file(master);
Environment attribute
Environment attribute defines the physical organisation of data sets (e.g. record length, blocks)
and the method of processing them.
Default value for the type of organization is consecutive. this type of organization can be
- 263 -
STREAM Input/Output
STREAM I/O Features
A string of characters is transmitted in stream i/o.
Character data type will not cause conversion if it is used in get or put.
Standard files for stream i/o :the get and the put statements not having data file declarations are linked with standard files for
which there are prescribed file names.
SYSIN for input, SYSPRINT for output
hence
PUT LIST(DATA LIST);
is taken as PUT FILE(SYSPRINT) LIST(DATA LIST);
3 Types of I/O Stream
list - always requires data list
data - requires no list
edit - requires data and format list
List-Directed I/O :It is simplest form of stream I/O, and is ideal for testing input at the terminal.
- 264 -
Data-Directed I/O :Input data can be read in the form of assignment statements in input stream. a semi colon or the
end of data file ends the transmission of an i/o statement.
e.g. :- A=2, B='XY'; ------> get data(a,b);
A=5;
B='UV';
Edit-Directed I/O :It is the most commonly used type of stream i/o. a data list is needed here as well, to contain the
names of data items, arrays or structures. in addition a format list is required in which the format
of i/o data is described.
- 265 -
Record Input/Output
Overview & Differences between STREAM & RECORD I/O
RECORD I/O
The data in a data set is considered as a collection of
record.
Transmits records just as they are stored.
There are no standard files.
- 266 -
STREAM I/O
Data is considered
as a continuous
sequence.
Data conversion is
possible.
SYSIN and
SYSPRINT are valid
standard files
Allows only
sequential form of
data set.
e.g.:-
dcl
1 inrec,
2 part1 char(25),
2 part2 (10) decimal fixed(7,2);
- 267 -
LOCATE mode
In this mode the logical records are directly processed in buffer. here a based variable or a
pointer variable is needed (a structure with the length of a logical record) is like a mask which is
laid over the buffer.
record input in locate mode :- Files to be processed using locate mode must, like other files be
declared and opened. the first physical record has already been read into the buffer and opened.
using :- read file(filename) set(pointer);
The address of the first record logical pointer is put in the variable pointer.
POINTER Variable
A pointer variable is a variable (full word, 4 bytes) which contains a storage address. this address
can be assigned to pointer variable in various ways.
BASED Variable
In the e.g. given below, read places the address of next logical record in the pointer ptr.
e.g. :- dcl 1 efile based(ptr),
2 name char(30),
2 first_name char(20),
2 persno fixed dec(5);
Read file(pers) set(ptr);
The based variable efile is overlaid on the logical record, as it has the attribute based and
contains address as the pointer.
Example of Record read in locate mode
F dcl one file input sequential buffered
env(fb recsize(200) blksize(1000) buffers(1));
dcl q pointer;
dcl record_a char(200) based(q);
.....
- 268 -
On 6th read, the 2nd physical record is retrieved from the data set and put in buffer.
you recognize MOVE mode by the option FROM and LOCATE mode by the option SET.
If quantity of data per logical record varies a great deal (as for e.g. with addresses) it is a
good idea to store the data in variable length record.
- 269 -
F note :- There is 4 byte record length field (RL)before every variable record.
There is a 4 byte block length field before every block.
F
e.g. :- suppose the biggest logical record can be 1000 bytes long and that the records are
to
be blocked in such a way that a block is likewise to have the maximum length of 1000
bytes, then environment attribute of file declaration would look like
env(vb recsize(1004) blksize(1008));
Size statements are calculated as :recsize = 1000 bytes + 4 bytes record length
blksize = recsize + 4 bytes block length
F
In fixed format, the record length and the block lengthare fixed but in variable format, the
record length and the block length vary
- 270 -
blksize option even if specified is ignored. A recsize option will be checked against the details
stored with the file.
The utility IDCAMS (access method services) is used to set up a vsam file initially.
Various DCL for VSAM datasets
e.g. :- dcl vfile file record direct keyed input env(vsam);
Vsam files are all direct access files. associated with every record is a key, which helps in
accessing the record in any order.
e.g. :- dcl vfile file record sequential input env(vsam);
If you want to start at the beginning and process every record, just as with a consecutive file,
specify the file as sequential.
e.g. :- dcl vfile file record sequential keyed input env(vsam);
The first read of the program specifies the key of the record you want to start at. subsequent
sequential read statements are issued without a key.
e.g. :- dcl infile file record direct keyed input env(vsam);
to read a vsam file directly.
e.g. :- dcl infile file record direct update env(vsam password('master'));
When a file is originally set, it can be given one or more passwords. if attribute record is given, it
means that it must be a file, hence the attribute file is implied and therefore optional.
- 271 -
Updating a ksds directly :- The file should be opened as update. you cannot amend the key.
e.g.: dcl kmast file record direct update env(vsam);
dcl 1 area,
2 kskey char(5) init('00081'),
2 ksname char(15);
read file(kmast) into(area) key(kskey);
/* amend */
rewrite file(kmast) from(area) key(kskey);
Delete a record in ksds :- :- :- Use delete statement.
e.g. :- kskey = '00056';
delete file(ksds) key(kskey);
Add a record in ksds :- :- :- Use write statement.
e.g. :- kskey = '00024'; ksname = 'Applets';
write file(ksds) from(area) keyfrom(kskey);
F First direct access & then sequential access :e.g.: dcl ramp file record sequential keyed
env(vsam);
read file(ramp) into(area) key('123/999/b');
read file(ramp) into(area);
GENKEY option
F
- 272 -
Write can also be used and the new records added are always added at the end.
Delete is not allowed.
Rba must be a 4 byte character string. this will add a new record to the end of the file and place
the relative byte address of the record in the field rba. this is then used as a key on a read or
rewrite. file should be declared as keyed.
- 273 -
145');
- 274 -
- 275 -
- 276 -
Pseudovariables
If a function is on the left in an assignment, you have a pseudovariable. pseudovariables are
functions which may not only manipulate values, but may also receive them.
Types of Blocks
F
- 277 -
An INTERNAL procedure is invoked by a call from a surrounding block and control returns to
statement after the call.
Within an external procedure you can have upto 50 internal procedures.
form :- A:proc;
......
begin;
......
......
end;
......
end A;
Scope of Declaration
Variables which are declared have two scope attributes :1. Internal
2. External
If a variable has an INTERNAL scope, then it is known in the block in which it was declared and
in all the blocks which physically lie in that block until it is not declared in one of these subordinate
blocks.
- 278 -
......
inner:proc;
dcl minus fixed dec(7,2);
dcl x char(100);
end inner;
end outer;
rate field is addressed in both blocks.
character field minus is not known in block inner.
The variable 'X' has attribute internal and hence you are dealing with 2 variables that are known
within their blocks.
If a variable is to be same in two external procedures, then it must be declared with same
attributes EXTERNAL.
mpro:proc options(main);
subpro:proc;
dcl 1 rec external,
dcl 1 rec external,
2 a char(30),
2 a char(30),
2 b fixed bin(31);
2 b fixed bin(31);
Structure rec which is declared in both external procedures, occupies the same data area.
Automatic (default)
Static
Based
Controlled
- 279 -
......
end;
......
end x;
:
<------------------------- freed
- 280 -
srou2:proc
dcl ......;
......
end srou2;
Arguments
When a procedure is invoked using a call, it is possible to pass variables which are called as
arguments.
F e.g. :- dcl rec1 char(45);
dcl 1 inrec,
2 part1 char(10),
2 amount fixed dec(7,2);
call srou(rec1,inrec);
/* arguments */
Parameters
A program to which arguments are passed when it is invoked, are called as parameters.
F
e.g.:- srou:proc(a,b);
dcl a char(100);
dcl 1 b,
2 b1 char(10),
2 b2 fixed dec(7,2);
- 281 -
e.g. :- srou:proc(x,y);
......
ent2:entry(m,n,o);
......
if x = 0 then return;
......
end srou;
Functions
Functions are always a part of an expression. A function is replaced by its result after execution.
F
x = sum(tab3);
/* with an argument */
- 282 -
......
if x > y then return(x*y);
else return(z);
......
end calc;
(ON-UNIT)
On ENDPAGE and on ENDFILE are some important conditions which can be forseen.
F
- 283 -
Sample Program 3
P3M0:proc options(main);
dcl (countin, countout) fixed dec(3) init(0);
dcl (totalin, totalout) fixed dec(7,2) init (0);
dcl (averagein, averageout) fixed dec(5,2);
dcl number fixed dec(5,2);
on endfile(sysin) goto finish;
read:get file(sysin) list(number);
- 284 -
if number > 100 & number <= 60; then goto in;
totalout = totalout + number;
countout = countout + 1;
goto read;
in: totalin = totalin + number;
countin = countin + 1;
goto read;
finish:
averagein = totalin / countin;
averageout = totalout / countout;
put file(sysprint) list(countin, totalin, averagein);
put file(sysprint) skip list(countout, totalout, averageout);
end;
P6M0:proc options(main);
dcl temp(7,2) fixed dec(3), da(7) fixed dec(3);
dcl wa fixed dec(3), i fixed bin(15), eof bit(1) init('0'B);
on endfile(sysin) eof='1'B;
get file(sysin) list(temp); /* seven pairs of temparature */
do while (eof = '0'B);
do i = 1 to 7;
da(i) = (temp(i,1) + temp(i,2)) / 2;
end;
put file(sysprint) skip list(da); /* write to sysprint */
put file(sysprint) skip list(wa); /* 7 values of da,wa */
get file(sysin) list(temp);
/* new input of temp */
end;
end p6m0;
Sample Program 5
P9M0:PROC OPTIONS(MAIN);
dcl E1 file record env(F recsize(50), blksize(50));
dcl A CHAR(50) init('THIS IS A TEST');
write file(E1) from(A); /* output is written to file E1 */
close file(E1);
read file(E1) into(A); /* reads data from file E1 */
put data(A);
- 285 -
- 286 -
- 287 -
prline.text = name;
write file(a1) from(prline);
prline.text = street;
write file(a1) from(prline);
if verify(town,'.-ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') = 0
then prline.text = '*****';
else prline.text = town;
write file(a1) from(prline);
end;
end;
end P14M0;
Sample Program 8
P16M0:proc P16M0 */
proc options(main);
dcl p16m2 entry;
dcl (number,pvalue) fixed decimal(5,2);
on eof bit(1) init('0'B);
on endfile(sysin) eof = '1'B;
do until(eof);
get list(number);
if eof then do;
call p16m2(number,pvalue);
put skip list(number,pvalue);
end;
end;
end;
P16M2:proc(number,pvalue);
dcl (number,pvalue) fixed decimal(5,2);
if number >= 100
then pvalue = number * 0.05;
else pvalue = number * 0.03;
end
- 288 -