You are on page 1of 182

Software Engineering

Program Design &


Development Mainframe

Guest Lecture

Final Presentation
October 2009 – 2nd Version
presented by
A member of IEEE and ACM
Dipl. Ing.
Ing. Werner Hoffmann
EMAIL: pwhoffmann@t-
pwhoffmann@t-online.de Please see the notes
pages for additional
See: © Copyright Note in Note Page.
comments.
Date: 03.10.2009 SE_PGM_Design_V2.ppt Page: 1

Welcome to the guest lecture called “Program Design & Development". This
lecture is one small part of “Software Engineering”.
This additional lecture contains some exercises.
© Note: Permission to make digital or hard copies of all or parts of this work
for personal or classroom use is granted without fee provided that copies are
not made or distributed for profit or commercial advantage and that copies
bear this notice and the full citation the first page. To copy otherwise, to
republish, to post on servers or to redistribute to lists, requires prior specific
permission and/or a fee.

1
Audience

Software Engineering At least this lecture may be interested


Program Design &
Development for:
© 2009

• Researcher for Education / Training,


• IT Professionals,
• Professors, and Students.

"Learning is experience.
Everything else is
information.“
Albert Einstein.

Date: 03.10.2009 Program Design & Development Page: 2

Let me first give a statement about the ANTICIPATED AUDIENCE:


We anticipate the audience will consist of participants who are interested in beginning to conduct more
rigorous education research, past participants in the “Introduction to Education Research” workshops, ,IT
Professionals who are establishing their research careers, and participants who need some protected time and
space to think about their research without phones ringing and email dinging.
At least this session may be interested for:
•Researcher for Education / Training,
•IT Professionals,
•Professors, and Students.

•Assumed Background:
Program Design & Development
I assume that you have a firm grasp of basic information processing technology and that you have
had some experience analyzing and designing information systems. Consequently, you understand
the underlying principles.
• Software Design Methods,
• Modular Design/Structured Programming Technology,
• Data Structure Methods.

Enjoy the lecture and I hope you find it useful.

2
Goal

Software Engineering The goals for this session are to gain a


Program Design &
Development solid understanding of the following
© 2009
topics:

• The fundamental design, analysis, and


implementation of basic data structures
and algorithms;
• Principles for good program design,
especially the uses of data abstraction
and modular program composition;
• Basic concepts in the specification
and analysis of programs.

Note: This session is not a replacement of the course “Software


Engineering”. It is a small addition…
Date: 03.10.2009 Program Design & Development Page: 3

See above…

3
Agenda

1. Introduction

2. Some Examples/Exercises

3. Conclusion

Note: - Some exercises (homework) are included!


- Program Design is done by using “Pseudo Code”,
- Shown programs are written in PL/I (for /390 or z/OS).

Date: 03.10.2009 Program Design & Development Page: 4

Here is the agenda for my session.

Program Design is shown using “Pseudo Code”; Programs are written in PL/I for /390 or z/OS.

4
Agenda

1. Introduction
• Review: Structured Programming / Pseudo Code
• Review: Modular Design
• Review: (H)IPO and Data Structures
• A general Program Design Strategy
2. Some Examples/Exercises
3. Conclusion "You do not really understand
something unless you can
explain it to your
grandmother."
Albert Einstein.

Date: 03.10.2009 Program Design & Development Page: 5

Let’s start with some reviews.

5
Introduction (1)

Learning to write computer programs is not easy:


• Students have difficulty learning programming as they are trying to develop
skills in three areas at the same time, these
being:
You need to improve
• using the program development environment; your design methods –
this session might be
• learning the programming language syntax; right for you…
• and developing logic design.
• With respect to the above, good pedagogy therefore requires
the instructor to keep initial facts, models, and rules simple and
only expand and refine them as students gain experience.

This session is about “Program Design & Development”.


As a result students should get better understand what
“design & proper programming” means.

Date: 03.10.2009 Program Design & Development Page: 6

See above…

6
Agenda

1. Introduction
• Review: Structured Programming / Pseudo Code
• Review: Modular Design
• Review: (H)IPO and Data Structures
• A general Program Design Strategy
2. Some Examples/Exercises
3. Conclusion

Date: 03.10.2009 Program Design & Development Page: 7

I like to start with a review of Structured Programming and I like to remember a design method called Pseudo
Code.

7
Review: Structured Programming (1)

I like to look at following main points:

1. Basic Control Logic Structures

2. Equivalent Control Logic Structures

3. Proper Programs

“Intellectuals solve
problems. Geniuses
prevent them.”
Albert Einstein.

Date: 03.10.2009 Program Design & Development Page: 8

… see above.

8
Review: Structured Programming (2)

1) Basic Control Logic Structures:


1. Single Block:
A

2. IF THEN ELSE Block:


T A

p 1

F B

3. DO WHILE Block:
A
T
F
1 p

Date: 03.10.2009 Program Design & Development Page: 9

1) Basic Control Logic Structures:


The theoretical results deal with converting arbitrarily large and complex flowcharts into standard forms so
that they can be presented by iterating and nesting a small number of basic and standard control logic
structures.
A sufficient set of basic control logic structures consist of three members:
1. A sequence of sequential executed operations (BLOCK),
2. A conditional branch to one of two operations and rejoined (an IF_THEN_ELSE structure),
3. Repeating an operation or block of operations while some condition is true. (a DO_WHILE structure).
Note that each structure has one input and one output and can be substituted for any box in a structure, so
that complex flowcharts can result. A major characteristic of programs written in these structures is that they
can be literally read from top to bottom typographically; there is never any “jumping around” as is so typical in
trying to read code that contains general GOTO’s. This property of readability is a major advantage in
debugging, maintaining, or otherwise referencing code at later times. Another advantage of possibly even
greater benefit is the additional program design work that is required to produce such structured code.

9
Review: Structured Programming (3)

2) Control Logic Structure Equivalences:


Example 1: REPEAT UNTIL Block:

Basic Control Logic Structure: Pseudo-Code:

A A
T DOWHILE (p)
F
A 1 p A
ENDWHILE

Equivalent Control Logic Structure:


Pseudo-Code:
F where q = ¬p
T REPEAT
1 A q
A
UNTIL (q)
REPEAT_UNTIL (q)

Date: 03.10.2009 Program Design & Development Page: 10

2) Control Logic Structure Equivalences:


We will say that two proper programs (control logic structures) are equivalent when they define the same
program function, whether or not they have identical control graphs, require the same number of operations,
and so on.
Example 1 shows an equivalent control logic structure; first the basic control logic structure is shown. After
that I show the equivalent control structure (REPEAT_UNTIL).

10
Review: Structured Programming (4)

2) Control Logic Structure Equivalences:


Pseudo-Code:
Example 2: CASE Block:
IF p1
THEN F1
ELSE IF p2
THEN F2
Basic Control Logic Structure: ELSE …
… IF pn
THEN Fn
T F1 ELSE Fotherwise
ENDIF
p1 1 …
T F2
ENDIF
F p2 2 ENDIF
T Fn
F Pseudo-Code:
… pn n
SELECT
F WHEN (p1) F1
Fotherwise
WHEN (p2) F2

WHEN (pn) Fn
OTHERWISE Fotherwise
ENDSELECT
Date: 03.10.2009 Program Design & Development Page: 11

2) Control Logic Structure Equivalences:


Example 2 shows an equivalent control logic structure; first the basic control logic structure is shown. On the
right side I show the Pseudo code using only basic control logic structure and at the bottom the equivalent
program logic using a new defined Control Logic Structure called CASE block.

11
Review: Structured Programming (5)

2) Control Logic Structure Equivalences:


- You can use/define additional equivalent program structures:
Pseudo-Code:
- For example
DO v = exp1 TO exp2 BY exp3
F1
- Iterative DO ENDDO

LOOP
- LOOP’s F1
EXITIF (p1)

- CASE block’s Fn
ENDLOOP

- SEARCH block’s SELECT (exp)


CASE (1) F1
CASE (2) F2
- etc. …
OTHERWISE Fotherwise
ENDSELECT

etc.
Date: 03.10.2009 Program Design & Development Page: 12

2) Control Logic Structure Equivalences:


You can use/define additional equivalent program structures. The only request is that they have to follow the
structured programming theorem: one entry point and one exit point and the meaning of the control logic
structure is well defined.

12
Review: Structured Programming (6)

3) Proper Program (example) :


1 Levels of Indentation 1-3

3
F
T Pseudo-Code:
p3
DOWHILE (p1)
B IF (p2)
THEN DOWHILE (p3)
B
A ENDWHILE
2 ELSE A
ENDIF
p2 ENDWHILE
F T C

p1
T
F
The goal is to construct a
C well defined hierarchy for
the solution.

Date: 03.10.2009 Program Design & Development Page: 13

3) Proper Program:
A Proper Program is a program that is constructed in such a way that the program, each of its modules, and
each of its control structures has the following characteristics:
No dead code; no infinite loops; one entry point and one exit point.

13
Indecomposable program figures (1)

Indecomposable program figures can be restructured by adding


a special flag construct to the program figure:

Terms:

TRUE - allocate flag and set value to TRUE.


FALSE - allocate flag and set value to FALSE.
POP - deallocate flag.
TOP - Test Flag.

Date: 03.10.2009 Program Design & Development Page: 14

Having noted, that program figures may be indecomposable, we need to add the possibility of operations and
tests to be able to restructure the flowchart. The additional operations and tests correspond to “flag” setting
and testing. But we can coach these operations in the concept of a push down stack to show their economy.
In addition to the functions and predicates original to a given program we introduce three new functions and
one predicate as shown above. More specifically, we define process nodes with functions named TRUE, FALSE,
and POP, and a predicate node with function named TOP, which add truth values TRUE and FALSE, remove
and test such truth values, respectively.

14
Indecomposable program figures (2)

Example: Unstructured control flow.


A

T T
1 p B q
F
F

Structured control flow: A TRUE


T
TRUE 3 TOP POP
T T
TRUE 1 POP p B q 2 F
F
F
FALSE

Date: 03.10.2009 Program Design & Development Page: 15

The above example of an indecomposable control flow is used to show how we can use the previous defined
new function to restructure this control flow getting a structured program flow.
Theorem: Any indecomposable program is equivalent to a program whose formula contains at most the graph
labels BLOCK, IF_THEN_ESLE, and REPEAT_UNTIL, and additional functions TRUE, FALSE. And POP, and
predicate function TOP.
For more detail see book: “Software Productivity”, Harlan d. Mills, 1988.

15
Indecomposable program figures (3)

Example: Structured control flow.


A TRUE
T
TRUE 3 TOP POP
T T
TRUE 1 POP p B q 2 F
F
F
FALSE

Pseudo-Code: TRUE
REPEAT
POP
IF p
THEN {A,TRUE}
ELSE {B, IF q
THEN TRUE
ELSE FALSE
ENDIF}
ENDIF
UNTIL TOP
Date: 03.10.2009 Program Design & Development Page: 16

The equivalent structured control flow is shown in the above foil.

16
Conclusion (1)

Program Design Goal: Construct a modular structured solution!

Unstructured Solution!

Date: 03.10.2009 Program Design & Development Page: 17

Our main goal in designing and coding of programs is to define a hierarchical modular structure of a given
requirement using only basic control elements defined in “Structured Programming”. One a higher system level
we can decomposes a complex problem by defining modules or functions. Each construct follows one rule: one
entry and one exit.

17
Conclusion (2)

Program Design & Development….

… ! ? GOTO…

“Not everything that can be counted


counts, and not everything that counts
can be counted.”
Albert Einstein.

Date: 03.10.2009 Program Design & Development Page: 18

… without any comment.

Note: By the way, sometimes I’m still using a goto…., but only in very special cases!

18
Agenda

1. Introduction
• Review: Structured Programming / Pseudo Code
• Review: Modular Design
• Review: (H)IPO and Data Structures
• A general Program Design Strategy
2. Some Examples/Exercises
3. Conclusion

Date: 03.10.2009 Program Design & Development Page: 19

I hope you learned a lot about “Modular Design” during your study about “Software Engineering”.
Here I only like to remember some terms and basic concepts.

19
Modular Design (1)

Key Terms: Concepts:

• Cohesion • System inputs/outputs


• Control flow • The logical definition phase
• Coupling • Define the application context
• Data flow • Define the application functions
• Logical model • Define the application results
• Module
• Primitive
• Process
• Requirement
• Structure chart
• Structured analysis
• Structured design
• Transform analysis
Date: 03.10.2009 Program Design & Development Page: 20

Key Terms:
Cohesion - A measure of a module’s completeness.
Control flow - The transfer of control into or out from a module.
Coupling – A measure of a module’s independence; fewer parameters flowing into or out from a module imply looser
coupling.
Data flow - Data in motion; the transfer of data into or out from a module.
Logical model – A model that exists on paper or in an analyst’s mind; logical models are easily manipulated; contrast with
physical.
Module - A portion of a larger program that performs a specific task.
Physical — Real; actual, operational hardware, software, or data; contrast with logical.
Primitive - A process (or transform) that requires no further decomposition.
Process - An activity that changes, moves, or manipulates data.
Requirement - An element (process, data, etc.) that must be part of a system.
Structure chart - A hierarchy chart on which the data flows and control flows between modules are traced.
Structured analysis - A set of tools and techniques intended to transform an abstract problem into a feasible logical
design.
Structured design - A set of (tools) and techniques intended to convert a logical design into a concrete information
system.
Transform analysis - The act of grouping together the modules (or processes) that manipulate a particular set of data or a
particular data structure.
Concepts:
System inputs/outputs - The methodology is output oriented. It focuses on the system outputs, the exact data the users
need to perform their tasks.
The logical definition phase - The analyst begins by analyzing and designing a logical system and then specifying the
system’s logical requirements.
Define the application context - Key objectives of this first phase include establishing a clear boundary for the proposed
application or system and identifying the application’s internal and external entities. Next, the system’s major functions
(the tasks or processes the system must perform) are defined and translated into measurable system objectives. The major
functions produce the desired system outputs.
Define the application functions - After studying the interrelationship between various entities in the application entity
diagram, the analyst prepares a mainline functional flow diagram to sequentially link all the processes in the proposed
system.
Define the application results - All the required inputs and outputs are generated. Data layouts for each input/output are
determined

20
Modular Design (2)

Key Terms: Modular programs can be


• Composition - Bottom-up characterized as
• Complexity • implementing a single independent
• Construction function,
• Coupling • performing a single logical task,
• having a single entry and exit point,
• Data-driven
• being separately testable, and
• Data structure • being entirely constructed of
• Decomposition - Top-down modules.
• Function
• Hiding From an engineering perspective, a
modularization generally has three
• Logical data structure
purposes:
• Physical data structure
• Process • To make complexity manageable,
• To enable parallel work, and
• System objective • To accommodate future uncertainty.

Date: 03.10.2009 Program Design & Development Page: 21

Key Terms:
Composition - Bottom-up - A methodology that starts with the details and works upward.
Complexity - The control of program complexity is the underlying objective of most of the
software engineering techniques.
Construction - The construction activities are those that directly related to the development of
software, e.g. gathering the requirements of the software, develop design, implement and test the
software etc. Some of the major construction activities are listed below.
· Requirement Gathering, · Design Development, · Coding, · Testing.
Coupling - Coupling is a measure of the strength of interconnection between modules.
Data-driven - A methodology or tool that starts with the data and derives the processes.
Data structure - A set of related data elements.
Function – A meaningful operation or process that produces a desired result for a proposed
system; similar to a process.
Hiding – Knowing that only certain modules (subroutines) have access to (shared) data may
permit fewer checks to-be made on the validity of stored values, and thereby increase efficiency.
Logical data structure - A set of related data elements that ignores how the data are physically
stored.
Physical data structure - A set of related data elements as they are physically stored.
Process - An activity that changes, moves, or manipulates data.
System objective – A desired function of and/or operation performed by a proposed system.
Decomposition – Top-down - Decomposition is a top-down, goal-oriented approach that is used
when the problem is too complex or too abstract to study directly. The idea is to divide (or
decompose) the problem into logically consistent, more manageable sub-problems, and then to
attack the sub-problems.

21
Modular Design (3)

• Used Notation:

Sequence Selection Iteration

o o *

Date: 03.10.2009 Program Design & Development Page: 22

For our Examples and exercises we may used the above notation.

22
Modular Design (4)

Module Structures: Data Segments

Segment D1 Segment D2
Main Module
-Data- Include data D2

Include data D1

Include process P1
External
Process P1
Module E1
CALL E1
Internal
CALL E2
Module E2

Include process P2
Process P2

Process Modules
Date: 03.10.2009 Program Design & Development Page: 23

In the above foil I show an example of a module structure.


It may include data segments and/or code parts.
The structure is organized in hierarchical manner. Each code part has one entry and one exit. Code parts may
be code segments, external modules, and internal modules.

23
Agenda

1. Introduction
• Review: Structured Programming / Pseudo Code
• Review: Modular Design
• Review: Data Model, (H)IPO and Data Structures
• A general Program Design Strategy
2. Some Examples/Exercises
3. Conclusion

Date: 03.10.2009 Program Design & Development Page: 24

During your study you learned methods which are very usable to describe data: Data Structures, Entity –
Relationship Methods, Input – Process – Output Analysis etc.
Also in this section I only would like to remind of some terms, concepts and basic methods.

24
(1)
Data Model, (H)IPO and Data Structures

Data Modeling:

• Data Objects, Attributes, and Relationships


• Cardinality and Modality
• Data Flow Diagrams Trees (Example)
• Data Structure Diagrams
A
• Graphs,
• Trees, Graphs, Nets are not part of
• Nets, this lecture! B C
• ….

D E

Date: 03.10.2009 Program Design & Development Page: 25

Data Modeling
Data modeling answers a set of specific questions that are relevant to any data processing application. What
are the primary data objects to be processed by the system? What is the composition of each data object and
what attributes describe the object? Where do the objects currently reside? What are the relationships
between each object and other objects? What are the relationships between the objects and the processes
that transform them?
Data Objects, Attributes, and Relationships - The data model consists of three interrelated pieces of
information: the data object, the attributes that describe the data object, and the relationships that connect
data objects to one another.
Cardinality and Modality - The data model must be capable of representing the number of occurrences
objects in a given relationship. The modality of a relationship is 0 if there is no explicit need or the relationship
to occur or the relationship is optional. The modality is 1 if an occurrence of the relationship is mandatory.
Data Flow Diagrams - As information moves through software, it is modified by a series of
transformations. A data flow diagram is a graphical representation that depicts information flow and the
transforms that are applied as data move from input to output.

Data Structure Diagrams - These give a broad brush view of the data stored/used by the system.
They generally describe each collection of data in the system (and are backed up by forms describing the
structure and format of each collection). In addition the relationships between the data collections are
documented. These relationships are important to the consistency of the data. The data structure diagrams
may describe physical or logical views as seen by the system/program.

Data structures are used in almost every program or software system. Specific data structures are essential
ingredients of many efficient algorithms, and make possible the management of huge amounts of data, such
as large databases, files etc. Some formal design methods and programming languages emphasize data
structures, rather than algorithms, as the key organizing factor in software design. The implementation of a
data structure usually requires writing a set of procedures that create and manipulate instances of that
structure. The efficiency of a data structure cannot be analyzed separately from those operations.

25
(1)
Data Model, (H)IPO and Data Structures

(H)IPO / Data Structures:


• HIPO (Hierarchy plus Input-Process-Output)
• IPO(S) Input – Process – Output – Storage
• Output Analysis Strategy
• Used Notation: Condition
Simple
component
Sequence Selection Iteration
A

A A A

Null
component
o o
B C B C B *
-

Date: 03.10.2009 Program Design & Development Page: 26

HIPO (Hierarchy plus Input-Process-Output) - The HIPO (Hierarchy plus Input-Process-Output) technique is a
tool for planning and/or documenting a computer program. A HIPO model consists of a hierarchy chart that
graphically represents the program’s control structure and a set of IPO (Input-Process-Output) charts that
describe the inputs to, the outputs from, and the functions (or processes) performed by each module on the
hierarchy chart.
A completed HIPO package has two parts. A hierarchy chart is used to represent the top-down structure of
the program. For each module depicted on the hierarchy chart, an IPO (Input-Process-Output) chart is used to
describe the inputs to, the outputs from, and the process performed by the module.
IPO(S) Input – Process – Output - Storage - IPO (Input-Process-Output) is one of the most fundamental design
patterns. And it makes perfect sense. Before a computer can operate on data, the data need to be entered at
an input device. Now calculations may be performed. And, finally, a result may be displayed on an output
device. The components of the IPO model are defined as:
I: Input - The information, ideas, and resources used
P: Processing - Actions taken upon/using input or stored material
O: Output - Results of the processing that then exit the system
S: Storage - Location(s) where material inside the system is/are placed for possible use at a later time
(optional)
Output Analysis Strategy - The output analysis problem solving strategy begins by looking at the output that
the program is to produce. From the output, the analyst works backwards -- continually asking the question:
Where does this data item come from? An item of data in the output could result from: a calculation; or an
input operation. If the source is a calculation, then the above question is applied to the each data item in the
calculation. This process continues until the sources or values of each data item is known.

Even for data structures I like to use the above shown notation.
Simple component: A simple data element is represented by a box as shown in the above foil.
Sequence: A sequence of operations is represented by boxes connected with lines. In the example above,
operation A consists of the sequence of component B, and C. Note: A is the sequence, B and C are simple
components of A, which must appear in the shown sequence and each component must be there.
Iteration: An iteration is again represented with joined boxes. In addition the iterated component has a star in
the top right corner of its box. In the example above, operation A consists of an iteration of zero or more
invocations of component B. Note: A is the iteration, B is the simple component of A. The number of iteration
is dependent from a condition. The condition is not shown in the diagram, but is part of A.
Selection: Selection is similar to a sequence, but with a circle drawn in the top right hand corner of each
optional operation. In the shown example, operation A consists of one and only one of operations B, or C.
Note: A is the selection, B and C are simple components of A. There is no sequence between B and C. Which
component will be selected is dependent from a condition. The condition is not shown in the diagram, but is
part of A.
Null component: A Null component is an empty simple component and may be a special case of Selection. It
describe the occurrence or absence of a selection component. Note: Be carefully in defining null components.

26
(2)
Data Model, (H)IPO and Data Structures

Structure Diagrams: (example)

A Sequence

Iteration B D Selection

o o
C * E F

Date: 03.10.2009 Program Design & Development Page: 27

A structure diagram is made from combination of the individual component


types.

Note: The components of a tree have only a connection up and/or below, but not
to components at the same level.

27
(3)
Data Model, (H)IPO and Data Structures

Typical faults when preparing the structure diagrams are:


A wrong A ok.
A wrong

B * C B-Body C
B o C o D

Case 1: Wrong Iteration-Sequence B * Case 3: Wrong


Selection Sequence
A ok.
A wrong A ok.

B-C Body D
B* C* B-Body C-Body

Case 2: Wrong Iterations-Iteration B * C * B o C o

Date: 03.10.2009 Program Design & Development Page: 28

Note: A component with * or o doesn’t have a brother!

28
Agenda

1. Introduction
• Review: Structured Programming / Pseudo Code
• Review: Modular Design
• Review: (H)IPO and Data Structures
• A general Program Design Strategy
2. Some Examples/Exercises
3. Conclusion

Date: 03.10.2009 Program Design & Development Page: 29

For our tasks (examples and exercises) I now describe a basic workflow I like to follow.

29
(1)
A general Program Design Strategy

Design Concept:
"The beginning of wisdom for a [software engineer /
Programmer] is to recognize the difference between getting
a program to work, and getting it right.“

Design Process:

• Data design —This phase produces the physical/logical data


structures.
• Architectural design —This phase produces the structural units.
• Interface design —This phase specifies the interfaces between the
units.
• Procedural design —This phase specifies the algorithms of each
method.

Date: 03.10.2009 Program Design & Development Page: 30

Design Concept: A set of fundamental software design concepts has evolved over the past four decades.
Although the degree of interest in each concept has varied over the years, each has stood the test of time.
Each provides the software designer with a foundation from which more sophisticated design methods can be
applied. Each helps the software engineer to answer the following questions:
• What criteria can be used to partition software into individual components?
• How is function or data structure detail separated from a conceptual representation of the software?
• What uniform criteria define the technical quality of a software design?

Design Process: The design process converts the ‘‘what’’ of the requirements to the ‘‘how’’ of the design.
The results of the design phase should be a document that has sufficient detail to allow the system to be
implemented without further interaction with either the specifier or the user.
The following are phases in design:
•Data design—This phase produces the data structures.
•Architectural design—This phase produces the structural units.
•Interface design—This phase specifies the interfaces between the units.
•Procedural design—This phase specifies the algorithms of each method.

30
(2)
A general Program Design Strategy

Workflow: Problem Environment

Data Structures Tasks to be performed

Reading & writing

Program Structure Executable operations

Program Note: Design is about structure!

Date: 03.10.2009 Program Design & Development Page: 31

One lesson to be learned from the past is that we should avoid to start with flowcharts or similar methods.
For many people it has long been an article of faith that flowcharting should precede coding. There is a
kernel of important truth here: coding cannot be the first stage in building a program; it must be proceeded
by design. But flowcharting is not designing! Design is about structure, and flowcharts, as their name
suggests, are about flow of control. At the time when the designer should be thinking about the shape of his
problem, the flowchart encourages him to think about execution of the program inside the computer.
Another, more positive, lesson is that program structures should be based on data structures. There are
deeply underlying reasons why this is so, and I depict them in the above shown diagram.
The problem environment is the real world, or that part of it which affects and is affected by the computer
system. The computer system we have to implement sees the world through the medium of its data
structures. The tasks to be performed must make sense in the real world. The program we are trying to build
consists essentially of operations to be executed by the computer. Some of these operations are concerned
with finding our way around the data structures: eg. Reading or writing records. Other operations are more
directly concerned with task to be performed, eg. “add price to invoice total”.
Each operation must appear somewhere in the program text, in some program component. To make an
intelligible and correct program we must ensure that for each operation there is an appropriate component in
which it may appear.
In general, both types of operation, those concerned with finding our way around the data structures and
those more directly concerned with the task to be performed, can be associated with components of the
underlying data structures. If, therefore, we give our program the same structure as the data it processes we
can expect that we will have no difficulty.
These ideas are the basics of the design techniques discussed in this sessions.

31
(3)
A general Program Design Strategy

Individual steps required in creating a program:

• Design and draw the input data (file) and output data (file) structures, they may be
physically or logically oriented.
• Identify the correspondences between the input data structures and the output
structures. If additional program internal data needed, define those data (structures).
• Merge the input data structures and output data structures on the points of
correspondence to produce the basic process structure diagram.
• Add additional process boxes (Start- / End- processes etc.) to form the final process
structure diagram.
• Allocate conditions to the selections and iterations that exist on the basic process
structure diagram.
• Analyze elementary operations and allocate them to appropriate parts of the final
process structure diagram.
• Generate the schematic logic (Pseudo Code) from the final process structure diagram.
• Translate the schematic logic into the desired computer programming language.

Date: 03.10.2009 Program Design & Development Page: 32

The individual steps required in designing and creating a program are shown in the above foil.

32
(4)
A general Program Design Strategy

The main goal for “Program Design” is:


• Find best solution for a given problem:
• Data Structures may prepare Systems for Modularization:
Data How we see the
Structured
Structure structure in a
Modules/Code
Source code:

Create “single entry/single exit”


procedures in a program…
0 o

Date: 03.10.2009 Program Design & Development Page: 33

The main goal for “Program Design” is:


• Find best solution for a given problem:
• Data Structures may prepare Systems for Modularization.

The starting point may be to define logical data structures, identifying relationships; than construct a module
/ code structure.
We list the executable operations needed to carry out the task, and allocate each operation to a component of
the program structure, here we are using “Pseudo Code” to do this step.

There are, of course, further steps in the design process, but these three are the first and most important: the
quality of the work we do as we take these steps will determine the quality of the program we write!

At least we hope to get:


• A clear hierarchical structure of the given problem,
• Makes the solution easier to understand,
• Helps you to find bugs - clarifying the structure exposes bugs,
• Helps you to program faster for future maintenance tasks - as a result from the previous points.

33
Agenda

1. Introduction

2. Some Examples/Exercises
• Task 1: Stores Movement Summary
• Task 2: Stores Movement Summary – Maintenance (Homework)
• Task 3: Collating or Matching Problem
• Task 4: Inventory Update – Collating Problem (Homework)
• Task 5: Telegram Analysis – Boundary Clash (Homework)

3. Conclusion
“My experiences also strongly
confirmed my previous opinion
that the best theory is inspired by
practice and the best practice is
inspired by theory.“
Donald E. Knuth,”Theory and Practice”, Theoretical
Computer Science,1991.

Date: 03.10.2009 Program Design & Development Page: 34

Now let me enter into the main part of my session: Examples and exercises.

34
(1)
Task 1: Stores Movement Summary

A) Stores Movements Summary. (see Notes too)

Record Layout: Stores Movement Record


1 2 3 4 8
1234567890123456789012345678901234567890….0
MRtppppppppppyymmddhhmm nnnnnnnn
| || | | +-------- quantity, numeric, right bound
| || | +------------- time hh – hour, mm – minute, numeric
| || +------------------- date yy – year, mm – month, dd – day, numeric
| |+----------------------------- part number, alpha-numeric, left bound
| +------------------------------ Movement Type: I = issue, R = Receipt
+-------------------------------- Record-ID: MR – Movement Record, fixed

Examples:
MRIA5/13672 0802020822 120
MRIA5/13672 0802101430 310
MRIA5/13672 0803121500 50
MRRA5/13672 0803121610 100
MRRA5/17924 0802030915 10000
MRIA5/17924 0802051030 333
MRIB31/82 0802021150 55
etc.

Date: 03.10.2009 Program Design & Development Page: 35

This example is a small part of an IBM programming seminar in the early ’70…

Task: Stores Movements Summary.


The stores section in a factory (XYZ-Factory) issues and receives parts. Each issue and each receipt is recorded on a file-
record (layout – see above). The record contains a record-ID, the part-number, the movement-type (I for ISSUE, R for
RECEIPT), the data/time (format yymmdd for date and hhmm for time) the movement was done, and the quantity. The
records are sorted into ascending order 1) part-number, 2) date/time.
The program to be written will produce a simple summary of the net movements for each part. The report should look like
shown on next foil.

35
(2)
Task 1: Stores Movement Summary

A) Stores Movements Summary. (see Notes too)

Report Layout: Stores Movement Summary

--- Stores Movement Summary – Page: ppppp


Report: SMS – XYZ FACTORY
Part-Nr. Net Movements
_________________________________________
ppppppppp nnnnnnnn
| +-------------- quantity, numeric, +,-
+------------------------------- part number, alpha-numeric

Examples:
A5/13672 -380
A5/17924 667
B31/82 -55
etc.

Date: 03.10.2009 Program Design & Development Page: 36

The report has header-lines including the Report-ID, the Report-name, the Factory-Name, a page number, the report
columns names, and a separation line (layout – see above).

36
(3)
Task 1: Stores Movement Summary

B) Solution
• Step 1.1: Physical Structures.

Input SMF-Store Output


SMS Report
Movements

SM-Store * Page *
Movement Records

Date: 03.10.2009 Program Design & Development Page: 37

A first look at the “specification” I can define a physical data structure for input and output.
Do not stop the data design at this point and do not start with a program design at this point.
We first have to look at the data structures in more detail and than we have to analyze the task to be
performed.

37
(4)
Task 1: Stores Movement Summary

B) Solution
• Step 1.2: Logical Data Structures.

Input / SMF-Store Transfer Output


SMS Report
Process Movements

SGNETM Internal presentation

Group - Part *
Net Movements Page *
___________________
Part_Number
Stores_Movement_Summary
SM

SM-Store *
Movement Records Header Line * Print Line *
PCB

Print Control Block


________________________

ISSUE Record 0 Receipt Record o
SFSMS Print Line

External presentation Print Module


Main Module

Date: 03.10.2009 Program Design & Development Page: 38

Here I ‘ll show how you can get a better solution regarding a logical data structure reflecting the given task..

First of all we take a look at needed data structures:


- Input: SM Store Movements
Notes: - not all elements are physically available,
- the shown data structure is a logical data structure as defined by the
problem definition!
- additional temporary data are shown to transfer data to the final
requested report (Transfer: internal and external presentation).
- Output: The logical data structure to produce the requested report is shown.

- Looking at the tasks we have to perform we can define additional program internal data. The needed internal data flow
can now defined. The relationships between data elements can be shown.

38
(5)
Task 1: Stores Movement Summary

B) Solution
Step 1.2: Logical Data Structures. Boundary clash !

Input / SMF-Store Transfer Output


SMS Report
Process Movements

SGNETM Internal presentation

Group - Part *
Net Movements Page *
___________________
Part_Number
Stores_Movement_Summary
SM
SM-Store *
Movement Records Header Line * Print Line *
PCB

Print Control Block


________________________

ISSUE Record 0 Receipt Record o
SFSMS Print Line
relationship

External presentation Print Module


Main Module

Date: 03.10.2009 Program Design & Development Page: 39

Relationship:
Between both data structures there is only one relationship: the data of a group part which are printed in a report line.

Structure Clash:
A structure clash between the input and output data structures occurs if the rules of correspondence are broken. This typical
cause of structure clash is the requirement for the output to be grouped into sections that are not the same size as the pages
of the report. This is known as a boundary clash, because the boundaries of the pages do not coincide with the boundaries
of groups in which the data occur.

The Output structure cannot combined into the Input/Process structure!

-Now you can define a (modular) program structure for both data structures.
-Solutions: (The program structures fits best following the data structures!)
-1) You can define two procedures, which may run in parallel. Following programming language features are needed: Sub-
tasking, wait/post elements.
-2) The data structure/program structure (Input) as shown above on the left site will be defined a the main procedure, the
printing task will be implemented as a sub-procedure (some compromises are necessary to design and to write such a sub-
routine. Here I’m using a general defined print service routine.

39
(6)
Task 1: Stores Movement Summary

B) Solution Architectural Design / Interface Design


• Step 2.1: Design Program Structure.

SMS -Main SMF-Store Note:


Movements

Group Net-
-The hierarchical program
movements structure fits best when it
Group - Part * follows the data structures !
SM-Record
Processing

Issue-Record SM-Store *
Processing Movement Records

Receipt Record
Processing

ISSUE Record 0 Receipt Record o

Date: 03.10.2009 Program Design & Development Page: 40

Because we made the decision to use the logical SMF data structure as the basic to build the program structure, we can
build a hierarchical module / code structure. The elements of the report structure are separate into simpler compounds and
added to the program structure as shown in the next foil.

40
(7)
Task 1: Stores Movement Summary

B) Solution Architectural Design / Interface Design


• Step 2.2: Design Program Structure.
PCB Initial Routine
Declaration
Print Control Block
________________________
SMS -Main …
SMS Report
Print Line


Group Net-
movements
Page *

SM-Record
Processing

Issue-Record
Processing Header Line * Print Line *

Receipt Record
Processing

EPRINT

Termination Routine

Date: 03.10.2009 Program Design & Development Page: 41

We design a data control element PCB, which holds all elements needed to produce the SMS report.
The declaration and the code elements to initialize and to terminate the report are moved over to the main module.
The interface between both data structures is one print line.
We now can design a subroutine, which two main components: 1) controlling and printing header lines and 2) printing a
prepared line. Additional this routine has to support eg. Page count, ASA control character etc.

41
(8)
Task 1: Stores Movement Summary

B) Solution . Step 3.1: Design Program (Main Program). Procedural Design:


Usage: SM, SGNETM, PCB; Files: FSM, FSMS. Pseudo Code
*H1.1 Initial routine.*
ON Endfile FSM: Mark EOF Condition.
OPEN File FSM input, File FSMS output.
*H2 Process File FSM.* Used Data:
Get first SM record.
*H3 Process all groups of Netmovements.* SM: see SM record layout,
DOWHILE not EOF FSM.
*H3.1 Process one group of Netmovements.* SGNETM: internal presentation
*H3.1.1 Group Netmovement processing.* - PartNumber
Save current SM: Partnumber to SGNETM: Partnumber. - Summary
Clear SGNETM: Summary.
*H4 Process SM records for one Netmovement group.* SFSMS: Print Line – external presentation
DOWHILE not EOF FSM & (SM: Partnumber = SGNETM: Partnumber). - ASA * ASA Control Character
*H4.1 Process one SM record.* - PartNumber * Part Number
SELECT SMF: Record_Type. - Filler
*H4.1.1 ISSUE Record.* - NetSummary * Net Summary/Part
WHEN I: Subtract SM: Quantity from SGNETM: Summary. - Filler
*H4.1.2 RECEIPT Record.*
WHEN R: Add SM: Quantity to SGNETM: Summary. PCB: see PGM EPRINT
ENDSELECT.
Get next SM Record.
ENDWHILE.
*H3.1.2 Group Netmovements Processing (Edit & Print routine).*
Prepare Print Line {SGNETM: Partnumber, Summary}.
CALL EPRINT{Print File FSMS,PCB Print Control Block}.
ENDWHILE.
*H1.2 Termination Routine.*
Close all Files {FSM, FSMS}.

Date: 03.10.2009 Program Design & Development Page: 42

After designing the program structure we now can add needed operations to the program components.
The pseudo code in the above and next foil shows the result to this design step.

42
(9)
Task 1: Stores Movement Summary

B) Solution . Step 3.2: Design Program EPRINT. Procedural Design:


Pseudo Code
Usage: PCB; Files: FSMS.
*H1 Check for early Page Change.*
IF SL: XASA = '1'
THEN {Clear PCB: MLNO; Change SL: XASA to ‘ ‘.} Used Data:

*H2 Check for printing Header Lines.* PCB: Print Control Block
IF PCB: MLNO – Number {SL: XASA} <= 0 -…
THEN - MLCNT * Number of max. lines/page
*H2.1 Set Current Date into Header.* - MLNO * Residuary printable no. of lines
{Check and set Date into Header Line.} - MPNO * Current page number
*H2.2 Print Header Lines.* - MHNO * Number of Header lines
Initialize PCB: MLNO by PCB: MLCNT. - YPL * PrintLine
{Count PCB: MPNO by 1; Edit Page Number. - YHL(*) * Header Lines
DO for all Header Lines [PCB: MHNO].
Write Header Line to FSMS. SL: Print Line based on YPL
IF SL: XASA = ‘1’ - XASA * ASA Cpntrol Character
THEN Subtract PCB: MLNO by 1. - XLINE * Remaining Print Line
ELSE Subtract PCB: MLNO by Number {SL: XASA}.
ENDIF.
ENDDO.
ENDIF.

*H3 Write Print Line.*


Write Print Line PCB: YPL to FSMS.
Subtract PCB: MLNO by Number {SL: XASA}.
Initiate Print Line PCB: YPL.
PGM:

Date: 03.10.2009 Program Design & Development Page: 43

The two main components of the subroutine EPRINT can now be designed. The result is shown in the above foil.

Note: If you can define such subroutines as a “Standard” in your installation, they must not documented each time you can
use this subroutine. Build a library, where you document such standard routines. Further usages only need to have a
reference to this library.

43
(10)
Task 1: Stores Movement Summary

C) Review:

• Study and Analyze given Solution,


• Make a Code Review – search for possible pitfalls,
• Answer following Questions:
• What happens when the value of NNETS rise above the limit?
See Structure SFSMS: NNETS PIC'SSSSSSSSS9',/* NET SUMMARY PER PART */
e.g. > +2147483647; does the sign-character matter?

• Does it made sense to define Layouts in separate members?


e.g. %INCLUDE SYSSRC(V3DPCB01); /* PRINT CONTROL BLOCK */

• Does the sequence of predicates matters?


DO WHILE(¬BFSMEOF & (SSM.XPARTNO=SGNETM.XPARTNO)); equal to
DO WHILE((SSM.XPARTNO=SGNETM.XPARTNO) & ¬BFSMEOF ); (remember the EOF condition – what happens with the SSM
data?

• What happens if the SM record type is not I or R?


See H4.1.3

• Why is function EADDR1 written?

• Regarding of reading SM records I’m using a method called “read ahead”. Why?

PGM:

Date: 03.10.2009 Program Design & Development Page: 44

See above.

44
Agenda

1. Introduction

2. Some Examples/Exercises
• Task 1: Stores Movement Summary
• Task 2: Stores Movement Summary – Maintenance
(Homework)
• Task 3: Collating or Matching Problem
• Task 4: Inventory Update – Collating Problem (Homework)
• Task 5: Telegram Analysis – Boundary Clash (Homework)

3. Conclusion

Date: 03.10.2009 Program Design & Development Page: 45

45
(1)
Task 2: Stores Movement Summary- Maintenance

A) Stores Movements Summary. (see Notes too)

Record Layout: Stores Movement Record


1 2 3 4 8
1234567890123456789012345678901234567890….0
MRtppppppppppyyyymmddhhmm nnnnnnnn
| || | | +------ quantity, numeric, right bound
| || | +----------- time hh – hour, mm – minute, numeric
| || +------------------- date yyyy – century/year, mm–month, dd–day, numeric
| |+----------------------------- part number, alpha-numeric, left bound
| +------------------------------ Movement Type: I = issue, R = Receipt
+-------------------------------- Record-ID: MR – Movement Record, fixed

Examples:
MRIA5/13672 200802020822 120
MRIA5/13672 200802101430 310
MRIA5/13672 200803121500 50
MRRA5/13672 200803121610 100
MRRA5/17924 200802030915 10000 Note: Century added to date/time!
MRIA5/17924 200802051030 333
- Layout of PartNumber: see nexct foil!
MRIB31/82 200802021150 55
etc.

Date: 03.10.2009 Program Design & Development Page: 46

Now we like to simulate a typical maintanance task:

Task: Stores Movements Summary.


The stores section in a factory (XYZ-Factory) issues and receives parts. Each issue and each receipt is recorded on a file-
record (layout – see above). The record contains a record-ID, the part-number, the movement-type (I for ISSUE, R for
RECEIPT), the data/time (format yyyymmdd for date and hhmm for time) the movement was done, and the quantity. The
records are sorted into ascending order 1) part-number, 2) date/time.
The program to be written will produce a simple summary of the net movements for each PartNumber and Assemby
Number. The report should look like shown on next foil.

To get a “more stable” program, each input record needs to check for possible errors. Check all fields for formal errors!
- Records with failures should be printed into a separate report and should not go into the SMS report process.

46
(2)
Task 2: Stores Movement Summary - Maintenance

A) Stores Movements Summary. (see Notes too)


Notes:

Report Layout: Stores Movement Summary -Summary values of Receipts and Issues
are added to the report;
--- Stores Movement Summary Page: 1
-A summary line of a assembly (first part
Report: SMS XYZ FACTORY Date: 04.10.09
of the PartNumber) is added;
Part_Number Receipts Issues Net_Summary
_______________________________________________________ -Assembies are separated by a blank line.
A5/13672 100 480 -380
A5/17924 10000 333 +9667 -Specification of the PartNumber:
A5/820 0 55 -55
LAaa/NNNnnnn
A5 10100 868 +9232 | |+--- 2nd. Part: 3 to max. 7
| | numeric digits,
A6/13672 100 480 -380 | +---- slash-sign
A6/17924 10000 333 +9667 +---------- 1st. Part: Assembly
Number, must start with a
A6 10100 813 +9287
letter followed by 1 to max. 3
alphanumeric character
A61/821 0 55 -55 (A…Z,ÄÖÜ,0…9)
A61 0 55 -55 PartNumber: max. length: 10 character;
left boundary.
etc.

Date: 03.10.2009 Program Design & Development Page: 47

The report has header-lines including the Report-ID, the Report-name, the Factory-Name, a page number,a date which
represents the date the report was produced, the report columns names, and a separation line (layout – see above).

Additional a summary line for the assembly (first part of the PartNumber) is requested as shown in the report layout.

47
(3)
Task 2: Stores Movement Summary - Maintenance

A) Stores Movements Summary. (see Notes too)

Message Report Layout: Stores Movement Summary (Example)


--- Store Movements Report --- Messages --- PAGE: 1
MSG_No 1***5****10***5****20***5****30***5****40***5****50***5****60**5****70***5****80 Date: 04.10.09
ISMS01 V3PSMSV3 Started.

ISMS02 SMIG41/82 200802021150 55 **in error,see below.


FSMS03 PART NUMBER G41/82 has an erroneous specification. See PGM description.

ISMS02 SMRI6-13673 200802311010 1OO **in error,see below.


FSMS03 PART NUMBER I6-13673 has an erroneous specification. See PGM description.
FSMS04 Date 20080231 is wrong. Needed Format: YYYYMMDD or value is false.
FSMS05 Quantity 1OO has not a positive numeric value.

ISMS02 SMRI6/17924 200802051030 --333 **in error,see below.


FSMS05 Quantity --333 has not a positive numeric value.

ISMS02 MBII9/17924 200802030915 10000 **in error,see below.


FSMS01 Record_ID MB is not SM as inspected.

ISMS02 SMBI9/17924 200802030915 10000 **in error,see below.


FSMS02 Record_Type B is wrong. Allowed are I or R.

etc.
ISMS01 V3PSMSV3 ended.

Note: Description see Notes!

Date: 03.10.2009 Program Design & Development Page: 48

The “Stores Movement Summary” Message Report should look as shown in the foil.

As described before, each input record should be checked for possible errors. If error(s) are detected, they should be shown
in the Message Report; but before a message is written, you should print the record.

Notes:
-Each Message Line starts with a MSG-NO:
- Layout: tSMSnn Message text
|| +---- message number
| +-------- PGM ID; here: SMS
+--------- MSG Type:
I -> Informational message, Return Code: -
W-> Warning message, Return Code: 4
F-> Failure message, Return Code: 8
E-> Emergency error message, Return Code: 12
T-> Termination Message, Return Code: 16
- The highest Return code should bet given back to the Job-Control.

48
(4)
Task 2: Stores Movement Summary - Maintenance

B) Home Work:

• Design all Data Structures,

• Find Data References,

• Define a Module / Program Structure

• Write Pseudo Code for each Module / Program

• Create some Test Data

• Write the Programs (PL/I)

• Test the Programs (only an initial Test is claimed!)

Date: 03.10.2009 Program Design & Development Page: 49

I’m very interest to look at your design and coding results…

49
(5)
Task 2: Stores Movement Summary - Maintenance

C) Solution
• Step 1.1: Physical Structures.

Input SMF-Store Output


SMS Report
Movements

SM-Store * Page *
Movement Records

Output
MSG Report

Page *

Date: 03.10.2009 Program Design & Development Page: 50

Here and in the following foils you can study and compare your solution with my thinking.

50
(6)
Task 2: Stores Movement Summary - Maintenance

C) Solution
• Step 1.2: Logical Data Structures – Part 1.
SCB – Group Control Block Start/ Transfer
Stop MSG
(Proved) FSM-

2
Store Movements Output
Input / SANETM Internal presentation SMS Report
Process
Group - Assembly Assembly_Number
Receipts
Number * Issues
Stores_Movement_Summary
Group – Part Page *
SGNETM Internal presentation
Number *
Part_Number
Receipts
SM Issues
EGETSM Stores_Movement_Summary
Proved SM-Store *
1

Movement Records Header Line * Print Line *


PCB

Print Control Block


________________________

ISSUE Record 0 Receipt Record o
SFSMS Print Line

Main Program External presentation Print Module


Main Module

Date: 03.10.2009 Program Design & Development Page: 51

Here I ‘ll show a logical data structure reflecting the given task.

First of all we take a look at needed data structures:


- Input: SM Store Movements
Notes: - not all elements are physically available,
- the shown data structure is a logical data structure as defined by the
problem definition!
- additional temporary data are shown to transfer data to the final
requested report (Transfer: internal and external presentation).
- Output: The logical data structure to produce the requested report is shown.

51
(7)
Task 2: Stores Movement Summary - Maintenance

C) Solution
• Step 1.3: Logical Data Structures – Part 2.
SCB – Group Control Block
Input / FSM-Store ESMOK
Process Movements Output
SM Missing MSG Report
Information!

FSM Record *

Page *

Proved SM-Store o FSM Record o


Movement Record in error

Header Line * Print Line *


1

MCB
FSM Record Error MSG *
MSG Control Block
________________________

SLINE Print Line


2

Subprogram EGETSM External presentation Print Module


Main Module

Date: 03.10.2009 Program Design & Development Page: 52

Here I ‘ll show the similar task, but now for the MSG report: a logical data structure reflecting the given task..

- Input: SM Store Movements


Notes: - not all elements are physically available,
- the shown data structure is a logical data structure as defined by the
problem definition!
- additional temporary data are shown to transfer data to the final
requested report MSG (Transfer: internal and external presentation).
- Output: The logical data structure to produce the requested report is shown.

52
(8)
Task 2: Stores Movement Summary - Maintenance

C) Solution Architectural Design / Interface Design


• Step 2.1: Design Program Structure – Main Program.

SMS -Main Input /


(Proved) FSM-
Process
EGETSM - Get first Store Movements
proved SM record

Group - Assembly
Assembly Net- Number *
movements
Group – Part
Group Net-
movements Number *
SM-Record
Processing
Receipt Record EGETSM
Proved SM-Store *
Processing
Movement Records
Issue-Record
Processing

EGETSM - Get next


proved SM record
ISSUE Record 0 Receipt Record o

Date: 03.10.2009 Program Design & Development Page: 53

We design a data control element PCB and MCB, which holds all elements needed to produce the SMS report or MSG
report.
The declaration and the code elements to initialize and to terminate the report are moved over to the main module.
The interface between the data structures is one print or message line.
We now can reuse the subroutine EPRINT as design in an earlier task , and we can design a message subroutine with two
main components: 1) controlling and printing header lines and 2) printing a prepared line. Additional this routine has to
support eg. Page count, ASA control character, interpret the message type and save the highest return code etc.

We made an additional decision: We define a subroutine EGETSM to get the next proved SM record. We are not interested
to get SM records into the main program logic which are erroneous.

53
(9)
Task 2: Stores Movement Summary - Maintenance

C) Solution Architectural Design / Interface Design


• Step 2.3: Design Program Structure – Main Program.
Declaration PCB
Initial Routine
Print Control Block FSMS
SMS -Main
Output
________________________
EGETSM - Get first …
proved SM record SMS Report
Print Line


Assembly Net-
movements
Page *
Group Net-
movements

SM-Record
Processing
Receipt Record
Processing Header Line * Print Line *
Issue-Record
Processing

EGETSM - Get next


proved SM record

EPRINT
Termination Routine
EPRINT

Date: 03.10.2009 Program Design & Development Page: 54

This foil and the next foil shows the logical data structures to produce the SMS
report and the MSG report.

54
(10)
Task 2: Stores Movement Summary - Maintenance

C) Solution Architectural Design / Interface Design


• Step 2.4: Design Program Structure – Main Program.
Declaration MCB
Initial Routine
MSG Control Block FMSG
SMS -Main
Output
________________________
EGETSM - Get first …
proved SM record MSG Report
Print Line


Assembly Net-
movements
Page *
Group Net-
movements

SM-Record
Processing
Receipt Record
Processing Header Line * Print Line *
Issue-Record
Processing

EGETSM - Get next


proved SM record
Termination Routine
EPRINT

EPRINT

Date: 03.10.2009 Program Design & Development Page: 55

55
(11)
Task 2: Stores Movement Summary - Maintenance

C) Solution Architectural Design / Interface Design


• Step 2.5: Design Program Structure - EGETSM.
MCB
Output MSG Report
SCB MSG Control Block
EGETSM Print Line Page *

Header Line * Print Line *


SM-Record
Processing

ESMOK Function Input /


Process

Proved SM Record
FSM-Store
Movements
FSM R. in Error SM
FSM Record
*
FSM Record

Error MSGS EMSG Proved SM o FSM Record o


Record in error
EVERIFY Function
1

FSM Record Error MSG *

Date: 03.10.2009 Program Design & Development Page: 56

During analyzing which operations are needed to design the EGETSM subroutine
we can find that in component “SM Record processing” we have no direct
information to make a decision to step to the part “proved SM record” or to step
to the part “FSM record in error”.
To get this information we make the decision to design a function ESMOK. If
this function finds one error, we know what we have to do.
Looking at the operations which are needed to detect errors, we find, that we
don’t have a programming element to detect an error regarding PartNumber and
Quantity. We need to add an additional function EVERIFY.

56
(12)
Task 2: Stores Movement Summary - Maintenance

D) Solution . Step 3.1: Design Program (Main Program). Procedural Design:


Usage: SCB, SM, SAGNETM, SGNETM, PCB, MSG, YASA; Files: FSM, FSMS, FMSG. Pseudo Code
*H1.1 Initial routine.*
OPEN File FSM input, File FSMS, FMSG output. -A-
Print Start MSG [EMSG]. *H6 Process proved SM Records for one Group PartNumber.
*H2 Process File FSM.* DOWHILE SCB: Partnumber = SGNETM: Partnumber.
*H3 Process all Groups of Assemblies and Parts.* *H6.1 Process one SM record.*
Get first proved SM Record [EGETSM]. SELECT SSM: Record_Type.
DOWHILE not (SCB: YASSNO=HIGH) *more to do* *H6.1.1 ISSUE Record.*
*H4 Process one Group of Assembly.* WHEN I: Add SM: Quantity to SGNETM: Issue.
*H4.1 Group Assembly Processing – Initial Routine.* *H6.1.2 RECEIPT Record.*
Save current SCB: AssemblyNumber to SANETM: AssemblyNumber. WHEN R: Add SM: Quantity to SGNETM: Receipts.
Clear SANETM: Receipts,Issues. ENDSELECT.
DOWHILE SCB: AssemblyNumber = SANETM: AssemblyNumber. Get next proved SM Record [EGETSM].
*H5 Process one Group of Parts.* ENDWHILE.
*H5.1 Group Part Netmovements – Initial Routine.*
Used Data:
Save currrent SCB: PartNumber to SGNETM: PartNumber.
Clear SGNETM: Receipts, Issues.
-A-
*H5.2 Group PartNumber Netmovements Processing (Edit & Print Routine).* SCB: see SCB layout,
SGNETM: Summary = SGNETM: Receipts – SGNETM: Issues. SM: see SM record layout,
Prepare Print Line {YASA, SGNETM: Partnumber, Receipts, Issues, Summary}. SANETM: internal presentation
CALL EPRINT {Print File FSMS,PCB Print Control Block}. - AssemblyNumber
Add SGNETM: Receipts & ISSUES to SAGNETM: Receipts & Issues. - Receipts
Set YASA to ‘ ‘. - Issues
ENDWHILE. - Summary
*H4.2 Group Assembly Processing (Edit & Print Routine).* SGNETM: internal presentation
SANETM: Summary = SANETM: Receipts – SANETM: ISSUES. - PartNumber
Prepare Print Line {YASA, SANETM: AssemblyNumber, Receipts, Issues, Summary}. - Receipts
CALL EPRINT (Print File FSMS,PCB Print Control Block}. - Issues
Set YASA to ‘0’. - Summary
ENDWHILE. SFSMS: Print Line – external presentation
*H1.2 Termination Routine.* - ASA * ASA Control Character
Print Termination MSG [EMSG]. - PartNumber * Part Number
Close all Files {FSM, FSMS}. - Filler
Set final Return Code. - NetSummary * Net Summary/Part
- Filler
SLINE: MSG Line – external presentation
see PGM EMSG
Date: 03.10.2009 Program Design & Development PCB: see PGM EPRINT Page: 57
MCB: see PGM EMSG

Here and in the next foils we can add needed operations to the program / code
structure. Pseudo Code is used to finish this design step.

57
(13)
Task 2: Stores Movement Summary - Maintenance

D) Solution . Step 3.2: Design Program (EGETSM). Procedural Design:


Pseudo Code

Usage: SCB, SSM, MCB; Files: FSM, FMSG.


*HG1 Initial routine.*
ON ENDFILE FSM { Set SCB: AssemblyNumber & PartNumber to HIGH.; RETURN } Used Data:
Get next FSM record.
DOWHILE not ESMOK. *Precheck for FSM errors * SCB: see SCB layout,
*HG2.0 Prepare MSG message and print FSM record [EMSG]. SM: see SSM record layout,
*HG3.1 Check Record-ID.*
IF SSM: Record-ID not ‘SM’ SLINE: MSG Line – external presentation
THEN {Prepare and print error MSG [EMSG] }
ELSE see PGM EMSG
*HG3.2 Check Record-Type.*
IF SSM: Record-Type not = ‘I’ or ‘R’ MCB: see PGM EMSG
THWEN {Prepare and print error MSG [EMSG] }
ELSE
*HG3.3 Check PartNumber.*
IF not EVERIFY (SSM: PartNumber, Mask: ‘LAaa>/NNNnnnnBBBB’)
THEN {Prepare and print error MSG [EMSG] }
*HG3.4 Check Date.*
IF not VALIDDATE
THEN {Prepare and print error MSG [EMSG] }
*HG3.5 CHECK Quantity.*
IF not EVERIFY (SSM: Quantity, Mask: ‘bbbbbbbNNNNNNNN’)
THEN {Prepare and print error MSG [EMSG] }
ENDIF
ENDIF
*HG4 FSM Record is in error, get next FSM record.*
Get next FSM record.
ENDWHILE.
*HG5 SM Record is proved and ok.
Set SCB: PartNumber = SSM: PartNumber.
Set SCB: AssemblyNumber to first Part of SSM: PartNumber.
RETURN

Date: 03.10.2009 Program Design & Development Page: 58

58
(14)
Task 2: Stores Movement Summary - Maintenance

D) Solution . Step 3.3: Design Program (ESMOK). Procedural Design:


Pseudo Code

Usage: SSM; Files: FSM.


*HC1.1 Check Record-ID.*
IF SSM: Record-ID not ‘SM’
THEN RETURN FALSE. Used Data:
*HC1.2 Check Record-Type.*
IF SSM: Record-Type not = ‘I’ or ‘R’ SM: see SSM record layout,
THEN RETURN FALSE.
ELSE
*HC1.3 Check PartNumber.*
IF not EVERIFY (SSM: PartNumber, Mask: ‘LAaa>/NNNnnnnBBBB’)
THEN RETURN FALSE.
*HC1.4 Check Date.*
IF not VALIDDATE
THEN RETURN FALSE.
*HC1.5 CHECK Quantity.*
IF not EVERIFY (SSM: Quantity, Mask: ‘bbbbbbbbbNNNNNNNNNN’)
THEN RETURN FALSE.
ENDIF
ENDIF
*HC2 SM Record is ok.*
RETURN TRUE.

Date: 03.10.2009 Program Design & Development Page: 59

59
(15)
Task 2: Stores Movement Summary - Maintenance
D) Solution . Step 3.4: Design Program (EVERIFY).
Usage: Input: Value, Mask; Result: TRUE = ok., FALSE = in error
*H1 Initialization Routine.*
Get actual length of Value and Mask: [LIv,Lim].
IF LIv < 1 or Lim < 1
THEN {Set Result to FALSE; RETURN Result.}
{SET Iv and Im to 1; Pick up first character of Value and Mask: [Yv,Ym].}
{Set Result to TRUE. *We assume Value is ok.*; Set Bmoretodo to TRUE.
*H2 Step through value and mask.*
DOWHILE Bmoretodo.
*H2.1 Check current character of Value.* Procedural Design:
SELECT Ym. Pseudo Code
External Routine
*H2.1.1 Letter specification:*
WHEN ‘L’ IF Yv not in Letter THEN {Set Result to FALSE; Set Bmoretodo to FALSE.}
ELSE {Add 1 to Iv and Im.}
WHEN ‘l’ IF Yv not in Letter THEN {Add 1 to Im.} Used Data:
ELSE {Add 1 to Iv and Im.}
*H2.1.2 Alphanumeric specification.*
WHEN ‘A’ IF Yv not in alphanumeric THEN {Set Result to FALSE; Set Bmoretodo to FALSE.}
Value: max. 30 character,
THEN {Add 1 to Iv and Im.} Mask: max. 40 character.
WHEN ‘a’ IF Yv not in alphanumeric THEN {Add 1 to Im.}
ELSE {Add 1 to Iv and Im.} Letter: A…Z ÄÖÜ
*H2.1.3 Numeric spwcification.*
Alphanumeric: A…Z ÄÖÜ0…9
WHEN ‘N’ IF Yv not in numeric THEN {Set Result to FALSE; Set Bmoretodo to FALSE.}
ELSE {Add 1 to Iv and Im.} Numeric: 0…9
WHEN ‘n’ IF Yn not in numeric THEN {add 1 to Im.} Xspecial: any EBCDIC charcter
ELSE {Add 1 to Iv and Im.}
*H2.1.4 Special character.*
WHEN ‘>’ IF Im > Lim THEN {Set Result to FALSE; Set Bmoretodo to FALSE;}
ELSE {Pick up Xspecial from [Mask(Im+1]; IF Xspecial = Yv THEN {Add 1 to Iv; Add 2 to Im.}
ELSE {Set Result to FALSE; Set Bmoretodo to FALSE;}
*H2.1.5 Blank specification.*
WHEN ‘B’ IF Yv = ‘ ‘ THEN {Add 1 to Iv and Im.}
ELSE {Set Result to FALSE; Set Bmoretodo to FALSE.
WHEN ‘b’ IF Yv = ‘ ‘ THEN {Add 1 to IV and Im.}
ELSE {Add 1 to Im.}
*H2.1.6 Invalid Mask specification.*
OTHERWISE {Set Result to FALSE; Set Bmoretodo to FALSE.}
ENDSELECT.
*H2.2 Check for next process action.*
IF Iv > LIv THEN {Set Bmoretodo to FALSE.}
ELSE {Pickup next character of Value [Value(Iv)]}
IF Im > Lim THEN IF Iv <= LIv THEN {Set Result to FALSE; Set Bmoretodo to FALSE.}
ELSE {Set Bmoretodo to FALSE.}
ELSE {Pickup next character of Mask [Mask(Im)].}
ENDWHILE.
*H3 Termination Routine.*
RETURN Result.
Date: 03.10.2009 Program Design & Development Page: 60

Note: The function is driven by a given mask specification.

60
(16)
Task 2: Stores Movement Summary - Maintenance

D) Solution . Step 3.5: Design Test Program for EVERIFY. Procedural Design:
Pseudo Code

Used Data:
Usage: EVERIFY: Input: Value, Mask; Result: TRUE = ok., FALSE = in error
Value: max. 30 character,
*H1.1 Initialization Routine.* Mask: max. 40 character.
ON ENDFILE SYSIN Set Bmoretodo to FASLE.
Set Bmoretodo to TRUE.
Print Start MSG to file SYSPRINT.

*H2 Step thrpugh test runs.*


Get Value and Mask from file SYSIN.
DOWHILE Bmoretodo. ETMASK1
*H2.1 Test one value by a given mask.*
Bverify = EVERIFY(Value,Mask). EVERIFY Function
IF Bverify THEN Set Xresult to ‘ is OK.’.
ELSE Set Xresult to ‘ is in error.’.
*H2.2 Print result.*
Print Value, Mask and Xresult to file SYSPRINT.
*H2.3 Get next Test Case.*
Get Value and Mask from file SYSIN.
ENDWHILE.

*H1.2 Termination Routine.*


Print Termination MSG to file SYSPRINT.

PGM:

Date: 03.10.2009 Program Design & Development Page: 61

- This example is a typical method for a “bottom up” design and coding.

61
(17)
Task 2: Stores Movement Summary - Maintenance

E) Review: Function EVERIFY

• Study and Analyze given Solution,


• Make a Code Review – search for possible pitfalls,
• Answer following Questions:
• Does it made sense to made a difference between problems related to Value
respectively Mask? Make some suggestions to change the design/ coding into this
direction.

• Any other points you like to discuss?

• Expand this function to allow checking signed numeric values: eg. -3.55 or + 10.20

Date: 03.10.2009 Program Design & Development Page: 62

62
(18)
Task 2: Stores Movement Summary - Maintenance

E) Review: Solution Task 2

• Study and Analyze given Solution (design and coding),


• Make a Code Review – search for possible pitfalls,
• Compare and discuss your solution with the given solution:
• Why are external and internal procedures used?

• Why and for what is EGETSM designed and coded?

• Why is function ESMOK designed and coded? Is this function dependent to other
code parts?

• Explain the usage of Control Block SCB.

• At which time should data be checked?

• What happens with FSM records in error? Discuss what’s needed…

• Any other points you like to discuss?

PGM:

Date: 03.10.2009 Program Design & Development Page: 63

63
Agenda

1. Introduction

2. Some Examples/Exercises
• Task 1: Stores Movement Summary
• Task 2: Stores Movement Summary – Maintenance (Homework)
• Task 3: Collating or Matching Problem
• Task 4: Inventory Update – Collating Problem (Homework)
• Task 5: Telegram Analysis – Boundary Clash (Homework)

3. Conclusion

Date: 03.10.2009 Program Design & Development Page: 64

64
(1)
Task 3: Collating or Matching Problem

A) Task 3: V01 Requirements

FIA

PGM
Merging or
Comparison FOUT

FIB
Multiple Input Data Streams:
• logical independent or
• logical dependent.

Date: 03.10.2009 Program Design & Development Page: 65

Merging or Comparison:
In the commercial data processing this has to be led together from several files to one single file. Reasons may be bring
information up to date or to combine data. Depending on a way of the treatment of the input records we can discuss two
different type of processing systematically: The Merging and Comparison. The essential difference consists that when
merging all input records are left in their original form and only the order of their expense will be defined, against
comparison new output records can be created or can be deleted.
Multiple Input Data Streams:
In the case of multiple input data streams, it must be cleared at the design stage, whether these data streams can "logically
independently" of each other be processed - that is after each other- or whether they are "logically dependent" therefore a
common processing is required.

65
Task 3: Collating or Matching Problem (2)

A) Task 3: V01 Requirements

Example 1: Merging of two datasets Example see: JSP, Klaus Kilberth, page 108…110

File FIA: 4, 5, 6, 7, 9
File FIB: 1, 2, 3, 4, 7, 8 Both files are in ascending order!

The records of FIA and FIB are written into file FOUT in the following groups:
• If records have the same key, the record of file FIA has to be written first to the output file.

File FIA: 4, 5, 6, 7, 9 Input


File FIB: 1, 2, 3, 4, 7, 8

File FOUT: 1, 2, 3; 4; 4; 5, 6, 7; 7, 8; 9 Output

Date: 03.10.2009 Program Design & Development Page: 66

Merging:
Multiple input data streams are merged into an output data stream. Each input
record is written to the output data stream. The sequence of records is defined by
processing a processing rule. No record is lost. The number of output records is
equal to the sum of numbers of the input records. The records in the output file
are in ascending order.

66
Task 3: Collating or Matching Problem (3)

B) Task 3: V01 Logical Data structures

Example 1: Merging of two datasets

Input File FIA Output File FOUT Input File FIB

FIA-File FOUT-File FIB-File

Group O *

Group IA * Group IA - Group IB - Group IB *

Record IA * Record IA * Record IB * Record IB *

Note: - means occurrence 0 to 1

Date: 03.10.2009 Program Design & Development Page: 67

As shown in the previous foil we can define a sequence component for each
group of a sequence of IA records and IB records. At the first and at the last O
group the body of group IA or group IB may be empty. The input/output data
structures are expanded by a level representing a key group.
The references between data elements are shown.

67
Task 3: Collating or Matching Problem (4)

C) Task 3: V01 Design Program Structure Used Data:

Example 1: Merging of two datasets Files: Rec. IA, Rec. IB


Internal: SCB
- Key IA ON ENDFILE:
Set Key value to
- Key IB
Logical data structures HIGH
Merge FIA,FIB to FOUT
SCB
(1)
Process Group O *
FIA-File FOUT-File FIB-File

Process Group IA - (2)

Group O *
Process Rec. IA *

(3)
Process Group IB -
Group IA * Group IA - Group IB - Group IB *
Process Rec. IB *

Record IA * Record IA * Record IB * Record IB *

Note: - means occurrence 0 to 1

Conditions:
(1): ¬ (Key IA||Key IB = HIGH)
(2): ¬ (Key IA||Key IB = HIGH) & Key IA <= Key IB
(3): ¬ (Key IA||Key IB = HIGH) & KEY IB < Key IA

Date: 03.10.2009 Program Design & Development Page: 68

The control of the processing is dependent of the keys of records IA and IB. The
current keys are saved into the SCB control block.
Now the program structure can be easily defined as shown in the above foil.
Note: The conditions concerning the component control can be established
already at this time.

68
Task 3: Collating or Matching Problem (5)
Used Data:
D) Task 3: V01 Design Pseudo Code
Files: FIA, ON ENDFILE:
Set SCB Key value
FIB, to HIGH
Example 1: Merging of two datasets FOUT
Records: SIA
- XKEY
Usage: Input: Files FIA,FIB; Output: FOUT; - XTEXT
Record Layouts: SIA, SIB; Control block: XCB respectively SCB SIB
*H1.1 Initialization Routine.* - XKEY
{OPEN File FIA, FIB INPUT; File FOUT OUTPUT.} - XTEXT
*H2 Merge File FIA, FIB to File FOUT.* Internal: SCB or XCB
*H3 Process group O,* - XKEYIA
{CALL EGETIA; CALL EGETIB.} EGETIA: - XKEYIB
DOWHILE XCB not HIGH. *HG1 Initiation Routine.*
*H4.1 Process one group IA.*
ON ENDFILE FIA
DOWHILE (XCB not HIGH) & SCB.XKEYIA <= SCB.XKEYIB.
{Set SCB.XKEYIA to HIGH; RETURN.}
*H4.1.1 Process record IA.*
*HG2 Read and prepare record for processing.*
Write SIA to file FOUT.
{Read a record from FIA;
CALL EGETIA.
Set SCB.XKEYIA to SIA.KEY.}
ENDWHILE.
RETURN.
*H4.2 Process one group IB.*
DOWHILE (XCB not HIGH) & SCB.XKEYIB <= SCB.XKEYIA.
EGETIB:
*H4.2.1 Process record IB.*
*HG1 Initiation Routine.*
Write SIB to file FOUT.
ON ENDFILE FIB
CALL EGETIB.
{Set SCB.XKEYIB to HIGH; RETURN.}
ENDWHILE.
*HG2 Read and prepare record for processing.*
ENDWHILE.
{Read a record from FIB;
*H1.2 Termination Routine.*
Set SCB.XKEYIB to SIB.KEY.}
Close all Files.
RETURN.
PGM:

Date: 03.10.2009 Program Design & Development Page: 69

Now we can design the program control elements and the needed operations.

69
Task 3: Collating or Matching Problem (6)

D) Task 3: V01 Collating or Matching Problem

• Study and Analyze given Solution,


• Make a Code Review,
• Questions:
• Any points you like to discuss?

Date: 03.10.2009 Program Design & Development Page: 70

70
(1)
Task 3: Collating or Matching Problem

A) Task 3: V02 Requirements

FIA
PGM
Merging or
Comparison FOUT

FIB
Multiple Input Data Streams:
• logical independent or
• logical dependent.

Date: 03.10.2009 Program Design & Development Page: 71

Merging or Comparison:
In the commercial data processing this has to be led together from several files to one single file. Reasons may be bring
information up to date or to combine data. Depending on a way of the treatment of the input records we can discuss two
different type of processing systematically: The Merging and Comparison. The essential difference consists that when
merging all input records are left in their original form and only the order of their expense will be defined, against
comparison new output records can be created or can be deleted.
Multiple Input Data Streams:
In the case of multiple input data streams, it must be cleared at the design stage, whether these data streams can "logically
independently" of each other be processed - that is after each other- or whether they are "logically dependent" therefore a
common processing is required.

71
Task 3: Collating or Matching Problem (2)

A) Task 3: V02 Requirements

Example 1: Merging of two datasets

File FIA: 4, 5, 6, 7, 9
File FIB: 1, 2, 3, 4, 7, 8 Both files are in ascending order!

The records of FIA and FIB are written into file FOUT in the following groups:
• If records have the same key, the record of file FIA has to be written first to the output file.

Date: 03.10.2009 Program Design & Development Page: 72

Merging:
Multiple input data streams are merged into an output data stream. Each input
record is written to the output data stream. The sequence of records is defined by
processing a processing rule. No record is lost. The number of output records is
equal to the sum of numbers of the input records. The records in the output file
are in ascending order.

72
Task 3: Collating or Matching Problem (3)

B) Task 3: V02 Logical Data structures

Example 1: Merging of two datasets

Input File FIA Output File FOUT Input File FIB

FIA-File FOUT-File FIB-File

Group O *

Record IA * Record IA Record IB Record IB *

Date: 03.10.2009 Program Design & Development Page: 73

As shown in the previous foil we can define a sequence component for each
group of a sequence of IA records and IB records. At the first and at the last O
group the body of group IA or group IB may be empty. The input/output data
structures are expanded by a level representing a key group.
The references between data elements are shown.

73
Task 3: Collating or Matching Problem (4)
Used Data:
C) Task 3: V02 Design Program Structure
Files: FIA, FIB, GOUT
Rec. SIA
Example 1: Merging of two datasets - XKEY, ON ENDFILE:
Set SCB Key value
- KTEXT to HIGH
SIB
Logical data structures - XKEY
Merge IA,IB to O
- XTEXT
SCB Internal: SCB
(1) - XKEYIA
Process Group O *
FIA-File FOUT-File FIB-File - XKEYIB
(2)
Process Rec. IA

Group O *

(3)
Process Rec. IB
Record IA * Record IA Record IB Record IB *

Conditions:
(1): ¬ (Key IA||Key IB = HIGH)
(2): Key IA <= Key IB
(3): else condition

Date: 03.10.2009 Program Design & Development Page: 74

The control of the processing is dependent of the keys of records IA and IB. The
current keys are saved into the SCB control block.
Now the program structure can be easily defined as shown in the above foil.
Note: The conditions concerning the component control can be established
already at this time.

74
Task 3: Collating or Matching Problem (5)
Used Data:
D) Task 3: V02 Design Pseudo Code
Files: FIA, ON ENDFILE:
Set Key value to
FIB, HIGH
Example 1: Merging of two datasets FOUT
Records: SIA
- XKEY
Usage: Input: Files FIA,FIB; Output: FOUT; - XTEXT
Record Layouts: SIA, SIB; Control block: XCB respectively SCB SIB
*H1.1 Initialization Routine.* - XKEY
{OPEN File FIA, FIB INPUT; File FOUT OUTPUT.} - XTEXT
*H2 Merge File FIA, FIB to File FOUT.* Internal: SCB or XCB
*H3 Process group O,* - XKEYIA
{CALL EGETIA; CALL EGETIB.} EGETIA: - XKEYIB
DOWHILE XCB not HIGH. *HG1 Initiation Routine.*
*H4.1 Process one input record SIA or SIB.*
ON ENDFILE FIA
IF SCB.XKEYIA <= SCB.XKEYIB
{Set SCB.XKEYIA to HIGH; RETURN.}
THEN {
*HG2 Read and prepare record for processing.*
*H4.1.1 Process record IA.*
{Read a record from FIA;
Write SIA to file FOUT.
Set SCB.XKEYIA to SIA.KEY.}
CALL EGETIA.
RETURN.
}
ELSE {
EGETIB:
*H4.2.1 Process record IB.*
*HG1 Initiation Routine.*
Write SIB to file FOUT.
ON ENDFILE FIB
CALL EGETIB.
{Set SCB.XKEYIB to HIGH; RETURN.}
}
*HG2 Read and prepare record for processing.*
ENDWHILE.
{Read a record from FIB;
*H1.2 Termination Routine.*
Set SCB.XKEYIB to SIB.KEY.}
Close all Files.
RETURN.
Make it as simple as possible! PGM:

Date: 03.10.2009 Program Design & Development Page: 75

Now we can design the program control elements and the needed operations.

75
Agenda

1. Introduction

2. Some Examples/Exercises
• Task 1: Stores Movement Summary
• Task 2: Stores Movement Summary – Maintenance (Homework)
• Task 3: Collating or Matching Problem
• Task 4: Inventory Update – Collating Problem (Homework)
• Task 5: Telegram Analysis – Boundary Clash (Homework)

3. Conclusion

Date: 03.10.2009 Program Design & Development Page: 76

76
(1)
Task 4: Inventory Update - Collating Problem

A) Task 4: V01 Requirements

Inventory

FINV Inventory - New


PGM
Update
Inventory FOINV
Stores Movements

FMSG Report
FSM
Multiple Input Data Streams:
• logical dependent.

Date: 03.10.2009 Program Design & Development Page: 77

Inventory Update – Collating Problem:


In the above exercise we have multiple input data streams: A “Inventory File” and a “Stores Movement File”. The
Inventory File needs to be updated by the records in the Stores Movement File. A new Inventory File needs to be written.
The program should write a Report, which contains Informational messages, error messages and a statistic about the
number of records processed.
Multiple Input Data Streams:
In the case of multiple input data streams, it must be cleared at the design stage, whether these data streams can "logically
independently" of each other be processed - that is after each other- or whether they are "logically dependent" therefore a
common processing is required.
In the above case the input files are logically dependent.

77
(2)
Task 4: Inventory Update - Collating Problem

A) Inventory. (see Notes too)

Record Layout: Inventory Record


1 2 3 4 5 6… 8
123456789012345678901234567890123456789012345678901234567890… 0
IV ppppppppppxxxxxxxxxxxxxxxxxxxxx nnnnnnnn
| | | +------ on hand - quantity, numeric, right bound
| | +------------------- description
| +----------------------------- part number, alpha-numeric, left bound
+-------------------------------- Record-ID: IV – Inventory, fixed

Examples:
IV A5/13571 Bolt x1/2 555
IV A5/13572 Bolt x20/3d 1200
IV A5/13672 Gear c1 30700
IV A5/13673 Gear c2 224
IV A6/17924 Generator T51 55
IV A6/17925 Generator T651 123
IV B31/823 Wheel x2/3 10005
IV B31/950 Motor T6 5555
IV CA522/2005Nut x2 99500
etc.

Date: 03.10.2009 Program Design & Development Page: 78

The layout of the Inventory File FIV is shown.


Note: For this exercise we assume, that the records are formal correct.

78
(3)
Task 4: Inventory Update - Collating Problem

A) Stores Movements. (see Notes too)

Record Layout: Stores Movement Record


1 2 3 4 8
1234567890123456789012345678901234567890….0
MRtppppppppppyyyymmddhhmm nnnnnnnn
| || | | +------ quantity, numeric, right bound
| || | +----------- time hh – hour, mm – minute, numeric
| || +------------------- date yyyy – century/year, mm–month, dd–day, numeric
| |+----------------------------- part number, alpha-numeric, left bound
| +------------------------------ Movement Type: I = issue, R = Receipt
+-------------------------------- Record-ID: MR – Movement Record, fixed

Examples:
SMIA5/13672 200802020822 120
SMIA5/13672 200802101430 310
SMIA5/13672 200803121500 50
SMRA5/13672 200803121610 100
SMRA5/17924 200802030915 10
SMIA5/17924 200802051030 66
SMIA6/17952 200802051035 2
SMIA6/17952 200802051040 3
SMIB31/82 200802021150 55
SMIB31/823 200802021155 10
SMIB31/823 200802021410 15
etc.
Date: 03.10.2009 Program Design & Development Page: 79

The layout of the Inventory File FSM is shown. Multiple records may be there for a Part Number.
Note: For this exercise we assume, that the records are formal correct.

79
(4)
Task 4: Inventory Update - Collating Problem

A) Inventory Message Report. (see Notes too)

Example:

--- Inventory Update --- Messages --- Page: 1


MSG_No 1***5****10***5****20***5****30***5****40***5****50***5****60**5****… Date: 15.10.09
ISMS01 V3PINVV1 Started.
WSMS02 PartNo: A5/17924 has neg. value: -1
FSMS03 PartNo: A6/17952 from FSM file has no associated Inventory record:
ISMS03 SMIA6/17952 200802051035 2
ISMS03 SMIA6/17952 200802051040 3
FSMS03 PartNo: B31/82 from FSM file has no associated Inventory record:
ISMS03 SMIB31/82 200802021150 55

ISMS02 Statistics:
ISMS02 No. IV records read: 9
ISMS02 No. SM records read: 11
ISMS02 No. SM records not processed: 3
ISMS02 No. IV records written: 9
ISMS02 No. IV records updated: 3
ISMS01 V3PINVV1 ended.

Date: 03.10.2009 Program Design & Development Page: 80

The layout of the Message Report File FMSG is shown. :


The report should look something like shown in the above foil.

80
(5)
Task 4: Inventory Update – Collating Problem

B) Home Work:

• Design all Data Structures,

• Find Data References,

• Define a Module / Program Structure

• Write Pseudo Code for each Module / Program

• Create some Test Data

• Write the Programs (PL/I)

• Test the Programs (only an initial Test is claimed!)

Date: 03.10.2009 Program Design & Development Page: 81

I’m very interest to look at your design and coding results…

81
(6)
Task 4: Inventory Update – Collating Problem

C) Solution: Logical Data Structures (1)


Input Input Output

FSM-Store
FIV Inventory FOIV Inventory
Movements

matched group 0 Unmatched group o


SM SM

IV Record * SM Record * SM Record * IV Record *

unmatched 0 matched o SM Issue 0 SM Receipt o


IV Record IV Record Record Record

Note: FMSG Data Structure not shown;


Standard Implementation used.

Date: 03.10.2009 Program Design & Development Page: 82

The logical data structures of both input data sets and the logical data structure of
the output data set is shown.

82
(7)
Task 4: Inventory Update – Collating Problem

C) Solution: Logical Data Structures (2)


Input IV Update Input Output
SCB STAT
FIV
IV Update
FSM-Store FOIV
Inventory Movements Inventory

Conditions:
(1): PartNo IV < PartNo SM
(2): PartNo IV = PartNo SM IV Group *
FMSG
(3): PartNo SM < PartNo IV

(1) (2) (3)


matched Unmatched
Unmatched matched group Unmatched
group SM 0 group SM o
group IV o IV/SM 0 group SM o

IV Record *
unmatched SM Record * SM Record *
IV Record SM Record * IV Record *

unmatched 0 matched o
IV Record IV Record

SM Issue 0 SM Receipt o
Record REcord
matched SM Record *
IV Record

SM Issue 0 SM Receipt o Note: - FMSG Data


Record REcord
Structure not shown;
- Standard
Implementation used.

Date: 03.10.2009 Program Design & Development Page: 83

Starting from the two input data sets, I now design the data structure (IV Update)
as seen by the IV Update program. The relationships between input and output
data elements are shown.
At this design point you can define conditions to control groups. Additional you
can design program internal control structures like SCB and STAT.
Note: Data structures for the message report are not shown again. A standard as
shown in earlier tasks will be used; so we do not repeat the design steps for this
part.

83
(8)
Task 4: Inventory Update – Collating Problem

Used Data:
D) Solution: Program Design
SCB STAT Files: FIV, FSM, FOIV, FMSG
Rec. SIV
FMSG ON ENDFILE:
IV Update IV Update IV Update - XPartNo,
Set SCB Key
-… value to
(1)
SSM HIGH
IV Group * - XPartNo,
IV Group * -…
Unmatched Grp IV o (2)
Internal: SCB
unmatched Rec. IV - XPartNo IV XCB
- XPartNo SM
(5)
Unmatched
- YPartNo SM
Unmatched matched group
group IV o IV/SM 0 group SM o (3)
matched Grp IV/SM o
STAT
matched IV Rec, - No. IV records read,
unmatched - No. SM records read,
IV Record SM Record *
SM Rec. * (5) - No. SM records not processed,
- No. IV records written,
SM Issue. o
- No. IV records updated.

matched SM Record * …
IV Record
SM Receipt. o

Unmatched Grp SM o (4)


Conditions:
SM Issue 0 SM Receipt o (1): XCB not HIGH
Record REcord
unmatched Rec. SM * (5) (2): XPartNo IV < XPartNo SM
(3): XPartNo IV = XPartNo SM
(4): XPartNo SM < XPartNo IV
(5): YPartNo SM = XPartNo SM

EMSG

Date: 03.10.2009 Program Design & Development Page: 84

The IV Update data structure is the basic to define the program control structure.
Additional you can complete design elements for the used data and you can
complete conditions to control program elements.

84
(9)
Task 4: Inventory Update – Collating Problem

D) Solution: Program Design -A-


*H4.0 Process SM records for one SM group.*
Save SCB.XPartNo SM to SCB.YPartNo SM.
Usage: Input: Files FIV,FSM; Output: FOIV, FMSG; DOWHILE SCB.YPartNo SM = SCB.XPartNo SM.
Record Layouts: SIV, SSM; *H4.1 Process one SM Record.*
Control Block: XCB respectively SCB, STAT SELECT SSM.XRTYPE.
WHEN ‘I’
*H1.1 Initialization Routine.* *H4.1.1 Issue Record.*
{OPEN File FIV, FSM INPUT; File FOIV, FMSG OUTPUT.} Subtract SSM.NQTY from SIV.NQTY.
Write Start message to FMSG. WHEN ‘R’
*H2 Process IV Update group.* *H4.1.2 Receipt Record.*
{CALL EGETIV, CALL EGETSM.} *Get first input records.* Add SSM.NQTY to SIV.NQTY.
DOWHILE XCB not HIGH. ENDSELECT.
*H3 Process one IV Update group.* CALL EGETSM.
SELECT. ENDWHILE.
WHEN SCB.XPartNo IV < SCB.XPartNo SM *H4.2 Process and terminate SM group.*
*H3.1 Unmatched IV record.* IF SIV.NQTY < 0 {Write warning msg to FMSG.}
{Count FOIV record, Write SIV to FOIV, CALL EGETIV.} Count FOIV and IVupdated record.
WHEN SCB.XPartNo IV = SCB.XPartNo SM Write SIV to FOIV.
*H3.2 Matched IV,SM records.* CALL EGETIV.
-A-
WHEN SCB.XpartNo Sm < SCB.XPartNo IV -B-
*H3.3 Unmatched SM group.* *H5 Process SM records for one SM group.*
-B- Save SCB.XPartNo SM to SCB.YPartNo SM,
ENDSELECT. Print error MSG –no associated IV record-,
ENDWHILE. DOWHILE SCB.YPartNo SM = SCB.XPartNo SM.
*H1.2 Termination Routine.* *H5.1 Process one SM record in error.*
Write complete Statistic to FMSG. Print SM record to FMSG.
Write End message to FMSG. Count not processed record.
Close all Files. CALL EGETSM.
Set Return Code. ENDWHILE. PGM:

Date: 03.10.2009 Program Design & Development Page: 85

In this and the following foil I show the “Pseudo Code” to complete the initial
design phase.

85
(10)
Task 4: Inventory Update – Collating Problem

D) Solution: Program Design

EGETIV:
*HG1 Initialization routine.*
ON ENDFILE FIV
{Set SCB.XPartNo IV to HIGH, RETURN.}
*HG2 Read and prepare next IV record.*
Read SIV record from FIV.
Save SIV.XPartNo to SCB.XPartNo IV.
Count IV record.
RETRUN.

EGETSM:
*HG1 Initialization routine.*
ON ENDFILE FSM
{Set SCB.XPartNo SM to HIGH, RETURN.}
*HG2 Read and prepare next SM record.*
Read SSM record from FSM.
Save SSM.XPartNo to SCB.XPartNo SM.
Count SM record.
RETRUN.

Date: 03.10.2009 Program Design & Development Page: 86

You can find the program code, test data, and test results through clicking the
PGM hyperlink on the above foil.

86
(11)
Task 4: Inventory Update – Collating Problem

E) Review: Solution Task 4

• Study and Analyze given Solution (design and coding),


• Make a Code Review – search for possible pitfalls,
• Compare and discuss your solution with the given solution:
• Explain the usage of Control Block SCB.

• Any other points you like to discuss?

PGM:

Date: 03.10.2009 Program Design & Development Page: 87

-Note: see given pseudo code and/or program code.

87
Agenda

1. Introduction

2. Some Examples/Exercises
• Task 1: Stores Movement Summary
• Task 2: Stores Movement Summary – Maintenance (Homework)
• Task 3: Collating or Matching Problem
• Task 4: Inventory Update – Collating Problem (Homework)
• Task 5: Telegram Analysis – Boundary Clash (Homework)

3. Conclusion

Date: 03.10.2009 Program Design & Development Page: 88

88
(1)
Task 5: Telegram Analysis

A) Task 5: Requirements

Telegram Report
PGM
Telegram FPRINT
FTELE Analysis

Specifications:
A program is required to process a stream of telegrams. This stream is available
as a sequence of letters and/or digits and blanks on a file FTELE. The file contains fixed
length records (80 bytes). The words in the telegram is delimited by the word ZZZZ.
The stream is terminated by the occurrence of the empty telegram that is a telegram
with no words. Each telegram is to be processed to determine the number of chargeable
words and to check for occurrences of over-length words. The words ZZZZ and STOP are
not chargeable and words of more than 12 letters are considered over-length. The
result of the processing is to be a neat listing of the telegrams each accompanied
by the word count and a message indicating the occurrence of over-length words.

Date: 03.10.2009 Program Design & Development Page: 89

Here I like to discuss another example of a “boundary clash.


The problem was suggested by a paper on structured programming (“An Experiment in Structured Programming”, P.
Henderson and R. Snowdon, BIT 12 (1972), pp 38-53).

The basic specification is shown in the foil.

89
(2)
Task 5: Telegram Analysis

A) Task 5: Input (Example)


Telegram Report
PGM
Telegram FPRINT
FTELE Analysis

FTELE:
Habe Informationen gefunden STOP
Die Erste Donau-Dampfschiffahrts-Gesellschaft (oft auch Donaudampfschiffahrtsges
ellschaft, kurz DDSG) ist eine österreichische Schifffahrtsgesellschaft zur
Beschiffung der Donau und ihrer Nebenflüsse STOP In den 1990er Jahren wurde die
Gesellschaft aufgeteilt und privatisiert STOP ZZZZ
Ihre Nachfolgegesellschaften sind die DDSG Blue Danube im
Passagierbereich und die DDSG Cargo im Frachttransportbereich STOP
Letztere wurde 2007 weiterverkauft und wieder in Erste
Donau-Dampfschiffahrts-Gesellschaft rück-umbenannt STOP
Die Zentrale befindet sich am Wiener Handelskai 265 ZZZZ Der Flottenstand der DD
SG umfasste zu dieser Zeit über 200 Dampfschiffe und ca. 1.000 Güterkähne STOP
Weiter verfügte die DDSG über eigene Schiffswerften sowie ein
Kohlebergwerk bei Fünfkirchen und mehrere Niederlassungen an der Donau
STOP Auf den Schiffen der DDSG wurden damals auch Postsendungen mit eigenen Brie
fmarken befördert STOP ZZZZ ZZZZ

Date: 03.10.2009 Program Design & Development Page: 90

A possible contents of the file FTELE is shown.

90
(3)
Task 5: Telegram Analysis

A) Task 5: Report

Telegram Report
PGM
Telegram FPRINT
FTELE Analysis

Report: (Example)
TELEGRAM ANALYSIS
TELEGRAM 1
32 WORDS OF WHICH 5 OVERSIZE
TELEGRAM 2
33 WORDS OF WHICH 6 OVERSIZE
TELEGRAM 3
46 WORDS OF WHICH 4 OVERSIZE
END TELEGRAM ANALYSIS

Date: 03.10.2009 Program Design & Development Page: 91

- The "STOP" word is dealt with as a special word, i.e., it is not counted as a
chargeable word. Same is true for “ZZZZ”.
- An oversized word is counted.
-The telegram number is the serial number of the telegram in the telegram
sequence.
- Output starts with a heading message, and ends with termination message as
shown in the foil.

91
(4)
Task 5: Telegram Analysis

C) Task 5: Data Structures

Input Subtask EP1 Subtask EP1 Output


process
process
SCA
-EWORD (1)
FTELE EP1 -EREPORT EP2 FREPORT
-XWORD (1)
Note: record not

Tel. Body
seen by EP1

(1)
Stream I/O

String * Null ZZZZ Report Report


Real Telegram
Record * Heading Ending
Telegram *
Tel. Body
(2) (3) Telegram
ZZZZ *
Word *
Character * Spaces 0 Word o Telegram
R.*
(2)
Space * Character * Word 0
STOP 0
Line 1 Line 2

(3)
Over sized - STAT
-NO
Conditions: Conditions: -NWORD
(1) ¬EOF (1) XWORD ¬= 'ZZZZ‘ -NOOSIZE
(2) ¬EOF & XCHAR = ' ' (2) XWORD = 'STOP'
(3) ¬BEOF & XCHAR ¬= ' ' (3) LENGTH(XWORD) > 12

Date: 03.10.2009 Program Design & Development Page: 92

We can separate the task into two steps (subtasks):


- Get a telegram word from the input file FTELE and put the word into an internal control structure SCA (Communication
Area),
-Interpret Telegram words as described in the specification and produce the Telegram Report FREPORT.
- The data structures as seen by both components are shown.
-The relationships between data elements are analyzed and documented.
-Additionally we can define conditions to control tasks.

-Note: Using a “stream I/O” technique we don’t see records. They are hidden to the program. We can define the FTELE
file as a sequence of characters.

92
(5)
Task 5: Telegram Analysis

B) Task 5: Program Structure – Subtask EP1

Input Subtask EP1


process
SCA
-EWORD
FTELE EP1 * -EREPORT
EP1 FTELE processing
-XWORD
Note: record not

Process FTELE *
seen by EP1
Stream I/O

String
Record *
Process String

Skip over spaces


Character * Spaces 0 Word o

Space * Character *
Get a Word

Date: 03.10.2009 Program Design & Development Page: 93

Looking at the first part we can define a program structure for this subtask.
Note: The communication area needs two control elements to communicate with the other subtask.

93
(6)
Task 5: Telegram Analysis

C) Task 5: Program Structure – Subtask EP2


Subtask EP1 Output
process

SCA EP2 FREPORT


-EWORD
EP2 FREPORT processing
-EREPORT
-XWORD Report Heading
Tel. Body
Process Telegrams

Real Null ZZZZ Report Report


Telegram * Telegram Process Real Telegrams
Heading Ending

Tel. Body STOP Word


Telegram
ZZZZ * Word
Word *
Telegram R.
* Word over size

Print Telegram Infos


STOP 0 Word 0

Line 1 Line 2
Report Ending

Over sized -
STAT
-NO
-NWORD
-NOOSIZE

Date: 03.10.2009 Program Design & Development Page: 94

The program structure for the second subtask can now be designed.

94
(7)
Task 5: Telegram Analysis

D) Task 5: Pseudo Code EP1


Using Files: FTELE, Control Blocks: SCA
*H1.1 Initialization Routine .*
ON ENDFILE FTELE Set BEOF to TRUE.
*H2 Telegram Processing.*
Set EOF to FALSE.
OPEN file FTELE Input.
Get first character [XCHAR].
DOWHILE ¬EOF . * More character strings available.*
*H3 Process a string.*
IF XCHAR = ' '
{ *H3.1 Space processing.*
DOWHILE ¬EOF & XCHAR = ' ‘.
get next character [XCHAR].
ENDWHILE.
}
ELSE
{*H3.2 Word processing.*
Initialize XWORD.
DOWHILE ¬EOF & XCHAR ¬= ' ‘.
{Append XCHAR to XWORD, get next character [XCHAR].}
ENDWHILE.
POST EWORD.
WAIT EREPORT.
}
ENDWHILE.
*H1.2 Termination Routine.*
CLOSE File FTELE.

Date: 03.10.2009 Program Design & Development Page: 95

Now we can design the program logic for both subtasks EP1 and EP2 (see next foil).
Note: Both subtasks needs control elements to communicate with each other:
POST and WAIT:
POST means signal that I’m finished with my part of work, and
WAIT means I need to wait until the next element (here a telegram word XWORD) is ready for processing.

95
(8)
Task 5: Telegram Analysis

D) Task 5: Pseudo Code EP2 , ETELE – Main Program.


Using Files: FREPORT, Control Blocks: SCA, STAT

*H1.1 Initialization Routine.* -A-


OPEN File FREPORT Output. DOWHILE XWORD ¬= 'ZZZZ‘.
Set NO = 0. IF XWORD = 'STOP'
*H1.2 Report processing.* *H4.1 STOP Word.*
*H1.2.1 Process Report Heading.* {} *Ignore STOP word.*4
Print Report Heading. *H4.2 Count a Telegram Word.*
WAIT EWORD. ELSE
*H2 Process Telegrams.* {Count NWORD_COUNT.
DOWHILE XWORD ¬= 'ZZZZ‘. IF LENGTH(XWORD) > 12 THEN Count NOSIZE_COUNT.
*H3.1 Real Telegram Processing- Initialization.* }
Set NWORD_COUNT, NOSIZE_COUNT = 0. *H4.3 Telegram Word – Termination.*
-A- POST EREPORT.
*H3.2 Real Telegram Processing – Print a Telegram.* WAIT EWORD.
Count NO. ENDWHILE.
Print Line 1, Line2.
*H3.3 Real Telegram Processing – Termination.*
POST EREPORT.
ETELE: Main Program.
WAIT EWORD.
Using: Control Block: SCA.
ENDWHILE.
*H1.2 Process Report Termination.*
CALL EP2 EVENT E1. * FREPORT PROCESSING.*
POST EREPORT.
CALL EP1 EVENT E2. * FTELE PROCESSING.*
PRINT Report Ending.
WAIT E1,E2.
CLOSE File FREPORT.

PGM:

Date: 03.10.2009 Program Design & Development Page: 96

… follow up.

The Main program only needs to invoke both subtasks and has to wait until both subtasks are finished.

96
(9)
Task 5: Telegram Analysis

E) Task 5: Review, Discussion.

• Study and Analyze given Solution,


• Make a Code Review – search for possible pitfalls,
• Answer following Questions:

• How long can over-length words be?


• Which character set is used? Are special characters allowed (eg. Äöü etc.),
• Is a report required for the empty telegram?
• What error handling is to be provided?

• What is the meaning of delimit?


• What is the meaning of sequence eg. zero occurrences?
• Can words span blocks?
• What is an empty telegram?
• Are leading or subsequent spaces allowed in records?

• Any other points you like to discuss?

PGM:

Date: 03.10.2009 Program Design & Development Page: 97

- See above….

97
(10)
Task 5: Telegram Analysis V02

F) Task 5: Home Work.

Telegram Analysis

Specification: see V01

• Design a Solution without using multi-programming elements:

• Data structures,
• Program Structures,
• Pseudo Code,
• Program Code (PL/I),
• Basic Test.

Date: 03.10.2009 Program Design & Development Page: 98

I’m very interest to look at your design and coding results…

98
(11)
Task 5: Telegram Analysis V02

G) Task 5: Program Structure – Main Program , Part 1


ETELE2 Output
process
ETELE2 Telegram Processing
EP2 FREPORT
-XWORD Report Heading

Process Telegrams
Tel. Body
Report Report
Process Real Telegrams
Heading Ending
Real Null ZZZZ
Telegram * Telegram STOP Word
Tel. Body
Word

Telegram
ZZZZ * Word over size
Word * Telegram R.
* Print Telegram Infos

Report Ending
STOP 0 Word 0

Line 1 Line 2

Over sized -
STAT
-NO
-NWORD
-NOOSIZE

Date: 03.10.2009 Program Design & Development Page: 99

Looking at the data structures you can see, that the logical data structure to process a telegram is much more complex as
the logical data structure to build a telegram word.
That’s the reason I take the above data structures to define the main module. In the next step I need to integrate the
input/process data structures into the module hierarchy. See next foil.

99
(12)
Task 5: Telegram Analysis V02

G) Task 5: Program Structure – EGETWRD , Part 2

Input Subroutine EGETWRD


(1) ETELE2 Telegram Processing
process
Report Heading
FTELE EP1 * XWORD
Note: record not Process Telegrams

Process Real Telegrams


seen by EP1
Stream I/O

String
STOP Word
Record *
Word

Word over size

Character * Spaces 0 Word o


Print Telegram Infos

(2) Report Ending


Space * Character *

EGETWRD – Get a Telegram Word

Meaning: (1) Declarations, Initial and Termination Code is passed to ETELE2,


(2) Functional Parts “Spaces” and “Word” are done by EGETWRD.

Date: 03.10.2009 Program Design & Development Page: 100

Looking at the input/process data structures, you can see that we have 2 important elements:
- skip over spaces, and build a telegram word.
We can define a subroutine EGETWRD to process these two parts.
The other declaration parts and initial coding and termination coding parts to process the input file ETELE are moved over
to the initial part and termination part of the main module ETELE2.

100
(13)
Task 5: Telegram Analysis V02

H) Task 5: Pseudo Code -A-


DOWHILE XWORD ¬= 'ZZZZ‘.
ETELE2: IF XWORD = 'STOP'
*H4.1 STOP Word.*
{} *Ignore STOP word.*4
Using Files: FTELE,FREPORT, Data: XWORD,STAT
*H4.2 Count a Telegram Word.*
ELSE
*H1.1 Initialization Routine.*
{Count NWORD_COUNT.
OPEN File FTELE Input, FREPORT Output.
IF LENGTH(XWORD) > 12 THEN Count NOSIZE_COUNT.
Set NO = 0.
}
*H1.2 Report processing.*
*H4.3 Telegram Word – Termination.*
*H1.2.1 Process Report Heading.*
CALL EGETWRD.
Print Report Heading.
ENDWHILE.
CALL EGETWRD.
*H2 Process Telegrams.*
DOWHILE XWORD ¬= 'ZZZZ‘. EGETWRD:
*H3.1 Real Telegram Processing- Initialization.*
Set NWORD_COUNT, NOSIZE_COUNT = 0. Using Files: FTELE, Data: XWORD.
-A-
*H3.2 Real Telegram Processing – Print a Telegram.* Get a character [XCHAR].
Count NO. *H3.1 Space processing.*
Print Line 1, Line2. IF XCHAR = ' '
*H3.3 Real Telegram Processing – Termination.* DOWHILE ¬EOF & XCHAR = ' ‘.
CALL EGETWRD. get next character [XCHAR].
ENDWHILE. ENDWHILE.
*H1.2 Process Report Termination.* *H3.2 Word processing.*
PRINT Report Ending. Initialize XWORD.
CLOSE File FTELE, FREPORT. DOWHILE ¬EOF & XCHAR ¬= ' ‘.
{Append XCHAR to XWORD, get next character [XCHAR].}
ENDWHILE.
RETURN XWORD. PGM:

Date: 03.10.2009 Program Design & Development Page: 101

We can now define the program logic as shown in the above foil.

101
(14)
Task 5: Telegram Analysis V02

I) Task 5: Review, Discussion.

• Study and Analyze your solution with given Solution,


• Make a Code Review – search for possible pitfalls.
• Compare and discuss both given Solution.

• Questions:

• ???

• Any other points you like to discuss?

PGM:

Date: 03.10.2009 Program Design & Development Page: 102

102
Agenda

1. Introduction
• Review: Structured Programming / Pseudo Code
• Review: Modular Design
• Review: (H)IPO and Data Structures
• A general Program Design Strategy
2. Some Examples/Exercises

3. Conclusion
"Everybody is a genius. But if
you judge a fish by its ability to
climb a tree, it will spend its
whole life thinking its stupid."
Albert Einstein.

Date: 03.10.2009 Program Design & Development Page: 103

Let’s think about some findings.

103
Conclusion (1)

In this lecture, you have learned:

1. Why systems analysis is interesting;

2. Why systems analysis is more difficult than programming; and

3. Why it is important to be familiar with systems analysis.


What we cannot
expect:

“A simple design is an outline for a small software


component. It has the smallest number of features
that meet the requirements of the current phase. As
simple as possible, but not simpler.” Albert Einstein.

Date: 03.10.2009 Program Design & Development Page: 104

Without a doubt, it is more interesting than computer programming (not that programming is dull) because it
involves studying the interactions of people, and disparate groups of people, and computers and organizations.
As Tom DeMarco said in his delightful book, Structured Analysis and Systems Specification (DeMarco, 1978):
[systems] analysis is frustrating, full of complex interpersonal relationships, indefinite, and difficult. In a word,
it is fascinating. Once you’re hooked, the old easy pleasures of system building are never again enough to
satisfy you.

I hope you will be armed with a tremendous amount of technical information that will help you develop
accurate models of complex systems, and you will know the step-by-step techniques for carrying out a
systems analysis effort. But you will still need a great deal of real-world work to learn the people skills: how to
interview a variety of disparate users to understand the true essence of a system; how to present the results
of your systems analysis work so that everyone can see a credible estimate of the costs and benefits of
developing a new system; and how to distinguish problems from symptoms. As Barry Boehm pointed out in his
classic work, Software Engineering Economics (Boehm, 1981):
Each of us as individual software engineers has an opportunity to make a significant positive impact on
society, simply by becoming more sensitive to the long-range human relations implications of our work, and by
incorporating this sensitivity into our software designs and products.
It takes some practice to do this well, and to learn how to balance human relations concerns with
programming and quantitative economic concerns. The big thing to remember in doing so is to keep our
priorities straight between programming, budgetary, and human considerations.

104
Conclusion (2)

Program Design & Programming as a PROCESS:


“Of course! Why didn't
• A Revolution in Programming? I ever think of that?”
D.E. Knuth.

• Programming starts with a problem and ends with an


efficient solution..
• … what is more difficult: finding a solution or
refining it after a try and run solution?
• Programming is program development,
• Development goes in small steps,
• Programming goes stepwise,
• thus, programming means structuring,
• it may also mean: sub-structuring the objects,
• introducing “data structures”.

Date: 03.10.2009 Program Design & Development Page: 105

PROGRAMMING AS A PROCESS:
“Of course! Why didn't I ever think of that?” D.E. Knuth
A Revolution in Programming?
•Programming starts with a problem and ends with an efficient solution. 'To have an idea' frequently amounts
to finding a solution irrespective of how inefficient it is, and it is hard to say what is more difficult: finding a
solution or refining it.
•Programming is program development. Development goes in small steps: Programming goes stepwise.
Independent of the architecture of the storage-controlled machine, program development is refinement. Thus,
programming is done by stepwise refinement. Refinement may mean: sub-structuring the operations. It may
also mean: sub-structuring the objects, introducing 'data structures'. Frequently, it is done by joint refinement.
Thus, programming means structuring.

105
Conclusion (3)

Closing remarks:
• After this lecture you should know how to design and
structure a given programming task.
• The resulting data structures, program structures and
pseudo-code may a good starting point to write good proper
programs.

• The final result may be a starting point for further work,


• reviews,
• preparing testing tasks,
• performance optimization,
• maintenance tasks,
• other engineering tasks like documentation etc...

Date: 03.10.2009 Program Design & Development Page: 106

My main goal was to build structured program logic. I tried to achieve this goal by applying a language
independent method. Additionally I explained side effects to achieve our goal.
In the first part of my presentation I gave a short review about basic control elements of the structure
theorem.
In the part example/exercises I explain basic methods to structure a given task by defining data structures,
which results in program structures. Having a program structure you can define the program logic by using
pseudo code. This step is independent of any programming language.
Before starting coding, you may discuss and prove your findings with your clients. This part of software
engineering techniques is not part of the given lecture.
The final result may be a starting point for further work, preparing testing tasks, - performance optimization, -
maintenance tasks, - other engineering tasks like documentation etc...

106
Source

See:

Books:
• Aktas, A. Z., Structured Analysis and Design of Information Systems, Prentice-
Hall,Englewood Cliffs, NJ, 1987.
• DeMarco, T., Structured Analysis and System Specification, Prentice-Hall,
Englewood Cliffs, NJ, 1979.
• Martin, J. and McClure, C., Structured Techniques: The Basis for CASE, Prentice-
Hall, Englewood Cliffs, NJ, 1988.
• Yourdon, E. and Constantine, L. L., Structured Design. Fundamentals of a Discipline
of Computer Program and Systems Design, Prentice-Hall, Englewood Cliffs, NJ, 1979.
• Yourdon E., Modern Structured Analysis, Prentice-Hall, Englewood Cliffs, NJ,1989.
• Yourdon, E., Techniques of Program Structure and Design, Prentice-Hall,
Englewood Cliffs, NJ, 1989.
• Principles of Program Design, M.A. Jackson, Academic Press, 1975
• Einführung in die Methode des Jackson Structured Programming, Klaus Kilberth,
Vieweg 1988.
• JSP for practical program design, K.E. Dudman, Springer 1996.
• Tom DeMarco, Structured Analysis and Systems Specification. Englewood Cliffs,
N.J.: Prentice-Hall, 1979.

Date: 03.10.2009 Program Design & Development Page: 107

In all sessions I like to motivate you to study additional books and publications about Reverse
Engineering/Code Restructuring.

107
Discussion (1)

Now let’s start final discussion…


Software Engineering
Program Design &
Development
© 2009

“Computers are incredibly fast,


accurate, and stupid; humans
are incredibly slow, inaccurate
and brilliant; together they are
powerful beyond imagination.”
Albert Einstein.

Date: 03.10.2009 Program Design & Development Page: 108

Enjoy the following discussion!

108
Questions / Comments…
???
Questions, comments, further information?
Please feel free to e-mail me!
Dipl.Ing. Werner Hoffmann
EMAIL: pwhoffmann@t-online.de or
pwhoffmann@aol.com
Date: 03.10.2009 SE_PGM_Design_V2.ppt Page: 109

The time for this lecture is over. If you have additional questions or comments or
like to get further information please feel free to e mail me at pwhoffmann@t-
online.de or pwhoffmann@aol.com.

109
Now we can starting working…

Date: 03.10.2009 Program Design & Development Page: 110

… ??? …

110
The End…
Program Design & Development

I tha
n
your k you for
atten
tion
!

Date: 03.10.2009 Program Design & Development Page: 111

I hope this lecture was right for you! Thank you for your attention!

111
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

PGM: EPSMSV2 - Main program


File: V3PSMSV2.TXT
*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001009
*PROCESS AGGREGATE, OFFSET, CMPAT(V1); 00002004
*PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); 00003017
/*PPL-TITLE: STORES SUMMARY MOVEMENTS V02 */ 00010000
/********************************************************************/ 00020000
/* PRODUCE STORES MOVEMENTS SUMMARY REPORT */ 00030000
/* PUBLICATIONS: SEE PGM DESIGN V02 */ 00031000
/* */ 00033000
/* AUTHOR: DIPL.ING. WERNER HOFFMANN */ 00033100
/* DATE WRITTEN: 1907/03/05 */ 00033200
/* DATE CHANGED: 2009/08/28 */ 00033300
/* */ 00033400
/* PROCEDURE: MAIN */ 00033500
/* TASK: THIS PROGRAM PRODUCE A STORES SUMMARY REPORT. */ 00033911
/* REPORT-ID: SMS */ 00034011
/* STANDARD SUBROUTINES USED: */ 00034117
/* EPRINT - REPORT PROCEDURE, */ 00034217
/* USING PRINT CONTROL BLOCK V3DPCB01 */ 00034317
/* EADDR1 - GET NEW ADDRESS BY A GIVEN DISPLACEMENT */ 00034417
/* */ 00034517
/* FILES: */ 00034617
/* INPUT: FSM - STORES MOVEMENTS, RECORD LAYOUT SEE: SSM */ 00034718
/* OUTPUT: FSMS- REPORT STORES SUMMARY MOVEMENTS, */ 00034817
/* PRINT LINE LAYOUT: SEE SFSMS */ 00034917
/* NOTES: - */ 00035017
/* */ 00036017
/********************************************************************/ 00039000
EPSMSV2: 00040000
PROC OPTIONS(MAIN) REORDER; 00050000
00051000
/*** FILE FSM ---------------------------------------------------*/ 00052000
DCL FSM FILE RECORD INPUT /* */ 00060011
ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); 00070000
DCL BFSMEOF BIT(1) INIT('0'B);/* EOF IDENTIFIER */ 00080011
DCL PSM POINTER STATIC;/* POINTER TO MF RECORD */ 00081018
DCL 1 SSM BASED(PSM), /* MF RECORD LAYOUT */ 00090018
2 XRID CHAR(2), /* RECORD ID */ 00100000
2 XRTYPE CHAR(1), /* RECORD TYPE, I OR R */ 00101000
2 XPARTNO CHAR(10), /* PART NUMBER */ 00110000
2 NDATE PIC'999999', /* DATE YYMMDD */ 00120000
2 NTIME PIC'9999', /* TIME HHMM */ 00130000
2 X01 CHAR(1), /* FILLER */ 00131000
2 NQTY PIC'99999999', /* QUANTITY */ 00132006
2 X02 CHAR(48); /* FILLER */ 00133000
00133100
/*** FILE FSMS --------------------------------------------------*/ 00134000
DCL FSMS FILE RECORD OUTPUT/* */ 00135000
ENV(CONSECUTIVE RECSIZE(133)); 00136016
DCL PFSMS POINTER STATIC;/* POINTER TO PRINT LINE */ 00137000
DCL 1 SFSMS BASED(PFSMS), /* STORES MOVEMENT SUMMARY PRINTL.*/ 00138011
2 XASA CHAR(1), /* ASA CONTROL CHARACTER */ 00139000
2 XPARTNO CHAR(10), /* PART NUMBER */ 00139200
2 X01 CHAR(10), /* FILLER */ 00139300
2 NNETS PIC'SSSSSSSSS9',/* NET SUMMARY PER PART */ 00139406
2 X02 CHAR(100); /* FILLER */ 00139500
00139600
%INCLUDE SYSSRC(V3DPCB01); /* PRINT CONTROL BLOCK */ 00139703
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 1
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

00139800
/*** GROUP NET MOVEMENTS INFORMATIONS ---------------------------*/ 00139900
DCL 1 SGNETM STATIC, /* GROUP NET MOVEMENTS */ 00140100
2 XPARTNO CHAR(10), /* PART NUMBER */ 00140300
2 NNETS BIN FIXED(31); /* NET MOVEMENTS */ 00140406
00140500
/*** SUBROUTINES/FUNCTIONS/BUILTIN ------------------------------*/ 00140600
DCL EPRINT ENTRY(FILE,POINTER);/* PRINT PROCEDURE */ 00141000
DCL EADDR1 ENTRY(POINTER,BIN FIXED(31)) RETURNS(POINTER); 00141110
DCL ADDR BUILTIN; /* */ 00142001
00150000
/*H1.1 INITIAL ROUTINE --------------------------------------------*/ 00151000
ON ENDFILE(FSM) BFSMEOF = '1'B;/*SET EOF CONDITION */ 00152011
PFSMS = SPCB1.QPL; /*POINT TO PRINT LINE */ 00160015
OPEN FILE(FSM) INPUT; /*OPEN STORES MOVEMENT FILE */ 00160111
OPEN FILE(FSMS) OUTPUT; /*OPEN PRINT FILE */ 00160201
/*H2 PROCESS FILE FSM ===========================================*/ 00161218
/*H3 PROCESS ALL GROUPS OF NETMOVEMENTS =========================*/ 00161318
READ FILE(FSM) SET(PSM); /*GET FIRST FSM RECORD */ 00161418
DO WHILE(¬BFSMEOF); 00161511
/*H3.1 PROCESS ONE GROUP OF NETMOVEMENTS --------------------------*/ 00161618
/*H3.1. GROUP NETMOVEMENTS PROCESSING (INITIAL ROUTINE)-------------*/ 00161718
SGNETM.XPARTNO = SSM.XPARTNO; /*SAVE PART NUMBER */ 00161818
SGNETM.NNETS = 0; /* CLEAR NET MOVEMENTS SUMMARY */ 00161906
/*H4 PROCESS SM RECORDS FOR ONE NETMOVEMENT GROUP ==============*/ 00162018
DO WHILE(¬BFSMEOF & (SSM.XPARTNO=SGNETM.XPARTNO)); 00162118
/*H4.1 PROCESS ONE SM RECORD -------------------------------------*/ 00162218
SELECT(SSM.XRTYPE); 00162318
/*H4.1.1 ISSUE RECORD ---------------------------------------------*/ 00162418
WHEN('I') /* */ 00162501
SGNETM.NNETS = SGNETM.NNETS - SSM.NQTY; 00162618
/*H4.1.2 RECEIPT RECORD -------------------------------------------*/ 00162718
WHEN('R') /* */ 00162801
SGNETM.NNETS = SGNETM.NNETS + SSM.NQTY; 00162918
/*H4.1.3 NOT USED -------------------------------------------------*/ 00163017
OTHERWISE; 00163114
END; 00163201
READ FILE(FSM) SET(PSM);/*GET NEXT FSM RECORD */ 00163318
END; 00163401
/*H3.2 GROUP NETMOVEMENTS PROCESSING (EDIT AND PRINT ROUTINE)------*/ 00163501
SFSMS.XPARTNO = SGNETM.XPARTNO; /*PREPARE PRINT LINE */ 00163611
SFSMS.NNETS = SGNETM.NNETS; 00163711
CALL EPRINT(FSMS,PPCB1); /*PRINT GROUP SUMMARY LINE */ 00163801
END; 00163901
/*H1.2 TERMINATION ROUTINE ----------------------------------------*/ 00164001
CLOSE FILE(*); /*CLOSE ALL OPEN FILES */ 00164101
END EPSMSV2; 00165010

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 2
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

File: V3DPCB01.TXT
/*PPL-TITLE: Print Control Block V01 */ 00010016
/********************************************************************/ 00020000
/* Print Control Block PGM V3PSMSV2 */ 00030016
/********************************************************************/ 00040000
DCL PPCB1 POINTER INIT(ADDR(SPCB1));/*Pointer to PCB V01*/ 00050001
DCL 1 SPCB1 UNALIGNED, /* Print Control Block V01*/ 00060016
2 QSN POINTER /* Address of Page Number */ 00070016
INIT(EADDR1(ADDR(SPCB1.YHL(1)),38)), 00080010
2 QDT POINTER /* Address Edit-Date */ 00081016
INIT(EADDR1(ADDR(SPCB1.YHL(2)),35)), 00082010
2 QPL POINTER /* Address of Print Area */ 00090016
INIT(ADDR(SPCB1.YPL)), 00091007
2 MLCNT BIN FIXED(15) /* Number of max. Lines per Page */ 00100016
INIT(60), 00110000
2 MLNO BIN FIXED(15) /* Residuary printable No. of Lines*/ 00120016
INIT(0), 00130000
2 MPNO BIN FIXED(15) /* Current Page Number */ 00140016
INIT(0), 00150000
2 MHNO BIN FIXED(15) /* Number of Header Lines */ 00160016
INIT(4), 00170010
2 YPL CHAR(133) /* PrintLine -Communication Area -*/ 00180016
INIT((133)' '), 00190010
2 YHL(4) CHAR(133) INIT /* Header Lines */ 00200016
('1--- Stores Movement Summary Page: NNNNN 00210014
', 00220001
' Report: SMS XYZ FACTORY Date: DD.MM.YY 00221012
', 00222001
' PART_NUMBER NET_SUMMARY 00222112
', 00222210
' _________________________________________ 00223002
'); 00224001
00230000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 3
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

PGM: EPRINT – Subprogram


File: V3PEPRT.TXT
*PROCESS OPTIONS INSOURCE SOURCE NEST MACRO STORAGE; 00001003
*PROCESS AGGREGATE, OFFSET, CMPAT(V1); 00002004
*PROCESS OPT(2) TEST(ALL,SYM) ATTRIBUTES(FULL) XREF(SHORT); 00003003
/*PPL-TITLE: Print Routine */ 00010020
/********************************************************************/ 00020000
/* */ 00030000
/* ENTRY POINT: EPRINT */ 00040000
/* AUTHOR: DIPL.ING. WERNER HOFFMANN */ 00041000
/* PUBLICATIONS: SC33-0009 PL/I LANGUAGE REFERENCE MANUAL */ 00050000
/* SC33-0006 PL/I PROGRAMMER'S GUIDE */ 00060000
/* DATE WRITTEN: 1972/03/05 */ 00070000
/* DATE CHANGED: 2009/08/28 */ 00080000
/* */ 00090000
/* DEFINITION: -THE PROCEDURE EPRINT WRITES A PRINT LINE DEFINED */ 00100000
/* IN THE PCB (PRINT CONTROL BLOCK) TO THE DEFINED */ 00110000
/* PRINT DATA SET. */ 00120000
/* -IF NECESSARY HEADER LINES ARE PRINTED BEFORE THE */ 00130000
/* PRINT LINE IS WRITTEN. */ 00140000
/* -FOLLOWING ASA CONTROL CHARACTER ARE ACCEPTED: */ 00150000
/* '1' - NEW PAGE */ 00160000
/* ' ' - (BLANK) NEW LINE */ 00170000
/* '0' - ONE SPACE LINE */ 00180000
/* '-' - TWO SPACE LINES */ 00190000
/* -METHOD USED: RECORD I/O, MOVE MODUS */ 00200000
/* */ 00210000
/* PROCEDURE CALL: */ 00220000
/* CALL EPRINT(DDFILE,PPCB); */ 00230000
/* | +--- POINTER TO PRINT CB */ 00240000
/* +---------- FILE NAME */ 00241000
/* */ 00243000
/* DEFINITION IN CALLING PROCEDURE: */ 00250000
/* DCL EPRINT ENTRY(FILE,POINTER); */ 00260000
/* DCL DDFILE FILE RECORD OUTPUT ENV(CONSECUTIVE RECSIZE(133)); */ 00261019
/* PRINT CONTROL BLOCK, EXAMPLE SEE V3DPCM00 */ 00261219
/* CODING IN CALLING PROCEDURE: */ 00261319
/* INITIAL ROUTINE: */ 00261419
/* OPEN FILE(DDFILE) OUTPUT; */ 00261519
/* TERMINATION ROUTINE: */ 00261619
/* CLOSE FILE(DDFILE); */ 00261719
/* */ 00261819
/* CALLING ROUTINES/FUNCTIONS: */ 00261920
/* EDATE */ 00262020
/* */ 00262120
/* NOTES: - AFTER PRINTING OF THE LINE: */ 00262220
/* - THE LINE WILL BE INITIALIZED BY ' ' (BLANK) */ 00262320
/* CHARACTERS. */ 00263000
/* */ 00264000
/********************************************************************/ 00270000
EPRINT: 00280000
PROC(DDFILE,PPCB); /* */ 00290000
DCL PPCB POINTER; /* POINTS TO PCB */ 00300008
DCL NHNO BIN FIXED(15) STATIC;/* NUMBER HEADER LINES */ 00301007
DCL 1 SPCBA BASED(PPCB), /*DSECT PCB */ 00310008
2 QSN POINTER, /*ADDRESS OF PAGE NUMBER */ 00320000
2 QDT POINTER, /*ADDRESS EDIT.DATE */ 00330000
2 QPL POINTER, /*ADDRESS PRINT LINE */ 00340011
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 4
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

2 MLCNT BIN FIXED(15), /*MAX. NUMBER LINES/PAGE */ 00350000


2 MLNO BIN FIXED(15), /*NUMBER OF REMAINING PRINTABLE L. */ 00351000
2 MPNO BIN FIXED(15), /*PAGE NUMBER */ 00352000
2 MHNO BIN FIXED(15), /*NUMBER HEADER LINES */ 00353000
2 YPZ CHAR(133), /*PRINT LINE */ 00360006
2 YHL(1:NHNO REFER(SPCBA.MHNO)) CHAR(133); /*HEADER LINES */ 00370011
DCL DSNR PIC'ZZZZ9' BASED(SPCBA.QSN);/*PAGE NUMBER */ 00380000
DCL PL POINTER STATIC;/*POINTER TO BASED LINE */ 00390010
DCL 1 SL BASED(PL), /*PRINT LINE */ 00400010
2 XASA CHAR(1), /*ASA CONTROL CHARACTER */ 00410000
2 XLINE CHAR(132); /*PRINT AREA */ 00420000
DCL JHDR BIN FIXED(15) STATIC;/*CURRENT HEADER LINE */ 00430000
DCL XCASA CHAR(3) STATIC INIT(' 0-');/*ACCEPTED ASA C.CHAR. */ 00440000
DCL XCASASL CHAR(2) DEF(XCASA) POS(2); /*ASA C.CHR.WITH SKIPL.*/ 00441009
DCL DDFILE FILE; /* RECORD I/O DEFINITION */ 00450000
DCL (ADDR,INDEX) BUILTIN; /* */ 00460000
DCL EDATE ENTRY(POINTER);/*EDIT DATE ROUTINE */ 00461001
DCL PDDMY POINTER STATIC;/*POINTER TO DATE FIELD */ 00462011
DCL YDATE CHAR(8) BASED(PDDMY);/*DATE,FORMAT TT.MM.YY */ 00463001
00470000
/*H1 -CHECK FOR EARLY PAGE CHANGE --------------------------------*/ 00482007
PL = ADDR(SPCBA.YPZ); 00483015
IF SL.XASA = '1' 00490000
THEN 00500000
DO; 00510000
SPCBA.MLNO = 0; /*PREPARE FOR NEW PAGE */ 00520000
SL.XASA = ' '; /*CHANGE ASA C.CHAR. TO DEFAULT */ 00530000
END; 00540000
00541000
/*H2 -CHECK FOR PRINTING HEADER LINES ----------------------------*/ 00542000
IF SPCBA.MLNO-INDEX(XCASASL,SL.XASA)<=0 /*NEED FOR NEW PAGE?*/ 00550009
THEN 00560000
DO; 00570000
/*H2.1 -CHECK FOR SETTING DATE INTO HEADER LINE --------------------*/ 00571001
PDDMY = SPCBA.QDT; /*POINT TO DATE FIELD */ 00572001
IF YDATE = 'DD.MM.YY' /*NOT ESTABLISHED? */ 00573002
THEN 00574001
DO; 00575001
CALL EDATE(PDDMY); /*GET AND EDIT DATE */ 00576004
END; 00577001
/*H2.2 -PRINT HEADER LINES -----------------------------------------*/ 00579101
SPCBA.MLNO=SPCBA.MLCNT;/*INIT LINE COUNTER */ 00580000
SPCBA.MPNO=SPCBA.MPNO 1; /*COUNT PAGE NUMBER */ 00590000
DSNR = SPCBA.MPNO; /*EDIT PAGE NUMBER */ 00600000
DO JHDR = 1 TO SPCBA.MHNO;/*STEP THROUGH HEADER AREA */ 00610004
PL = ADDR(SPCBA.YHL(JHDR));/*POINT TO HEADER LINE */ 00620011
WRITE FILE(DDFILE) FROM(SL);/*WRITE HEADER LINE */ 00630000
IF SL.XASA = '1' /* NEW PAGE , COUNT 1ST LINE AS 1 */ 00631018
THEN SPCBA.MLNO = SPCBA.MLNO - 1; 00632023
ELSE SPCBA.MLNO = SPCBA.MLNO - 00633022
INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES*/ 00650000
END; 00660000
END; 00670000
00671000
/*H3 -WRITE PRINT LINE -------------------------------------------*/ 00672000
WRITE FILE(DDFILE) FROM(SPCBA.YPZ);/*WRITE PRINT LINE */ 00680000
PL = SPCBA.QPL; /*POINT TO PRINT LINE */ 00690011
SPCBA.MLNO = SPCBA.MLNO - 00700000
INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES */ 00701000
SPCBA.YPZ = (133)' '; /*INITIATE PRINT LINE */ 00710006
00720000
END EPRINT; 00730000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 5
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

PGM: EDATE – Subprogram


File: V3PSERDA.TXT
*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001003
*PROCESS AGGREGATE, OFFSET; 00002002
*PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); 00003003
/*PPL-TITLE: GET AND EDIT SYSTEM DATE */ 00010001
/********************************************************************/ 00020000
/* FUNCTION TO GET ACTUAL SYSTEM DATE */ 00030000
/* PUBLICATIONS: */ 00031000
/* - C28-8201-2 */ 00032000
/* */ 00033000
/* AUTHOR: DIPL.ING. WERNER HOFFMANN */ 00033101
/* DATE WRITTEN: 1972/03/05 */ 00034001
/* DATE CHANGED: 2009/08/28 */ 00035001
/* */ 00036001
/* PROCEDURE CALL: CALL EDATE (PPOS); */ 00040000
/* +---- ADDRESS OF DATE FIELD */ 00050000
/* DECLARATION: */ 00070000
/* DCL EDATE ENTRY(POINTER); */ 00080000
/* */ 00090000
/* NOTES: - THE RESULTING FORMAT WILL BE: */ 00091000
/* DD.MM.YY */ 00092000
/* | | + YEAR */ 00093000
/* | +--- MONTH */ 00094000
/* +------ DAY */ 00095000
/********************************************************************/ 00100000
EDATE: 00110000
PROC(PPOS) REORDER; 00120000
DCL XDATE CHAR(6) STATIC;/*SYSTEM DATE */ 00130000
DCL 1 S1DATE DEF XDATE, /* DATE */ 00140000
2 XYY CHAR(2), /* YEAR */ 00141000
2 XMM CHAR(2), /* MONTH */ 00142000
2 XDD CHAR(2); /* DAY */ 00143000
DCL PE POINTER STATIC;/*POINTER TO ADDRESS OF DATE */ 00144000
DCL PPOS POINTER; /* ADDRESS OF PRINTED DATE */ 00150000
DCL XPRDATE CHAR(8) BASED(PE);/*PRINTED DATE */ 00151001
DCL DATE BUILTIN; /* */ 00160000
00161000
/*H1 GET SYSTEM DATE AND REFORMAT DATE, */ 00161103
/* RETURN REFORMATED DATE TO THE CALLING ROUTINE */ 00161203
PE=PPOS; /*POINT TO PRINT AREA */ 00162000
XDATE = DATE; /*PICK UP SYSTEM DATE & EDIT DATE */ 00163000
XPRDATE=S1DATE.XDD||'.'||S1DATE.XMM||'.'||S1DATE.XYY; 00163100
00164000
END EDATE; 00165000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 6
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

PGM: EADDR1 – Subprogram


File: V3PSERA1.TXT
*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001003
*PROCESS AGGREGATE, OFFSET; 00002001
*PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); 00003003
/*PPL-TITLE: CAlCULATE NEW ADDRESS BY ADDING A GIVEN DISPLACEMENT */ 00010003
/********************************************************************/ 00020000
/* FUNCTION TO GET A NEW ADDRESS BY ADDING A GIVEN DISPLACEMENT */ 00030003
/* FUNCTION-CALL: P=EADDR1(PCHAR,NPOS); */ 00040000
/* | +--- DISPLACEMENT +0...max. F(31) */ 00050000
/* | MAX.VALUE: 32767 */ 00051003
/* +--------- POINTER */ 00060000
/* DECLARATION: */ 00070000
/* DCL EADDR1 ENTRY(POINTER,BIN FIXED(31)) RETURNS(POINTER); */ 00080000
/* */ 00090000
/********************************************************************/ 00100000
EADDR1: 00110000
PROC(PCHAR,NPOS) RETURNS(POINTER); 00120000
DCL PE POINTER STATIC;/*POINTER TO ADDRESS AREA */ 00130000
DCL PCHAR POINTER; /*STARTING ADDRESS */ 00140000
DCL NPOS BIN FIXED(31); /*DISPLACEMENT */ 00141002
DCL XC(32767) CHAR(1) BASED(PE);/* BYTE AREA */ 00150000
DCL ADDR BUILTIN; /* ADDRESS BUILTIN FUNCTION */ 00160000
00161000
/*H1 CALCULATE NEW ADDRESS BY USING THE GIVEN DISPLACEMENT, */ 00161103
/* RETURN NEW ADDRESS TO THE CALLING ROUTINE */ 00161203
PE=PCHAR; /*INITIATE BYTE AREA ADDRESS */ 00162000
RETURN(ADDR(XC(NPOS))); /*GET NEW ADDRESS & RETURN POINTER */ 00163003
00164000
END EADDR1; 00165000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 7
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

JCL:

File: TASK01.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZC,MBR=V3PEPRT
//PLICOMP EXEC PLIZC,MBR=V3PSERA1
//PLICOMP EXEC PLIZC,MBR=V3PSERDA
//

File: TASK01M.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZCL,MBR=V3PSMSV2
//* TASK01 PGM EPSMSV2
//LKED.SYSIN DD *
INCLUDE OBJMOD(V3PSERA1)
INCLUDE OBJMOD(V3PSERDA)
INCLUDE OBJMOD(V3PEPRT)
NAME EPSMSV2(R)
/*

File: TASK01G.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZG,MBR=EPSMSV2
//* TEST RUN VERSION 1
//GO.FSM DD DSN=P390A.RUN.DATA(SMT201),DISP=SHR
//GO.FSMS DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
//
//PLICOMP EXEC PLIZG,MBR=EPSMSV2
//* TEST RUN VERSION 2
//GO.FSM DD DSN=P390A.RUN.DATA(SMT202),DISP=SHR
//GO.FSMS DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
//

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 8
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

Test Data:

File: SMT201.txt

SMIA5/13672 0802020822 120


SMIA5/13672 0802101430 310
SMIA5/13672 0803121500 50
SMRA5/13672 0803121610 100
SMRA5/17924 0802030915 10000
SMIA5/17924 0802051030 333
SMIB31/82 0802021150 55
SMIB31/8 0802031150 50

File: SMT201.txt

SMIA5/13672 0802020822 120


SMIA5/13672 0802101430 310
SMIA5/13672 0803121500 50
SMRA5/13672 0803121610 100
SMRA5/17924 0802030915 10000
SMIA5/17924 0802051030 333
SMIA5/82 0802021150 55
SMIA6/13672 0802020822 120
SMIA6/13672 0802101430 310
SMIA6/13672 0803121500 50
SMRA6/13672 0803121610 100
SMRA6/17924 0802030915 10000
SMIA6/17924 0802051030 333
SMIA61/82 0802021150 55
SMIA7/13672 0802020822 120
SMIA7/13672 0802101430 310
SMIA7/13672 0803121500 50
SMRA7/13672 0803121610 100
SMRA7/17924 0802030915 10000
SMIA7/17924 0802051030 333
SMIA71/82 0802021150 55
SMIB7/13672 0802020822 120
SMIB7/13672 0802101430 310
SMIB7/13672 0803121500 50
SMRB7/13672 0803121610 100
SMRB7/17924 0802030915 10000
SMIB7/17924 0802051030 333
SMIB71/82 0802021150 55
SMIC7/13672 0802020822 120
SMIC7/13672 0802101430 310
SMIC7/13672 0803121500 50
SMRC7/13672 0803121610 100
SMRC7/17924 0802030915 10000
SMIC7/17924 0802051030 333
SMIC71/82 0802021150 55
SMID7/13672 0802020822 120
SMID7/13672 0802101430 310
SMID7/13672 0803121500 50
SMRD7/13672 0803121610 100
SMRD7/17924 0802030915 10000
SMID7/17924 0802051030 333
SMID71/82 0802021150 55
SMID8/13672 0802020822 120
SMID8/13672 0802101430 310
SMID8/13672 0803121500 50
SMRD8/13672 0803121610 100
SMRD8/17924 0802030915 10000
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 9
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

SMID8/17924 0802051030 333


SMID81/82 0802021150 55
SMID9/13672 0802020822 120
SMID9/13672 0802101430 310
SMID9/13672 0803121500 50
SMRD9/13672 0803121610 100
SMRD9/17924 0802030915 10000
SMID9/17924 0802051030 333
SMID91/82 0802021150 55
SMIE0/13672 0802020822 120
SMIE0/13672 0802101430 310
SMIE0/13672 0803121500 50
SMRE0/13672 0803121610 100
SMRD0/17924 0802030915 10000
SMID0/17924 0802051030 333
SMID01/82 0802021150 55
SMIE1/13672 0802020822 120
SMIE1/13672 0802101430 310
SMIE1/13672 0803121500 50
SMRE1/13672 0803121610 100
SMRD1/17924 0802030915 10000
SMRD1/17924 0802051030 333
SMID11/82 0802021150 55
SMIE2/13672 0802020822 120
SMIE2/13672 0802101430 310
SMIE2/13672 0803121500 50
SMRE2/13672 0803121610 100
SMIE2/17924 0802030915 10000
SMIE2/17924 0802051030 333
SMIE21/82 0802021150 55
SMIE3/13672 0802020822 120
SMIE3/13672 0802101430 310
SMIE3/13672 0803121500 50
SMRE3/13672 0803121610 100
SMID3/17924 0802030915 10000
SMID3/17924 0802051030 333
SMID31/82 0802021150 55
SMIE4/13672 0802020822 120
SMIE4/13672 0802101430 310
SMIE4/13672 0803121500 50
SMRE4/13672 0803121610 100
SMID4/17924 0802030915 10000
SMID4/17924 0802051030 333
SMID41/82 0802021150 55
SMIE4/13673 0802020822 120
SMIE4/13673 0802101430 310
SMIE4/13673 0803121500 50
SMRE4/13673 0803121610 100
SMIE4/17924 0802030915 10000
SMRE4/17924 0802051030 333
SMIE41/82 0802021150 55
SMIE4/13673 0802020822 120
SMIF4/13673 0802101430 310
SMIF4/13673 0803121500 50
SMRF4/13673 0803121610 100
SMIF4/17924 0802030915 10000
SMRF4/17924 0802051030 333
SMIF41/82 0802021150 55
SMIG4/13673 0802101430 310
SMIG4/13673 0803121500 50
SMRG4/13673 0803121610 100
SMIG4/17924 0802030915 10000
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
10
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

SMRG4/17924 0802051030 333


SMIG41/82 0802021150 55
SMIH4/13673 0802101430 310
SMIH4/13673 0803121500 50
SMRH4/13673 0803121610 100
SMIH4/17924 0802030915 10000
SMRH4/17924 0802051030 333
SMIH41/82 0802021150 55
SMRI4/13673 0803121610 100
SMII4/17924 0802030915 10000
SMRI4/17924 0802051030 333
SMII41/82 0802021150 55
SMRI5/13673 0803121610 100
SMII5/17924 0802030915 10000
SMRI5/17924 0802051030 333
SMII51/82 0802021150 55
SMRI6/13673 0803121610 100
SMII6/17924 0802030915 10000
SMRI6/17924 0802051030 333
SMII66/82 0802021150 55
SMRI7/13673 0803121610 100
SMII7/17924 0802030915 10000
SMRI7/17924 0802051030 333
SMII76/82 0802021150 55
SMRI8/13673 0803121610 100
SMII8/17924 0802030915 10000
SMRI8/17924 0802051030 333
SMII86/82 0802021150 55
SMRI9/13673 0803121610 100
SMII9/17924 0802030915 10000
SMRI9/17924 0802051030 333
SMII96/82 0802021150 55

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
11
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

Report Output:

File: TASK01T1.TXT

1 J E S 2 J O B L O G -- S Y S T E M S Y S 1 -- N O D E N 1
0
08.44.07 JOB01562 ---- SATURDAY, 03 OCT 2009 ----
08.44.07 JOB01562 IRR010I USERID P390A IS ASSIGNED TO THIS JOB.
08.44.07 JOB01562 ICH70001I P390A LAST ACCESS AT 08:38:32 ON SATURDAY, OCTOBER 3, 2009
08.44.07 JOB01562 $HASP373 P390AC STARTED - INIT 1 - CLASS A - SYS SYS1
08.44.07 JOB01562 IEF403I P390AC - STARTED - TIME=08.44.07
08.44.09 JOB01562 IEF404I P390AC - ENDED - TIME=08.44.09
08.44.09 JOB01562 $HASP395 P390AC ENDED
0------ JES2 JOB STATISTICS ------
- 03 OCT 2009 JOB EXECUTION DATE
- 7 CARDS READ
- 86 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 4 SYSOUT SPOOL KBYTES
- 0.03 MINUTES EXECUTION TIME
1 //P390AC JOB (),'HOFFMANN', JOB01562
// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
2 //PLICOMP EXEC PLIZG,MBR=EPSMSV2
3 XXIBMZG PROC LIBPRFX='CEE',MBR=TEST
XX*
XX********************************************************************
XX*
XX* IBM ENTERPRISE PL/I FOR Z/OS AND OS/390
XX* VERSION 3 RELEASE 3 MODIFICATION 0
XX*
XX* RUN A PL/I PROGRAM
XX*
XX* PARAMETER DEFAULT VALUE USAGE
XX* LNGPRFX IBMZ.V3R3M0 PREFIX FOR LANGUAGE DATA SET NAMES
XX* LIBPRFX CEE PREFIX FOR LIBRARY DATA SET NAMES
XX* MBR MEMBER NAME FOR PROGRAM LOAD MODULE
XX*
XX*********************************************************************
XX* RUN STEP
XX*********************************************************************
4 XXGO EXEC PGM=&MBR,
XX REGION=2048K
IEFC653I SUBSTITUTION JCL - PGM=EPSMSV2,REGION=2048K
5 XXSTEPLIB DD DSN=P390A.PGM.LOAD,DISP=SHR
6 XX DD DSN=&LIBPRFX..SCEERUN,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSN=CEE.SCEERUN,DISP=SHR
7 XXSYSPRINT DD SYSOUT=*
8 XXPRINT DD SYSOUT=*
9 XXCEEDUMP DD SYSOUT=*
10 XXSYSUDUMP DD SYSOUT=*
//* TEST RUN VERSION 1
11 //GO.FSM DD DSN=P390A.RUN.DATA(SMT201),DISP=SHR
12 //GO.FSMS DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
STMT NO. MESSAGE
2 IEFC001I PROCEDURE PLIZG WAS EXPANDED USING SYSTEM LIBRARY USER.PROCLIB
ICH70001I P390A LAST ACCESS AT 08:38:32 ON SATURDAY, OCTOBER 3, 2009
IEF236I ALLOC. FOR P390AC GO PLICOMP
IEF237I 0A90 ALLOCATED TO STEPLIB
IEF237I 0A81 ALLOCATED TO
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO PRINT
IEF237I JES2 ALLOCATED TO CEEDUMP
IEF237I JES2 ALLOCATED TO SYSUDUMP
IEF237I 0A90 ALLOCATED TO FSM
IEF237I JES2 ALLOCATED TO FSMS
IEF142I P390AC GO PLICOMP - STEP WAS EXECUTED - COND CODE 0000
IEF285I P390A.PGM.LOAD KEPT
IEF285I VOL SER NOS= USR001.
IEF285I CEE.SCEERUN KEPT
IEF285I VOL SER NOS= Z5RES2.
IEF285I P390A.P390AC.JOB01562.D0000101.? SYSOUT
IEF285I P390A.P390AC.JOB01562.D0000102.? SYSOUT
IEF285I P390A.P390AC.JOB01562.D0000103.? SYSOUT
IEF285I P390A.P390AC.JOB01562.D0000104.? SYSOUT
IEF285I P390A.RUN.DATA KEPT
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
12
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

IEF285I VOL SER NOS= USR001.


IEF285I P390A.P390AC.JOB01562.D0000105.? SYSOUT
IEF373I STEP/GO /START 2009276.0844
IEF374I STEP/GO /STOP 2009276.0844 CPU 0MIN 00.29SEC SRB 0MIN 00.84SEC VIRT 100K SYS 252K
EXT 6928K SYS 9216K
IEF375I JOB/P390AC /START 2009276.0844
IEF376I JOB/P390AC /STOP 2009276.0844 CPU 0MIN 00.29SEC SRB 0MIN 00.84SEC

1--- Stores Movement Summary Page: 1


Report: SMS XYZ FACTORY Date: 03.10.09
PART_NUMBER NET_SUMMARY
_________________________________________
A5/13672 -380
A5/17924 +9667
B31/82 -55
B31/8 -50

File: TASK01T2.TXT

1 J E S 2 J O B L O G -- S Y S T E M S Y S 1 -- N O D E N 1
0
08.38.32 JOB01561 ---- SATURDAY, 03 OCT 2009 ----
08.38.32 JOB01561 IRR010I USERID P390A IS ASSIGNED TO THIS JOB.
08.38.32 JOB01561 ICH70001I P390A LAST ACCESS AT 08:36:09 ON SATURDAY, OCTOBER 3, 2009
08.38.32 JOB01561 $HASP373 P390AC STARTED - INIT 1 - CLASS A - SYS SYS1
08.38.32 JOB01561 IEF403I P390AC - STARTED - TIME=08.38.32
08.38.34 JOB01561 IEF404I P390AC - ENDED - TIME=08.38.34
08.38.34 JOB01561 $HASP395 P390AC ENDED
0------ JES2 JOB STATISTICS ------
- 03 OCT 2009 JOB EXECUTION DATE
- 7 CARDS READ
- 156 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 6 SYSOUT SPOOL KBYTES
- 0.03 MINUTES EXECUTION TIME
1 //P390AC JOB (),'HOFFMANN', JOB01561
// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
2 //PLICOMP EXEC PLIZG,MBR=EPSMSV2
3 XXIBMZG PROC LIBPRFX='CEE',MBR=TEST
XX*
XX********************************************************************
XX*
XX* IBM ENTERPRISE PL/I FOR Z/OS AND OS/390
XX* VERSION 3 RELEASE 3 MODIFICATION 0
XX*
XX* RUN A PL/I PROGRAM
XX*
XX* PARAMETER DEFAULT VALUE USAGE
XX* LNGPRFX IBMZ.V3R3M0 PREFIX FOR LANGUAGE DATA SET NAMES
XX* LIBPRFX CEE PREFIX FOR LIBRARY DATA SET NAMES
XX* MBR MEMBER NAME FOR PROGRAM LOAD MODULE
XX*
XX*********************************************************************
XX* RUN STEP
XX*********************************************************************
4 XXGO EXEC PGM=&MBR,
XX REGION=2048K
IEFC653I SUBSTITUTION JCL - PGM=EPSMSV2,REGION=2048K
5 XXSTEPLIB DD DSN=P390A.PGM.LOAD,DISP=SHR
6 XX DD DSN=&LIBPRFX..SCEERUN,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSN=CEE.SCEERUN,DISP=SHR
7 XXSYSPRINT DD SYSOUT=*
8 XXPRINT DD SYSOUT=*
9 XXCEEDUMP DD SYSOUT=*
10 XXSYSUDUMP DD SYSOUT=*
//* TEST RUN VERSION 2
11 //GO.FSM DD DSN=P390A.RUN.DATA(SMT202),DISP=SHR
12 //GO.FSMS DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
STMT NO. MESSAGE
2 IEFC001I PROCEDURE PLIZG WAS EXPANDED USING SYSTEM LIBRARY USER.PROCLIB
ICH70001I P390A LAST ACCESS AT 08:36:09 ON SATURDAY, OCTOBER 3, 2009
IEF236I ALLOC. FOR P390AC GO PLICOMP
IEF237I 0A90 ALLOCATED TO STEPLIB
IEF237I 0A81 ALLOCATED TO
IEF237I JES2 ALLOCATED TO SYSPRINT
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
13
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

IEF237I JES2 ALLOCATED TO PRINT


IEF237I JES2 ALLOCATED TO CEEDUMP
IEF237I JES2 ALLOCATED TO SYSUDUMP
IEF237I 0A90 ALLOCATED TO FSM
IEF237I JES2 ALLOCATED TO FSMS
IEF142I P390AC GO PLICOMP - STEP WAS EXECUTED - COND CODE 0000
IEF285I P390A.PGM.LOAD KEPT
IEF285I VOL SER NOS= USR001.
IEF285I CEE.SCEERUN KEPT
IEF285I VOL SER NOS= Z5RES2.
IEF285I P390A.P390AC.JOB01561.D0000101.? SYSOUT
IEF285I P390A.P390AC.JOB01561.D0000102.? SYSOUT
IEF285I P390A.P390AC.JOB01561.D0000103.? SYSOUT
IEF285I P390A.P390AC.JOB01561.D0000104.? SYSOUT
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.P390AC.JOB01561.D0000105.? SYSOUT
IEF373I STEP/GO /START 2009276.0838
IEF374I STEP/GO /STOP 2009276.0838 CPU 0MIN 00.32SEC SRB 0MIN 00.69SEC VIRT 100K SYS 252K
EXT 6928K SYS 9216K
IEF375I JOB/P390AC /START 2009276.0838
IEF376I JOB/P390AC /STOP 2009276.0838 CPU 0MIN 00.32SEC SRB 0MIN 00.69SEC

1--- Stores Movement Summary Page: 1


Report: SMS XYZ FACTORY Date: 03.10.09
PART_NUMBER NET_SUMMARY
_________________________________________
A5/13672 -380
A5/17924 +9667
A5/82 -55
A6/13672 -380
A6/17924 +9667
A61/82 -55
A7/13672 -380
A7/17924 +9667
A71/82 -55
B7/13672 -380
B7/17924 +9667
B71/82 -55
C7/13672 -380
C7/17924 +9667
C71/82 -55
D7/13672 -380
D7/17924 +9667
D71/82 -55
D8/13672 -380
D8/17924 +9667
D81/82 -55
D9/13672 -380
D9/17924 +9667
D91/82 -55
E0/13672 -380
D0/17924 +9667
D01/82 -55
E1/13672 -380
D1/17924 +10333
D11/82 -55
E2/13672 -380
E2/17924 -10333
E21/82 -55
E3/13672 -380
D3/17924 -10333
D31/82 -55
E4/13672 -380
D4/17924 -10333
D41/82 -55
E4/13673 -380
E4/17924 -9667
E41/82 -55
E4/13673 -120
F4/13673 -260
F4/17924 -9667
F41/82 -55
G4/13673 -260
G4/17924 -9667
G41/82 -55
H4/13673 -260

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
14
Software Engineering - Task 1: Stores Movement Summary Date: 10/25/2009

H4/17924 -9667
H41/82 -55
I4/13673 +100
I4/17924 -9667
I41/82 -55
I5/13673 +100
1--- Stores Movement Summary Page: 2
Report: SMS XYZ FACTORY Date: 03.10.09
PART_NUMBER NET_SUMMARY
_________________________________________
I5/17924 -9667
I51/82 -55
I6/13673 +100
I6/17924 -9667
I66/82 -55
I7/13673 +100
I7/17924 -9667
I76/82 -55
I8/13673 +100
I8/17924 -9667
I86/82 -55
I9/13673 +100
I9/17924 -9667
I96/82 -55

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
15
Software Engineering - Task 2: Stores Movement Summary-Maintenance Date: 10/25/2009
Function EVERIFY

PGM: EVERIFY – Function


File: V3PMSK01.TXT
*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001001
*PROCESS OPT(2) OFFSET XREF(SHORT) ATTRIBUTES(FULL); 00002014
/*PPL-TITLE: Verify input data by Mask Version 01 */ 00004001
/*PROCESS TEST, GN, STMT; */ 00004113
/********************************************************************/ 00005001
/* Function to verify input data by a mask specification */ 00006001
/* Publications: */ 00007001
/* - C28-8201-2 */ 00008001
/* */ 00009001
/* Author: Dipl.Ing. Werner Hoffmann */ 00009101
/* Date written: 2009/08/28 */ 00009201
/* Date changed: 2009/08/28 */ 00009301
/* */ 00009401
/* Invoking Function: */ 00009501
/* Bresult = EVERIFY(Xvalue,Xmask); */ 00009601
/* | +-------- Mask Specification */ 00009701
/* +-------------- value to prove */ 00009801
/* Declaration in calling procedure: */ 00009901
/* DCL EVERIFY ENTRY(CHAR(30) VARYING,CHAR(40) VARYING) */ 00010001
/* RETURNS(BIT(1)); */ 00010101
/* NOTES: */ 00010201
/* Xvalue => character format,1..to max. 30 bytes */ 00011013
/* Xmask => character format,1..to max. 40 bytes */ 00012013
/* L or l => means letters A...Z and ÖÜÄ */ 00012103
/* A or a => means alphanumeric A...ZÖÜÄ 0...9*/ 00012203
/* N or n => means numeric 0...9 */ 00012303
/* B or b => means blank character */ 00012403
/* >? => means next char.must be there */ 00012513
/* ? any EBCDIC character */ 00012603
/* Note: Uppercase means "must be there" */ 00012713
/* Lowercase means "can be there" */ 00012813
/* Must-Part must be specified before an */ 00012915
/* optional part. */ 00013015
/* Example: LAaa>/NNNnnnnBBBB ok. */ 00013115
/* LaaA>/nnnnNNNBBBB false spec. */ 00013215
/* This may be a mask for a 10 byte value */ 00013315
/* */ 00013415
/* Bresult=> BIT(1) '1'B means OK. */ 00013515
/* '0'B means in error */ 00014009
/* Notes: Be carefully in defining the mask! A short mask or a wrong*/ 00014113
/* definition may result in Bresult = '0'B; */ 00014213
/********************************************************************/ 00015001
EVERIFY: 00016001
PROC(Xvalue,Xmask) RETURNS(BIT(1)) REORDER; 00017004
DCL Xvalue CHAR(30) VARYING;/*value to prove */ 00018001
DCL Xmask CHAR(40) VARYING;/*given mask */ 00019001
DCL Bresult BIT(1); /*result value */ 00019201
DCL (Iv,Im) BIN FIXED(15) STATIC;/*points to current character*/ 00019307
DCL (LIv,LIm) BIN FIXED(15) STATIC;/*last actual character pos. */ 00019407
DCL (Yv,Ym) CHAR(1) STATIC;/*actual character */ 00019513
DCL Bmoretodo BIT(1); /*process status */ 00019613
DCL Xletter CHAR(29) STATIC/*letter */ 00019702
INIT('ABCDEFGHIJKLMNOPQRSTUVWXYZÖÜÄ'); 00019802
DCL Xalphanum CHAR(39) STATIC/*alphanumeric */ 00019902
INIT('ABCDEFGHIJKLMNOPQRSTUVWXYZÖÜÄ0123456789'); 00020002
DCL Xnum CHAR(10) STATIC /*numeric */ 00020102

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 1
Software Engineering - Task 2: Stores Movement Summary-Maintenance Date: 10/25/2009
Function EVERIFY

INIT('0123456789'); 00020202
DCL Xblank CHAR(1) STATIC /*blank */ 00020302
INIT(' '); 00020402
DCL Xspecial CHAR(1) STATIC /*special sign - given by mask */ 00020502
INIT('?'); 00020602
DCL (INDEX,LENGTH,SUBSTR) BUILTIN;/*BUILTIN Functions */ 00020706
00020806
/*H1 Initate routine ------------------------------------------- */ 00020906
LIv = LENGTH(Xvalue); /*get real lengths */ 00021007
LIm = LENGTH(Xmask); /* */ 00022007
IF LIv < 1 | /*check for min. length */ 00022107
LIm < 1 /* */ 00022207
THEN /* */ 00023016
DO; /* */ 00023116
Bresult = '0'B; /*wrong usage */ 00023216
RETURN(Bresult); /*return to caller */ 00023316
END; /* */ 00024016
00024101
Iv = 1; /*point to first character -value */ 00024213
Im = 1; /*point to first character -mask */ 00024313
Yv = SUBSTR(Xvalue,Iv,1); /*pick up one char. of value */ 00024405
Ym = SUBSTR(Xmask,Im,1); /*pick up one char. of mask */ 00024505
Bresult = '1'B; /*I assume Xvalue may be ok. */ 00024616
Bmoretodo = '1'B; /*Set process status */ 00024716
/*H2 Step through value and mask --------------------------------*/ 00024806
DO WHILE(Bmoretodo); 00024901
/*H2.1 check a character of value ---------------------------------*/ 00025013
SELECT(Ym); 00025116
/*H2.1.1 Letter specification --------------------------------------*/ 00025213
WHEN('L') 00025302
IF INDEX(Xletter,Yv) = 0 00025403
THEN DO; Bresult = '0'B; Bmoretodo = '0'B; END; 00025509
ELSE DO; Iv = Iv + 1; Im = Im + 1; END; 00025603
WHEN('l') 00025703
IF INDEX(Xletter,Yv) = 0 00025803
THEN Im = Im + 1; 00025904
ELSE DO; Iv = Iv + 1; Im = Im + 1; END; 00026003
/*H2.1.2 Alphanumaric specification -------------------------------*/ 00026113
WHEN('A') 00026203
IF INDEX(Xalphanum,Yv) = 0 00026303
THEN DO; Bresult = '0'B; Bmoretodo = '0'B; END; 00026409
ELSE DO; Iv = Iv + 1; Im = Im + 1; END; 00026503
WHEN('a') 00026603
IF INDEX(Xalphanum,Yv) = 0 00026703
THEN Im = Im + 1; 00026804
ELSE DO; Iv = Iv + 1; Im = Im + 1; END; 00026903
/*H2.1.3 Numeric specification -------------------------------------*/ 00027013
WHEN('N') 00027103
IF INDEX(Xnum,Yv) = 0 00027203
THEN DO; Bresult = '0'B; Bmoretodo = '0'B; END; 00027309
ELSE DO; Iv = Iv + 1; Im = Im + 1; END; 00027403
WHEN('n') 00027503
IF INDEX(Xnum,Yv) = 0 00027603
THEN Im = Im + 1; 00027704
ELSE DO; Iv = Iv + 1; Im = Im + 1; END; 00027803
/*H2.1.4 Special character -----------------------------------------*/ 00027913
WHEN('>') 00028003
IF Im + 1 > LIm 00028107
THEN DO; Bresult = '0'B; Bmoretodo = '0'B; END; 00028209
ELSE 00028303
DO; 00028403
Xspecial = SUBSTR(Xmask,Im + 1,1); 00028505
IF Xspecial = Yv 00028603
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 2
Software Engineering - Task 2: Stores Movement Summary-Maintenance Date: 10/25/2009
Function EVERIFY

THEN DO; Iv = Iv + 1; Im = Im + 2; END; 00028704


ELSE DO; Bresult = '0'B; Bmoretodo = '0'B; END; 00028809
END; 00028903
/*H2.1.5 Blank specification --------------------------------------*/ 00029013
WHEN('B') 00029103
IF Yv = Xblank 00029203
THEN DO; Iv = Iv + 1; Im = Im + 1; END; 00029304
ELSE DO; Bresult = '0'B; Bmoretodo = '0'B; END; 00029409
WHEN('b') 00029503
IF Yv = Xblank 00029603
THEN DO; Iv = Iv + 1; Im = Im + 1; END; 00029704
ELSE Im = Im + 1; 00029803
/*H2.1.6 invalid mask specification -------------------------------*/ 00029913
OTHERWISE 00030003
DO; Bresult = '0'B; Bmoretodo = '0'B; END; 00030109
END; 00030203
00030306
/*H2.2 check for next process action -------------------------------*/ 00030413
IF Iv > LIv 00030507
THEN Bmoretodo = '0'B; 00030609
ELSE Yv = SUBSTR(Xvalue,Iv,1); 00030705
IF Im > LIm 00030807
THEN 00030907
IF Iv <= LIv 00031007
THEN DO; Bresult = '0'B; Bmoretodo = '0'B; END; 00031109
ELSE Bmoretodo = '0'B; 00031209
ELSE Ym = SUBSTR(Xmask,Im,1); 00031307
END; 00031407
00031507
/*H3 Termination routine --------------------------------------- */ 00031607
RETURN(Bresult); 00031707
00032003
END EVERIFY; 00040003

PGM: ETMASK1 – Testprogram


File: V3TMSK01.TXT

*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001000


*PROCESS AGGREGATE, OFFSET; 00002000
*PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); 00003000
/*PPL-TITLE: ETMSK01, PROCEDURE TO TEST EVERIFY */ 00004001
/********************************************************************/ 00005000
/* PGM_ENTRY: ETMSK01 */ 00006001
/* AUTHOR: DIPL.ING. WERNER HOFFMANN */ 00007000
/* Date written: 2009/09/17 */ 00010013
/* */ 00050000
/* CALL: */ 00060000
/* BVERIFY = EVERIFY(XVALUE,XMASK); */ 00070001
/* */ 00099700
/* Data: SYSIN - Test Data in format DATA, */ 00099813
/* SYSPRINT - Testresult. */ 00099913
/********************************************************************/ 00100013
ETMASK1: /* ENTRY POINT */ 00100114
PROC OPTIONS(MAIN) REORDER; 00101013
DCL XVALUE CHAR(30) VARYING STATIC;/* VALUE */ 00110005
DCL XMASK CHAR(40) VARYING STATIC;/* MASK */ 00120005
DCL XRESULT CHAR(13) STATIC; /* RESULT MSG */ 00121014
DCL BVERIFY BIT(1); /*RESULT EVERIFY */ 00130014
DCL BMORETODO BIT(1) INIT('1'B); /*CONTROLLING TEST LOOP */ 00140014
DCL EVERIFY ENTRY(CHAR(30) VARYING,CHAR(40) VARYING) 00151002
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 3
Software Engineering - Task 2: Stores Movement Summary-Maintenance Date: 10/25/2009
Function EVERIFY

RETURNS(BIT(1)); /* Verify function


*/ 00160014
00161006
/*H1.1 Initialization Routine --------------------------------------*/ 00162014
ON ENDFILE(SYSIN) BMORETODO = '0'B; 00164009
PUT FILE(SYSPRINT) LIST('V3TMSK01 STARTED.') SKIP; 00164110
/*H2 Step through Test runs -------------------------------------*/ 00164214
GET FILE(SYSIN) DATA(XVALUE,XMASK) SKIP; 00164312
DO WHILE(BMORETODO); /* */ 00164514
/*H2.1 Test one value by a given mask -----------------------------*/ 00164613
BVERIFY = EVERIFY(XVALUE,XMASK); /*check VALUE */ 00165414
IF BVERIFY /* */ 00165814
THEN XRESULT = ' IS OK. '; /*Set MSG text */ 00165914
ELSE XRESULT = ' IS IN ERROR.'; /* */ 00166014
/*H2.2 print result -----------------------------------------------*/ 00166113
PUT FILE(SYSPRINT) LIST(XVALUE,XMASK,XRESULT) SKIP; 00166211
/*H2.3 get next test case -----------------------------------------*/ 00166313
GET FILE(SYSIN) DATA(XVALUE,XMASK) SKIP; 00166412
END; 00166505
/*H1.2 Termination Routine -----------------------------------------*/ 00166614
PUT FILE(SYSPRINT) LIST('V3TMSK01 ENDED.') SKIP; 00166710
RETURN; /*RETURN TO CALLER */ 00167108
END ETMASK1; /* */ 00168013

JCL:

File: TASK02TM.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZC,MBR=V3PMSK01
//PLICOMP EXEC PLIZCL,MBR=V3TMSK01
//LKED.SYSIN DD *
INCLUDE OBJMOD(V3PMSK01)
NAME V3TMSK01(R)
/*

File: TASK01G.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZG,MBR=V3TMSK01
//GO.SYSIN DD DSN=P390A.RUN.DATA(V3TVER1),DISP=SHR
//GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
//

Test Data:

File: V3TVER1.txt

XVALUE = 'C3/1234 ', XMASK = 'LAaa>/NNNnnnnBBBB';


XVALUE = 'C/123 ', XMASK = 'LAaa>/NNNnnnnBBBB';
XVALUE = 'C3AB/1234 ', XMASK = 'LAaa>/NNNnnnnBBBB';
XVALUE = 'C3AB/12345', XMASK = 'LAaa>/NNNnnnnBBBB';
XVALUE = 'C3/1234 X ', XMASK = 'LAaa>/NNNnnnnBBBB';
XVALUE = '13/1234 ', XMASK = 'LAaa>/NNNnnnnBBBB';

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 4
Software Engineering - Task 2: Stores Movement Summary-Maintenance Date: 10/25/2009
Function EVERIFY

XVALUE = 'V3/1A34 ', XMASK = 'LAaa>/NNNnnnnBBBB';


XVALUE = 'V3/1234 ', XMASK = 'LAaa>/NNNnnnnB';
XVALUE = '/123456 ', XMASK = 'LAaa>/NNNnnnnBBBB';
XVALUE = 'C3/1234 ', XMASK = 'LAaa>/NNNnnnnbbbb';

Report Output:

File: TASK01T1.TXT
1 J E S 2 J O B L O G -- S Y S T E M S Y S 1 -- N O D E N 1
0
15.23.16 JOB01780 ---- WEDNESDAY, 07 OCT 2009 ----
15.23.16 JOB01780 IRR010I USERID P390A IS ASSIGNED TO THIS JOB.
15.23.17 JOB01780 ICH70001I P390A LAST ACCESS AT 15:21:28 ON WEDNESDAY, OCTOBER 7, 2009
15.23.17 JOB01780 $HASP373 P390AC STARTED - INIT 1 - CLASS A - SYS SYS1
15.23.17 JOB01780 IEF403I P390AC - STARTED - TIME=15.23.17
15.23.18 JOB01780 IEF404I P390AC - ENDED - TIME=15.23.18
15.23.18 JOB01780 $HASP395 P390AC ENDED
0------ JES2 JOB STATISTICS ------
- 07 OCT 2009 JOB EXECUTION DATE
- 6 CARDS READ
- 87 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 4 SYSOUT SPOOL KBYTES
- 0.03 MINUTES EXECUTION TIME
1 //P390AC JOB (),'HOFFMANN', JOB01780
// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
2 //PLICOMP EXEC PLIZG,MBR=V3TMSK01
3 XXIBMZG PROC LIBPRFX='CEE',MBR=TEST
XX*
XX********************************************************************
XX*
XX* IBM ENTERPRISE PL/I FOR Z/OS AND OS/390
XX* VERSION 3 RELEASE 3 MODIFICATION 0
XX*
XX* RUN A PL/I PROGRAM
XX*
XX* PARAMETER DEFAULT VALUE USAGE
XX* LNGPRFX IBMZ.V3R3M0 PREFIX FOR LANGUAGE DATA SET NAMES
XX* LIBPRFX CEE PREFIX FOR LIBRARY DATA SET NAMES
XX* MBR MEMBER NAME FOR PROGRAM LOAD MODULE
XX*
XX*********************************************************************
XX* RUN STEP
XX*********************************************************************
4 XXGO EXEC PGM=&MBR,
XX REGION=2048K
IEFC653I SUBSTITUTION JCL - PGM=V3TMSK01,REGION=2048K
5 XXSTEPLIB DD DSN=P390A.PGM.LOAD,DISP=SHR
6 XX DD DSN=&LIBPRFX..SCEERUN,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSN=CEE.SCEERUN,DISP=SHR
7 //GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
X/SYSPRINT DD SYSOUT=*
8 XXPRINT DD SYSOUT=*
9 XXCEEDUMP DD SYSOUT=*
10 XXSYSUDUMP DD SYSOUT=*
11 //GO.SYSIN DD DSN=P390A.RUN.DATA(V3TVER1),DISP=SHR
STMT NO. MESSAGE
2 IEFC001I PROCEDURE PLIZG WAS EXPANDED USING SYSTEM LIBRARY USER.PROCLIB
ICH70001I P390A LAST ACCESS AT 15:21:28 ON WEDNESDAY, OCTOBER 7, 2009
IEF236I ALLOC. FOR P390AC GO PLICOMP
IEF237I 0A90 ALLOCATED TO STEPLIB
IEF237I 0A81 ALLOCATED TO
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO PRINT
IEF237I JES2 ALLOCATED TO CEEDUMP
IEF237I JES2 ALLOCATED TO SYSUDUMP
IEF237I 0A90 ALLOCATED TO SYSIN
IEF142I P390AC GO PLICOMP - STEP WAS EXECUTED - COND CODE 0000
IEF285I P390A.PGM.LOAD KEPT
IEF285I VOL SER NOS= USR001.
IEF285I CEE.SCEERUN KEPT
IEF285I VOL SER NOS= Z5RES2.
IEF285I P390A.P390AC.JOB01780.D0000101.? SYSOUT
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 5
Software Engineering - Task 2: Stores Movement Summary-Maintenance Date: 10/25/2009
Function EVERIFY

IEF285I P390A.P390AC.JOB01780.D0000102.? SYSOUT


IEF285I P390A.P390AC.JOB01780.D0000103.? SYSOUT
IEF285I P390A.P390AC.JOB01780.D0000104.? SYSOUT
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF373I STEP/GO /START 2009280.1523
IEF374I STEP/GO /STOP 2009280.1523 CPU 0MIN 00.31SEC SRB 0MIN 00.80SEC VIRT 100K SYS 244K
EXT 7036K SYS 9208K
IEF375I JOB/P390AC /START 2009280.1523
IEF376I JOB/P390AC /STOP 2009280.1523 CPU 0MIN 00.31SEC SRB 0MIN 00.80SEC

1V3TMSK01 STARTED.
C3/1234 LAaa>/NNNnnnnBBBB IS OK.
C/123 LAaa>/NNNnnnnBBBB IS IN ERROR.
C3AB/1234 LAaa>/NNNnnnnBBBB IS OK.
C3AB/12345 LAaa>/NNNnnnnBBBB IS OK.
C3/1234 X LAaa>/NNNnnnnBBBB IS IN ERROR.
13/1234 LAaa>/NNNnnnnBBBB IS IN ERROR.
V3/1A34 LAaa>/NNNnnnnBBBB IS IN ERROR.
V3/1234 LAaa>/NNNnnnnB IS IN ERROR.
/123456 LAaa>/NNNnnnnBBBB IS IN ERROR.
C3/1234 LAaa>/NNNnnnnbbbb IS OK.
V3TMSK01 ENDED.

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 6
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

PGM: EPSMSV2 - Main program


File: V3PSMSV4.TXT
*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001000
*PROCESS AGGREGATE, OFFSET, CMPAT(V1); 00002000
*PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); 00003000
/*PPL-TITLE: Stores Summary Movements V04 */ 00004005
/********************************************************************/ 00005000
/* Produce Stores Movement Summary Report */ 00006005
/* Publications: see PGM Design V04 */ 00007005
/* */ 00008000
/* Author: Dipl.Ing. Werner Hoffmann */ 00009005
/* Date Written: 1907/03/05 */ 00010005
/* Date Changed: 2009/08/28 */ 00020005
/* */ 00030000
/* PROCEDURE: MAIN */ 00031000
/* TASK: This program produce a Stores Summary Report. */ 00032005
/* REPORT-ID: SMS */ 00033000
/* Standard subroutines used: */ 00034005
/* EPRINT - Report Procedure, */ 00034105
/* using Print Control Block V3DPCB01 */ 00034205
/* EMSG - Message Print Routine */ 00034305
/* using Message Control Block V3DMSG01 */ 00034405
/* EADDR1 - Get new Address by a given displacement */ 00034505
/* EVERIFY- Check Part Number */ 00034605
/* */ 00034700
/* Files: */ 00034805
/* Input: FSM - Stores Movements, Record Layout see: SSM */ 00034905
/* Output: FSMS- Report Stores Summary Movements, */ 00035005
/* Print Line Layout: see SFSMS */ 00035105
/* MSG - Messages - standard layout used. */ 00035209
/* Notes: - */ 00035405
/* */ 00035500
/********************************************************************/ 00036000
EPSMSV4: 00037009
PROC OPTIONS(MAIN) REORDER; 00038000
00039000
/*** File FSM ---------------------------------------------------*/ 00040009
DCL FSM FILE RECORD INPUT /* Stores Movements */ 00050011
ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); 00060000
DCL PSM POINTER STATIC; /*Pointer to SM Record */ 00080011
DCL 1 SSM BASED(PSM), /*SM Record Layout */ 00090011
2 XRID CHAR(2), /*Record ID */ 00100011
2 XRTYPE CHAR(1), /*Record Type, I OR R */ 00101011
2 XPARTNO CHAR(10), /*Part Number */ 00102011
2 NDATE PIC'99999999', /*Date YYYYMMDD */ 00103011
2 NTIME PIC'9999', /*Time HHMM */ 00104011
2 X01 CHAR(1), /*Filler */ 00105011
2 NQTY PIC'99999999', /*Quantity */ 00106011
2 X02 CHAR(46); /*Filler */ 00107011
/*** FILE FSMS --------------------------------------------------*/ 00109000
DCL FSMS FILE RECORD OUTPUT /* */ 00110011
ENV(CONSECUTIVE RECSIZE(133)); 00120000
DCL PFSMS POINTER STATIC; /*Pointer to Print Line */ 00130011
DCL 1 SFSMS BASED(PFSMS), /*Stores Movement Summary Prtl*/ 00131011
2 XASA CHAR(1), /*ASA Control Character */ 00132011
2 XPARTNO CHAR(10), /*Part Number */ 00133011
2 X01 CHAR(05), /*Filler */ 00134011
2 NRECEIPT PIC'ZZZZZZZZZ9', /*Receipt Summary per Part/Ass*/ 00135011

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 1
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

2 X02 CHAR(05), /*Filler */ 00135111


2 NISSUE PIC'ZZZZZZZZZ9', /*Issue Summary per Part/Ass. */ 00135211
2 X03 CHAR(04), /*Filler */ 00135311
2 NNETS PIC'SSSSSSSSSS9', /*Net Summary per Part/Ass */ 00135411
2 X04 CHAR(77); /*Filler */ 00136011
DCL YASA CHAR(1) STATIC INIT(' ');/*Next ASA Control Char. */ 00137005
00137100
%INCLUDE SYSSRC(V3DPCB04); /*Print Control Block */ 00138011
00139000
DCL 1 SCB STATIC, /*Group Control Block */ 00139111
2 YASSNO
CHAR(04), /*New Assembly Number */ 00139211
2 YPARTNO
CHAR(10); /*New Part Number */ 00139311
/*** FILE FMSG
--------------------------------------------------*/ 00139409
DCL FMSG FILE RECORD OUTPUT /* */ 00139611
ENV(CONSECUTIVE RECSIZE(121)); 00139709
DCL PMSG POINTER STATIC; /*Pointer to Message Line */ 00139811
%INCLUDE SYSSRC(V3DMSG01); /*Message Control Block */ 00139911
00140000
/*** Group Net Movements Informations -- Parts ------------------*/ 00140105
DCL 1 SGNETM STATIC, /*Group Net Movements */ 00140211
2 XPARTNO CHAR(10), /*Part Number */ 00140311
2 NISSUE BIN FIXED(31), /*Net Issues */ 00140411
2 NRECEIPT BIN FIXED(31), /*Net Receipts */ 00140511
2 NNETS BIN FIXED(31); /*Net Movements */ 00140611
00140700
00140800
/*** Group Net Movements Informations -- Assembly ---------------*/ 00140905
DCL 1 SANETM STATIC, /*Assembly Net Movements */ 00141011
2 XASSNO CHAR(04), /*Assembly Number */ 00141111
2 NISSUE BIN FIXED(31), /*Net Issues */ 00141211
2 NRECEIPT BIN FIXED(31), /*Net Receipts */ 00141311
2 NNETS BIN FIXED(31); /*Net Movements */ 00141411
00141500
/*** Subroutines/Functions/Builtin ------------------------------*/ 00141605
DCL EPRINT ENTRY(FILE,POINTER);/* Print Procedure */ 00141705
DCL EMSG ENTRY(FILE,POINTER);/* Message Print Routine */ 00141805
DCL EADDR1 ENTRY(POINTER,BIN FIXED(31)) RETURNS(POINTER); 00141900
DCL EVERIFY ENTRY(CHAR(30) VARYING,CHAR(40) VARYING) 00142000
RETURNS(BIT(1)); 00142100
DCL ADDR BUILTIN; /* */ 00142500
DCL SUBSTR BUILTIN; /* */ 00142600
DCL PLIRETC BUILTIN; /* */ 00142700
DCL HIGH BUILTIN; /* */ 00142800
00142900
/*H1.1 Initate Routine --------------------------------------------*/ 00143005
PFSMS = SPCB1.QPL; /*Point to Print Line */ 00143105
PMSG = SMSG1.QPL; /*Point to Message Line */ 00143205
OPEN FILE(FSM) INPUT; /*Open Stores Movement File */ 00144005
OPEN FILE(FSMS) OUTPUT; /*Open Print File */ 00145005
OPEN FILE(FMSG) OUTPUT; /*Open Message File */ 00145109
SLINE.XASA = ' '; /*Prepare and print start msg */ 00145211
SLINE.XMSGTYPE = 'I'; 00145300
SLINE.XENO = 'SMS01'; 00145400
SLINE.XMSGTXT = 'V3PSMSV4 Started.'; 00145510
CALL EMSG(FMSG,PMSG1); 00145609
/*H2 Process File FSM ===========================================*/ 00146005
/*H3 Process all Groups of Netmovements (Assemblies and Parts)===*/ 00147005
CALL EGETSM; /*Get first proved FSM Record */ 00148005
DO WHILE(SCB.YASSNO¬=HIGH(4)); /*More to do? */ 00149000
/*H4 Process one Group of Assembly ---------------------------------*/ 00150011
/*H4.1 Group Assembly Processing (Initial Routine) -----------------*/ 00160011
SANETM.XASSNO = SCB.YASSNO; /* Save Assembly Number */ 00161105
SANETM.NISSUE = 0; /* Clear ISSUE Movements Sum. */ 00161205
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 2
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

SANETM.NRECEIPT= 0; /* Clear RECEIPT Movements Sum*/ 00161305


DO WHILE(SCB.YASSNO=SANETM.XASSNO); 00161400
/*H5 Process one Group of Netmovements - Part ----------------------*/ 00161511
/*H5.1 Group Netmovements Processing (Initial Routine) -------------*/ 00161611
SGNETM.XPARTNO = SCB.YPARTNO; /*Save Part Number */ 00161705
SGNETM.NISSUE = 0; /*Clear ISSUE Movements Sum. */ 00161805
SGNETM.NRECEIPT= 0; /*Clear RECEIPT Movements Sum.*/ 00161905
/*H6 Process SM Records for one Netmovement Group ==================*/ 00162011
DO WHILE(SCB.YPARTNO=SGNETM.XPARTNO); 00162100
/*H6.1 Process one SM Record -------------------------------------*/ 00162211
SELECT(SSM.XRTYPE); 00162300
/*H6.1.1 ISSUE Record ---------------------------------------------*/ 00162411
WHEN('I') /* */ 00162500
SGNETM.NISSUE = SGNETM.NISSUE + SSM.NQTY; 00162600
/*H6.1.2 RECEIPT Record -------------------------------------------*/ 00162711
WHEN('R') /* */ 00162800
SGNETM.NRECEIPT = SGNETM.NRECEIPT + SSM.NQTY; 00162900
/*H6.1.3 not used -------------------------------------------------*/ 00163011
OTHERWISE; 00163100
END; 00163200
CALL EGETSM; /*Get next proved FSM Record */ 00163305
END; 00163400
/*H5.2 Group Netmovements Processing (Edit and Print Routine)------*/ 00163511
SFSMS.XASA = YASA; /*ASA Control Character */ 00163605
SFSMS.XPARTNO = SGNETM.XPARTNO; /*Prepare Print Line */ 00163705
SFSMS.NISSUE = SGNETM.NISSUE; 00163800
SFSMS.NRECEIPT= SGNETM.NRECEIPT; 00163900
SFSMS.NNETS = SGNETM.NRECEIPT-SGNETM.NISSUE; 00164000
CALL EPRINT(FSMS,PPCB1); /*Print Group Summary Line */ 00164105
SANETM.NISSUE = SANETM.NISSUE + SGNETM.NISSUE;/*Aseembly Proc. */ 00164205
SANETM.NRECEIPT= SANETM.NRECEIPT + SGNETM.NRECEIPT; 00164300
YASA = ' '; /*Set ASA Control Character */ 00164405
END; 00164500
/*H4.2 Group Assembly Processing (Edit and Print Routine)----------*/ 00164611
SFSMS.XASA = YASA; /*ASA Control Character */ 00164705
SFSMS.XPARTNO = SANETM.XASSNO; /*Prepare Print Line */ 00164805
SFSMS.NISSUE = SANETM.NISSUE; 00164900
SFSMS.NRECEIPT= SANETM.NRECEIPT; 00165000
SFSMS.NNETS = SANETM.NRECEIPT-SANETM.NISSUE; 00165100
CALL EPRINT(FSMS,PPCB1); /*Print Group Summary Line */ 00165205
YASA = '0'; /*Set ASA Control Character */ 00165305
END; 00165400
/*H1.2 Termination Routine ----------------------------------------*/ 00165505
SLINE.XASA = ' '; /*Print Termination Message */ 00165605
SLINE.XMSGTYPE = 'I'; 00165700
SLINE.XENO = 'SMS01'; 00165800
SLINE.XMSGTXT = 'V3PSMSV4 ended.'; 00165910
CALL EMSG(FMSG,PMSG1); 00166009
CLOSE FILE(*); /*Close all Open Files */ 00166105
CALL PLIRETC(NRETC); /*Set Return Code */ 00166205
00166300
EGETSM: PROC REORDER; 00167200
/********************************************************************/ 00167305
/* FSM Record Processing */ 00167405
/* Task:-Get and return a proved SM record. */ 00167505
/* -Detected errors are printed on file PRINT. */ 00167605
/* Notes: - IF the SM record is error free, additional the */ 00167705
/* assembly/part number will be picked up and are stored */ 00167805
/* into YASSNO/YPARTNO. */ 00167905
/********************************************************************/ 00168005
DCL XVALUE CHAR(30) VARYING STATIC;/*Value need to proof */ 00168105
DCL XMASK1 CHAR(40) VARYING STATIC /*Mask for Part Number */ 00168205
INIT('LAaa>/NNNnnnnBBBB'); 00168300
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 3
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

DCL XMASK2
CHAR(40) VARYING STATIC /*Mask for numeric pos.d. */ 00168405
INIT('bbbbbbbNNNNNNNN'); 00168511
DCL VALIDDATE BUILTIN; /* */ 00168600
DCL SUBSTR BUILTIN; /* */ 00168700
DCL INDEX BUILTIN; /* */ 00168800
DCL STRING BUILTIN; /* */ 00168902
00169002
/*HG1.0 Initiation routine -----------------------------------------*/ 00169102
ON ENDFILE(FSM) /*Set EOF Condition */ 00169205
BEGIN; 00169302
SCB.YASSNO = HIGH(4); /*signal EOF Condition */ 00169402
SCB.YPARTNO = HIGH(10); /* */ 00169502
GOTO LRETURN; /*nothing to do anymore */ 00169605
END; 00169702
READ FILE(FSM) SET(PSM); /*GET NEXT FSM RECORD */ 00169800
DO WHILE((¬ESMOK); 00169905
/*HG2.0 Print SM Record on first error -----------------------------*/ 00170005
SLINE.XASA = '0'; /*Print SM Record */ 00170105
SLINE.XMSGTYPE = 'I'; 00170201
SLINE.XENO = 'SMS02'; 00170301
SLINE.XMSGTXT = STRING(SSM)||' **in error,see below.'; 00170401
CALL EMSG(FMSG,PMSG1); 00170509
/*HG3.1 Check Record ID --------------------------------------------*/ 00170605
IF SSM.XRID ¬= 'SM' 00170700
THEN 00170800
DO; 00170900
SLINE.XASA = ' '; /*Print Error Message */ 00171005
SLINE.XMSGTYPE = 'F'; 00171100
SLINE.XENO = 'SMS01'; 00171200
SLINE.XMSGTXT = 'Record_ID '||SSM.XRID|| 00171300
' is not SM as inspected.'; 00171400
CALL EMSG(FMSG,PMSG1); 00171509
END; 00171700
ELSE 00171800
/*HG3.2 Check Record Type ------------------------------------------*/ 00171905
DO; 00172000
IF INDEX('IR',SSM.XRTYPE) = 0 00172100
THEN 00172200
DO; 00172300
SLINE.XASA = ' '; /*Print Error Message */ 00172405
SLINE.XMSGTYPE = 'F'; 00172500
SLINE.XENO = 'SMS02'; 00172600
SLINE.XMSGTXT = 'Record_Type '||SSM.XRTYPE|| 00172700
' is wrong. Allowed are I or R.'; 00172800
CALL EMSG(FMSG,PMSG1); 00172909
END; 00173100
ELSE 00173200
DO; 00173300
/*HG3.3 Check Part Number ------------------------------------------*/ 00173405
XVALUE = SSM.XPARTNO; 00173500
IF ¬EVERIFY(XVALUE,XMASK1) 00173600
THEN 00173700
DO; 00173800
SLINE.XASA = ' '; /*Print Error Message */ 00173905
SLINE.XMSGTYPE = 'F'; 00174000
SLINE.XENO = 'SMS03'; 00174100
SLINE.XMSGTXT = 'PART NUMBER '||SSM.XPARTNO|| 00174200
' has an erroneous specification. See PGM description.'; 00174300
CALL EMSG(FMSG,PMSG1); 00174409
END; 00174600
/*HG3.4 Check Date -------------------------------------------------*/ 00174705
IF ¬VALIDDATE(SSM.NDATE,'YYYYMMDD') 00174800
THEN 00174900
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 4
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

DO; 00175000
SLINE.XASA = ' '; /*Print Error Message */ 00175105
SLINE.XMSGTYPE = 'F'; 00175200
SLINE.XENO = 'SMS04'; 00175300
SLINE.XMSGTXT = 'Date '||SSM.NDATE|| 00175400
' is wrong. Needed Format: YYYYMMDD or value is false.'; 00175500
CALL EMSG(FMSG,PMSG1); 00175609
END; 00175800
/*HG3.5 Check Quantity ---------------------------------------------*/ 00175905
XVALUE = SSM.NQTY; 00176000
IF ¬EVERIFY(XVALUE,XMASK2) 00176100
THEN 00176200
DO; 00176300
SLINE.XASA = ' '; /*Print Error Message */ 00176405
SLINE.XMSGTYPE = 'F'; 00176500
SLINE.XENO = 'SMS05'; 00176600
SLINE.XMSGTXT = 'Quantity '||SSM.NQTY|| 00176700
' has not a positive numeric value.'; 00176800
CALL EMSG(FMSG,PMSG1); 00176909
END; 00177100
END; 00177200
END; 00177300
/*HG4 Record is in error, get next SM Record -----------------------*/ 00177405
READ FILE(FSM) SET(PSM); /*Get next FSM Record */ 00177505
END; 00177700
/*HG5 SM Record is ok. , pick up SCB fields ------------------------*/ 00177805
SCB.YPARTNO = SSM.XPARTNO; 00178001
SCB.YASSNO = SUBSTR(SSM.XPARTNO,1,INDEX(SSM.XPARTNO,'/')-1); 00178101
LRETURN: 00178204
RETURN; 00178300
00178405
ESMOK: PROC REORDER RETURNS(BIT(1)); 00178501
/********************************************************************/ 00178601
/* SM Record - Precheck Routine */ 00178701
/* Result: '1'B SM record is ok. */ 00178801
/* '0'B SM record is in error */ 00178901
/* Note:-Control will be returned on first error. */ 00179009
/* -There is a dependency between this routine and routine */ 00179109
/* EGETSM. */ 00179209
/********************************************************************/ 00179309
DCL VALIDDATE BUILTIN; /* */ 00179409
00179509
/*HC1.1 Check Record ID --------------------------------------------*/ 00180305
IF SSM.XRID ¬= 'SM' 00180405
THEN RETURN('0'B); 00180501
ELSE 00181401
/*HC1.2 Check Record Type ------------------------------------------*/ 00181505
IF INDEX('IR',SSM.XRTYPE) = 0 00181701
THEN RETURN('0'B); 00181801
ELSE 00182701
DO; 00182801
/*HC1.3 Check Part Number ------------------------------------------*/ 00182905
XVALUE = SSM.XPARTNO; 00183001
IF ¬EVERIFY(XVALUE,XMASK1) 00183101
THEN RETURN('0'B); 00183201
/*HC1.4 Check Date -------------------------------------------------*/ 00184105
IF ¬VALIDDATE(SSM.NDATE,'YYYYMMDD') 00184201
THEN RETURN('0'B); 00184301
/*HC1.5 Check Quantity ---------------------------------------------*/ 00185205
XVALUE = SSM.NQTY; 00185301
IF ¬EVERIFY(XVALUE,XMASK2) 00185401
THEN RETURN('0'B); 00185501
END; 00186401
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 5
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

/*HC2 SM Record is ok. ---------------------------------------------*/ 00186501


RETURN('1'B); /* SM Record is proved and ok. */ 00187205
END ESMOK; 00187301
00187401
END EGETSM; 00187501
00191000
END EPSMSV4; 00200009

File: V3DPCB04.txt
/*PPL-TITLE: Print Control Block V04 */ 00010001
/********************************************************************/ 00020000
/* Print Control Block PGM V3PSMSV4 */ 00030001
/********************************************************************/ 00040000
DCL PPCB1 POINTER INIT(ADDR(SPCB1));/*Pointer to PCB */ 00050000
DCL 1 SPCB1 UNALIGNED, /* Print Control Block */ 00060000
2 QSN POINTER /* Address of Page Number */ 00070000
INIT(EADDR1(ADDR(SPCB1.YHL(1)),52)), 00080000
2 QDT POINTER /* Address Edit-Date */ 00081000
INIT(EADDR1(ADDR(SPCB1.YHL(2)),49)), 00082000
2 QPL POINTER /* Address of Print Area */ 00090000
INIT(ADDR(SPCB1.YPL)), 00091000
2 MLCNT BIN FIXED(15) /* Number of max. Lines per Page */ 00100000
INIT(60), 00110000
2 MLNO BIN FIXED(15) /* Residuary printable No. of Lines*/ 00120000
INIT(0), 00130000
2 MPNO BIN FIXED(15) /* Current Page Number */ 00140000
INIT(0), 00150000
2 MHNO BIN FIXED(15) /* Number of Header Lines */ 00160000
INIT(4), 00170000
2 YPL CHAR(133) /* PrintLine -Communication Area---*/ 00180000
INIT((133)' '), 00190000
2 YHL(4) CHAR(133) INIT /* Header Lines */ 00200000
('1--- Stores Movement Summary Page: NNNNN 00210000
', 00220000
' Report: SMS XYZ FACTORY Date: DD.MM.YY 00221000
', 00222000
' Part_Number Receipts Issues Net_Summary 00222100
', 00222200
' _______________________________________________________ 00223000
'); 00224000
00230000

File: V3DMSG01.txt
/*PPL-TITLE: MSG Control Block V01 */ 00010008
/********************************************************************/ 00020002
/* Message Control Block PGM V3PSMSV3 */ 00030008
/********************************************************************/ 00040002
DCL PMSG1 POINTER INIT(ADDR(SMSG1));/*Pointer to MSG CB */ 00050008
DCL 1 SMSG1 UNALIGNED, /* Message Control Block */ 00060008
2 QSN POINTER /* Address of Page Number */ 00070008
INIT(EADDR1(ADDR(SMSG1.YHL(1)),112)), 00080009
2 QDT POINTER /* Address Edit-Date */ 00081008
INIT(EADDR1(ADDR(SMSG1.YHL(2)),109)), 00082010
2 QPL POINTER /* Address of Message Print Area */ 00083008
INIT(ADDR(SMSG1.YPL)), 00084002
2 MLCNT BIN FIXED(15) /* Number of max. lines per page */ 00085008
INIT(60), 00086002
2 MLNO BIN FIXED(15) /* Residuary printable No. of lines*/ 00087008
INIT(0), 00088002
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 6
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

2 MPNO BIN FIXED(15) /* Current page number */ 00089008


INIT(0), 00090002
2 MHNO BIN FIXED(15) /* Number of header lines */ 00100008
INIT(2), 00110007
2 NRETC BIN FIXED(31) /* Highest Return Code */ 00120008
INIT(0), 00130002
2 YPL CHAR(121) /* PrintLine -Communication Area -*/ 00140008
INIT((121)' '), 00150002
2 YHL(2) CHAR(121) INIT /* Header Lines */ 00160008
('1--- Store Movements Report --- Messages --- 00170002
PAGE: NNNNN ', 00180007
' MSG_No 1***5****10***5****20***5****30***5****40***5****50***5****6000190007
***5****70***5****80 Date: DD.MM.YY '); 00200010
00210002
DCL 1 SLINE BASED(PMSG), /*MSG Layout */ 00220008
2 XASA CHAR(1), /*ASA Control Character */ 00230008
2 XMSGTYPE CHAR(1), /*Message Type */ 00240008
2 XENO CHAR(5), /*Error Number */ 00250008
2 XSPACE CHAR(1), /*- */ 00260008
2 XMSGTXT CHAR(113); /*Message Text */ 00270008

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 7
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

PGMs Subprograms
File: V3PEPRT.TXT
*PROCESS OPTIONS INSOURCE SOURCE NEST MACRO STORAGE; 00001003
*PROCESS AGGREGATE, OFFSET, CMPAT(V1); 00002004
*PROCESS OPT(2) TEST(ALL,SYM) ATTRIBUTES(FULL) XREF(SHORT); 00003003
/*PPL-TITLE: Print Routine */ 00010020
/********************************************************************/ 00020000
/* */ 00030000
/* ENTRY POINT: EPRINT */ 00040000
/* AUTHOR: DIPL.ING. WERNER HOFFMANN */ 00041000
/* PUBLICATIONS: SC33-0009 PL/I LANGUAGE REFERENCE MANUAL */ 00050000
/* SC33-0006 PL/I PROGRAMMER'S GUIDE */ 00060000
/* DATE WRITTEN: 1972/03/05 */ 00070000
/* DATE CHANGED: 2009/08/28 */ 00080000
/* */ 00090000
/* DEFINITION: -THE PROCEDURE EPRINT WRITES A PRINT LINE DEFINED */ 00100000
/* IN THE PCB (PRINT CONTROL BLOCK) TO THE DEFINED */ 00110000
/* PRINT DATA SET. */ 00120000
/* -IF NECESSARY HEADER LINES ARE PRINTED BEFORE THE */ 00130000
/* PRINT LINE IS WRITTEN. */ 00140000
/* -FOLLOWING ASA CONTROL CHARACTER ARE ACCEPTED: */ 00150000
/* '1' - NEW PAGE */ 00160000
/* ' ' - (BLANK) NEW LINE */ 00170000
/* '0' - ONE SPACE LINE */ 00180000
/* '-' - TWO SPACE LINES */ 00190000
/* -METHOD USED: RECORD I/O, MOVE MODUS */ 00200000
/* */ 00210000
/* PROCEDURE CALL: */ 00220000
/* CALL EPRINT(DDFILE,PPCB); */ 00230000
/* | +--- POINTER TO PRINT CB */ 00240000
/* +---------- FILE NAME */ 00241000
/* */ 00243000
/* DEFINITION IN CALLING PROCEDURE: */ 00250000
/* DCL EPRINT ENTRY(FILE,POINTER); */ 00260000
/* DCL DDFILE FILE RECORD OUTPUT ENV(CONSECUTIVE RECSIZE(133)); */ 00261019
/* PRINT CONTROL BLOCK, EXAMPLE SEE V3DPCM00 */ 00261219
/* CODING IN CALLING PROCEDURE: */ 00261319
/* INITIAL ROUTINE: */ 00261419
/* OPEN FILE(DDFILE) OUTPUT; */ 00261519
/* TERMINATION ROUTINE: */ 00261619
/* CLOSE FILE(DDFILE); */ 00261719
/* */ 00261819
/* CALLING ROUTINES/FUNCTIONS: */ 00261920
/* EDATE */ 00262020
/* */ 00262120
/* NOTES: - AFTER PRINTING OF THE LINE: */ 00262220
/* - THE LINE WILL BE INITIALIZED BY ' ' (BLANK) */ 00262320
/* CHARACTERS. */ 00263000
/* */ 00264000
/********************************************************************/ 00270000
EPRINT: 00280000
PROC(DDFILE,PPCB); /* */ 00290000
DCL PPCB POINTER; /* POINTS TO PCB */ 00300008
DCL NHNO BIN FIXED(15) STATIC;/* NUMBER HEADER LINES */ 00301007
DCL 1 SPCBA BASED(PPCB), /*DSECT PCB */ 00310008
2 QSN POINTER, /*ADDRESS OF PAGE NUMBER */ 00320000
2 QDT POINTER, /*ADDRESS EDIT.DATE */ 00330000
2 QPL POINTER, /*ADDRESS PRINT LINE */ 00340011
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 8
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

2 MLCNT BIN FIXED(15), /*MAX. NUMBER LINES/PAGE */ 00350000


2 MLNO BIN FIXED(15), /*NUMBER OF REMAINING PRINTABLE L. */ 00351000
2 MPNO BIN FIXED(15), /*PAGE NUMBER */ 00352000
2 MHNO BIN FIXED(15), /*NUMBER HEADER LINES */ 00353000
2 YPZ CHAR(133), /*PRINT LINE */ 00360006
2 YHL(1:NHNO REFER(SPCBA.MHNO)) CHAR(133); /*HEADER LINES */ 00370011
DCL DSNR PIC'ZZZZ9' BASED(SPCBA.QSN);/*PAGE NUMBER */ 00380000
DCL PL POINTER STATIC;/*POINTER TO BASED LINE */ 00390010
DCL 1 SL BASED(PL), /*PRINT LINE */ 00400010
2 XASA CHAR(1), /*ASA CONTROL CHARACTER */ 00410000
2 XLINE CHAR(132); /*PRINT AREA */ 00420000
DCL JHDR BIN FIXED(15) STATIC;/*CURRENT HEADER LINE */ 00430000
DCL XCASA CHAR(3) STATIC INIT(' 0-');/*ACCEPTED ASA C.CHAR. */ 00440000
DCL XCASASL CHAR(2) DEF(XCASA) POS(2); /*ASA C.CHR.WITH SKIPL.*/ 00441009
DCL DDFILE FILE; /* RECORD I/O DEFINITION */ 00450000
DCL (ADDR,INDEX) BUILTIN; /* */ 00460000
DCL EDATE ENTRY(POINTER);/*EDIT DATE ROUTINE */ 00461001
DCL PDDMY POINTER STATIC;/*POINTER TO DATE FIELD */ 00462011
DCL YDATE CHAR(8) BASED(PDDMY);/*DATE,FORMAT TT.MM.YY */ 00463001
00470000
/*H1 -CHECK FOR EARLY PAGE CHANGE --------------------------------*/ 00482007
PL = ADDR(SPCBA.YPZ); 00483015
IF SL.XASA = '1' 00490000
THEN 00500000
DO; 00510000
SPCBA.MLNO = 0; /*PREPARE FOR NEW PAGE */ 00520000
SL.XASA = ' '; /*CHANGE ASA C.CHAR. TO DEFAULT */ 00530000
END; 00540000
00541000
/*H2 -CHECK FOR PRINTING HEADER LINES ----------------------------*/ 00542000
IF SPCBA.MLNO-INDEX(XCASASL,SL.XASA)<=0 /*NEED FOR NEW PAGE?*/ 00550009
THEN 00560000
DO; 00570000
/*H2.1 -CHECK FOR SETTING DATE INTO HEADER LINE --------------------*/ 00571001
PDDMY = SPCBA.QDT; /*POINT TO DATE FIELD */ 00572001
IF YDATE = 'DD.MM.YY' /*NOT ESTABLISHED? */ 00573002
THEN 00574001
DO; 00575001
CALL EDATE(PDDMY); /*GET AND EDIT DATE */ 00576004
END; 00577001
/*H2.2 -PRINT HEADER LINES -----------------------------------------*/ 00579101
SPCBA.MLNO=SPCBA.MLCNT;/*INIT LINE COUNTER */ 00580000
SPCBA.MPNO=SPCBA.MPNO 1; /*COUNT PAGE NUMBER */ 00590000
DSNR = SPCBA.MPNO; /*EDIT PAGE NUMBER */ 00600000
DO JHDR = 1 TO SPCBA.MHNO;/*STEP THROUGH HEADER AREA */ 00610004
PL = ADDR(SPCBA.YHL(JHDR));/*POINT TO HEADER LINE */ 00620011
WRITE FILE(DDFILE) FROM(SL);/*WRITE HEADER LINE */ 00630000
IF SL.XASA = '1' /* NEW PAGE , COUNT 1ST LINE AS 1 */ 00631018
THEN SPCBA.MLNO = SPCBA.MLNO - 1; 00632023
ELSE SPCBA.MLNO = SPCBA.MLNO - 00633022
INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES*/ 00650000
END; 00660000
END; 00670000
00671000
/*H3 -WRITE PRINT LINE -------------------------------------------*/ 00672000
WRITE FILE(DDFILE) FROM(SPCBA.YPZ);/*WRITE PRINT LINE */ 00680000
PL = SPCBA.QPL; /*POINT TO PRINT LINE */ 00690011
SPCBA.MLNO = SPCBA.MLNO - 00700000
INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES */ 00701000
SPCBA.YPZ = (133)' '; /*INITIATE PRINT LINE */ 00710006
00720000
END EPRINT; 00730000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 9
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

File: V3PEMSG.txt
*PROCESS OPTIONS INSOURCE SOURCE NEST MACRO STORAGE; 00001000
*PROCESS AGGREGATE, OFFSET, CMPAT(V1); 00002000
*PROCESS OPT(2) TEST(ALL,SYM) ATTRIBUTES(FULL) XREF(SHORT); 00003000
/*PPL-TITLE: Message Print Routine */ 00010008
/********************************************************************/ 00020000
/* */ 00030000
/* ENTRY POINT: EMSG */ 00040001
/* AUTHOR: DIPL.ING. WERNER HOFFMANN */ 00041000
/* PUBLICATIONS: SC33-0009 PL/I LANGUAGE REFERENCE MANUAL */ 00050000
/* SC33-0006 PL/I PROGRAMMER'S GUIDE */ 00060000
/* DATE WRITTEN: 1972/03/05 */ 00070000
/* DATE CHANGED: 2009/08/28 */ 00080000
/* */ 00090000
/* DEFINITION: -THE PROCEDURE EMSG WRITES A PRINT LINE DEFINED */ 00100001
/* IN THE PCB (PRINT CONTROL BLOCK) TO THE DEFINED */ 00110000
/* PRINT DATA SET. */ 00120000
/* -IF NECESSARY HEADER LINES ARE PRINTED BEFORE THE */ 00130000
/* PRINT LINE IS WRITTEN. */ 00140000
/* -FOLLOWING ASA CONTROL CHARACTER ARE ACCEPTED: */ 00150000
/* '1' - NEW PAGE */ 00160000
/* ' ' - (BLANK) NEW LINE */ 00170000
/* '0' - ONE SPACE LINE */ 00180000
/* '-' - TWO SPACE LINES */ 00190000
/* -METHOD USED: RECORD I/O, MOVE MODUS */ 00200000
/* */ 00210000
/* PROCEDURE CALL: */ 00220000
/* CALL EMSG(DDFILE,PMCB); */ 00230005
/* | +---- POINTER TO PRINT CB */ 00240000
/* +----------- FILE NAME */ 00241000
/* */ 00243000
/* DEFINITION IN CALLING PROCEDURE: */ 00250000
/* DCL EMSG ENTRY(FILE,POINTER); */ 00260001
/* PRINT FILE: */ 00261001
/* DCL DDFILE FILE RECORD OUTPUT ENV(CONSECUTIVE RECSIZE(121)); */ 00261307
/* MESSAGE CONTROL BLOCK, EXAMPLE SEE V3DMCB00 */ 00261407
/* CODING IN CALLING PROCEDURE: */ 00261507
/* INITIAL ROUTINE: */ 00261607
/* OPEN FILE(DDFILE) OUTPUT; */ 00261707
/* TERMINATION ROUTINE: */ 00261807
/* CLOSE FILE(DDFILE); */ 00261907
/* */ 00262407
/* CALLING ROUTINES/FUNCTIONS: */ 00262508
/* EDATE */ 00262608
/* */ 00262708
/* NOTES: - AFTER PRINTING OF THE LINE: */ 00262808
/* - THE LINE WILL BE INITIALIZED BY ' ' (BLANK) */ 00262908
/* CHARACTERS. */ 00263000
/* - THE HIGHEST REURN CODE IS SAVED INTO FIELD */ 00263101
/* NRETC. */ 00263201
/* MSG-TYPE/RETURNCODE: */ 00263301
/* W => 4, F => 8, E => 12, T => 16 */ 00263401
/* I -> Informational message */ 00264011
/* W -> Warning message */ 00264111
/* F -> Failure message */ 00264211
/* E -> Emergency message */ 00264311
/* T -> Terminational message */ 00264411
/* */ 00265011
/********************************************************************/ 00270000
EMSG: 00280001

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
10
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

PROC(DDFILE,PMCB); /* */ 00290005
DCL PMCB POINTER; /* POINTS TO MCB */ 00300005
DCL NHNO BIN FIXED(15) STATIC;/* NUMBER HEADER LINES */ 00301000
DCL 1 SMCBA BASED(PMCB), /*DSECT MCB */ 00310005
2 QSN POINTER, /*ADDRESS OF PAGE NUMBER */ 00320000
2 QDT POINTER, /*ADDRESS EDIT.DATE */ 00330000
2 QPL POINTER, /*ADDRESS PRINT LINE */ 00340000
2 MLCNT BIN FIXED(15), /*MAX. NUMBER LINES/PAGE */ 00350000
2 MLNO BIN FIXED(15), /*NUMBER OF REMAINING PRINTABLE L. */ 00351000
2 MPNO BIN FIXED(15), /*PAGE NUMBER */ 00352000
2 MHNO BIN FIXED(15), /*NUMBER HEADER LINES */ 00353000
2 NRETC BIN FIXED(31), /*HIGHEST RETURN CODE */ 00354001
2 YPZ CHAR(121), /*PRINT LINE */ 00360001
2 YHL(1:NHNO REFER(SMCBA.MHNO)) CHAR(121); /*HEADER LINES */ 00370005
DCL DSNR PIC'ZZZZ9' BASED(SMCBA.QSN);/*PAGE NUMBER */ 00380005
DCL PL POINTER STATIC;/*POINTER TO BASED LINE */ 00390000
DCL 1 SL BASED(PL), /*DSECT MESSAGE LINE */ 00400011
2 XASA CHAR(1), /*ASA CONTROL CHARACTERR */ 00410010
2 XMSGTYPE CHAR(1), /*MESSAGE TYPE */ 00420010
2 XENO CHAR(5), /*ERROR NUMBER */ 00421010
2 XSPACE CHAR(1), /* */ 00422010
2 XMSGTXT CHAR(113); /*MESSAGE TEXT */ 00423010
DCL JHDR BIN FIXED(15) STATIC;/*CURRENT HEADER LINE */ 00430000
DCL XCASA CHAR(3) STATIC INIT(' 0-');/*ACCEPTED ASA C.CHAR. */ 00440000
DCL XCASASL CHAR(2) DEF(XCASA) POS(2); /*ASA C.CHR.WITH SKIPL.*/ 00441010
DCL DDFILE FILE; /* RECORD I/O DEFINITION */ 00450000
DCL (ADDR,INDEX,MAX) BUILTIN;/* */ 00460004
DCL EDATE ENTRY(POINTER);/*EDIT DATE ROUTINE */ 00461000
DCL PDDMY POINTER STATIC;/*POINTER TO DATE FIELD */ 00462000
DCL YDATE CHAR(8) BASED(PDDMY);/*DATE,FORMAT TT.MM.YY */ 00463000
00470000
/*H1 -CHECK FOR EARLY PAGE CHANGE --------------------------------*/ 00482000
PL = ADDR(SMCBA.YPZ); 00483005
IF SL.XASA = '1' 00490011
THEN 00500000
DO; 00510000
SMCBA.MLNO = 0; /*PREPARE FOR NEW PAGE */ 00520005
SL.XASA = ' '; /*CHANGE ASA C.CHAR. TO DEFAULT */ 00530011
END; 00540000
00541000
/*H2 -CHECK FOR PRINTING HEADER LINES ----------------------------*/ 00542000
IF SMCBA.MLNO-INDEX(XCASASL,SL.XASA)<=0 /*NEED FOR NEW PAGE?*/ 00550005
THEN 00560000
DO; 00570000
/*H2.1 -CHECK FOR SETTING DATE INTO HEADER LINE --------------------*/ 00571000
PDDMY = SMCBA.QDT; /*POINT TO DATE FIELD */ 00572005
IF YDATE = 'DD.MM.YY' /*NOT ESTABLISHED? */ 00573000
THEN 00574000
DO; 00575000
CALL EDATE(PDDMY); /*GET AND EDIT DATE */ 00576000
END; 00577000
/*H2.2 -PRINT HEADER LINES -----------------------------------------*/ 00579100
SMCBA.MLNO=SMCBA.MLCNT;/*INIT LINE COUNTER */ 00580005
SMCBA.MPNO=SMCBA.MPNO + 1; /*COUNT PAGE NUMBER */ 00590005
DSNR = SMCBA.MPNO; /*EDIT PAGE NUMBER */ 00600005
DO JHDR = 1 TO SMCBA.MHNO;/*STEP THROUGH HEADER AREA */ 00610005
PL = ADDR(SMCBA.YHL(JHDR));/*POINT TO HEADER LINE */ 00620005
WRITE FILE(DDFILE) FROM(SL);/*WRITE HEADER LINE */ 00630011
IF SL.XASA = '1' /* NEW PAGE , COUNT 1ST LINE AS 1 */ 00631011
THEN SMCBA.MLNO = SMCBA.MLNO - 1; 00632011
ELSE SMCBA.MLNO = SMCBA.MLNO - 00633011
INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES*/ 00650000
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
11
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

END; 00660000
END; 00670000
00671000
/*H3 -WRITE PRINT LINE -------------------------------------------*/ 00672000
WRITE FILE(DDFILE) FROM(SMCBA.YPZ);/*WRITE PRINT LINE */ 00680005
PL = SMCBA.QPL; /*POINT TO PRINT LINE */ 00690005
SMCBA.MLNO = SMCBA.MLNO - 00700005
INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES */ 00701011
/*SAVE HIGEST RETURN CODE */ 00701101
SMCBA.NRETC = MAX(SMCBA.NRETC,INDEX(' W F E T', 00702005
SL.XMSGTYPE)); 00703011
SMCBA.YPZ = (121)' '; /*INITIATE PRINT LINE */ 00710005
00720000
END EMSG; 00730001

File: V3PSERDA.TXT
*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001003
*PROCESS AGGREGATE, OFFSET; 00002002
*PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); 00003003
/*PPL-TITLE: GET AND EDIT SYSTEM DATE */ 00010001
/********************************************************************/ 00020000
/* FUNCTION TO GET ACTUAL SYSTEM DATE */ 00030000
/* PUBLICATIONS: */ 00031000
/* - C28-8201-2 */ 00032000
/* */ 00033000
/* AUTHOR: DIPL.ING. WERNER HOFFMANN */ 00033101
/* DATE WRITTEN: 1972/03/05 */ 00034001
/* DATE CHANGED: 2009/08/28 */ 00035001
/* */ 00036001
/* PROCEDURE CALL: CALL EDATE (PPOS); */ 00040000
/* +---- ADDRESS OF DATE FIELD */ 00050000
/* DECLARATION: */ 00070000
/* DCL EDATE ENTRY(POINTER); */ 00080000
/* */ 00090000
/* NOTES: - THE RESULTING FORMAT WILL BE: */ 00091000
/* DD.MM.YY */ 00092000
/* | | + YEAR */ 00093000
/* | +--- MONTH */ 00094000
/* +------ DAY */ 00095000
/********************************************************************/ 00100000
EDATE: 00110000
PROC(PPOS) REORDER; 00120000
DCL XDATE CHAR(6) STATIC;/*SYSTEM DATE */ 00130000
DCL 1 S1DATE DEF XDATE, /* DATE */ 00140000
2 XYY CHAR(2), /* YEAR */ 00141000
2 XMM CHAR(2), /* MONTH */ 00142000
2 XDD CHAR(2); /* DAY */ 00143000
DCL PE POINTER STATIC;/*POINTER TO ADDRESS OF DATE */ 00144000
DCL PPOS POINTER; /* ADDRESS OF PRINTED DATE */ 00150000
DCL XPRDATE CHAR(8) BASED(PE);/*PRINTED DATE */ 00151001
DCL DATE BUILTIN; /* */ 00160000
00161000
/*H1 GET SYSTEM DATE AND REFORMAT DATE, */ 00161103
/* RETURN REFORMATED DATE TO THE CALLING ROUTINE */ 00161203
PE=PPOS; /*POINT TO PRINT AREA */ 00162000
XDATE = DATE; /*PICK UP SYSTEM DATE & EDIT DATE */ 00163000
XPRDATE=S1DATE.XDD||'.'||S1DATE.XMM||'.'||S1DATE.XYY; 00163100
00164000
END EDATE; 00165000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
12
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

File: V3PSERA1.TXT
*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001003
*PROCESS AGGREGATE, OFFSET; 00002001
*PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); 00003003
/*PPL-TITLE: CALCULATE NEW ADDRESS BY ADDING A GIVEN DISPLACEMENT */ 00010003
/********************************************************************/ 00020000
/* FUNCTION TO GET A NEW ADDRESS BY ADDING A GIVEN DISPLACEMENT */ 00030003
/* FUNCTION-CALL: P=EADDR1(PCHAR,NPOS); */ 00040000
/* | +--- DISPLACEMENT +0...max. F(31) */ 00050000
/* | MAX.VALUE: 32767 */ 00051003
/* +--------- POINTER */ 00060000
/* DECLARATION: */ 00070000
/* DCL EADDR1 ENTRY(POINTER,BIN FIXED(31)) RETURNS(POINTER); */ 00080000
/* */ 00090000
/********************************************************************/ 00100000
EADDR1: 00110000
PROC(PCHAR,NPOS) RETURNS(POINTER); 00120000
DCL PE POINTER STATIC;/*POINTER TO ADDRESS AREA */ 00130000
DCL PCHAR POINTER; /*STARTING ADDRESS */ 00140000
DCL NPOS BIN FIXED(31); /*DISPLACEMENT */ 00141002
DCL XC(32767) CHAR(1) BASED(PE);/* BYTE AREA */ 00150000
DCL ADDR BUILTIN; /* ADDRESS BUILTIN FUNCTION */ 00160000
00161000
/*H1 CALCULATE NEW ADDRESS BY USING THE GIVEN DISPLACEMENT, */ 00161103
/* RETURN NEW ADDRESS TO THE CALLING ROUTINE */ 00161203
PE=PCHAR; /*INITIATE BYTE AREA ADDRESS */ 00162000
RETURN(ADDR(XC(NPOS))); /*GET NEW ADDRESS & RETURN POINTER */ 00163003
00164000
END EADDR1; 00165000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
13
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

JCL:

File: TASK02.txt

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZC,MBR=V3PEMSG
//PLICOMP EXEC PLIZC,MBR=V3PEPRT
//PLICOMP EXEC PLIZC,MBR=V3PSERDA
//PLICOMP EXEC PLIZC,MBR=V3PSERA1
//PLICOMP EXEC PLIZC,MBR=V3PMSK01
//

File: TASK02M.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZCL,MBR=V3PSMSV4
//LKED.SYSIN DD *
INCLUDE OBJMOD(V3PSERA1)
INCLUDE OBJMOD(V3PSERDA)
INCLUDE OBJMOD(V3PEPRT)
INCLUDE OBJMOD(V3PEMSG)
INCLUDE OBJMOD(V3PMSK01)
NAME EPSMSV4(R)
/*

File: TASK02G.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZG,MBR=EPSMSV4
//GO.FSM DD DSN=P390A.RUN.DATA(SMT302),DISP=SHR
//GO.FMSG DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=2420)
//GO.FSMS DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
//

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
14
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

Test Data:

File: SMT201.txt

SMIA5/13672 200802020822 120


SMIA5/13672 200802101430 310
SMIA5/13672 200803121500 50
SMRA5/13672 200803121610 100
SMRA5/17924 200802030915 10000
SMIA5/17924 200802051030 333
SMIA5/820 200802021150 55
SMIA6/13672 200802020822 120
SMIA6/13672 200802101430 310
SMIA6/13672 200803121500 50
SMRA6/13672 200803121610 100
SMRA6/17924 200802030915 10000
SMIA6/17924 200802051030 333
SMIA61/821 200802021150 55
SMIA7/13672 200802020822 120
SMIA7/13672 200802101430 310
SMIA7/13672 200803121500 50
SMRA7/13672 200803121610 100
SMRA7/17924 200802030915 10000
SMIA7/17924 200802051030 333
SMIA71/821 200802021150 55
SMIB7/13672 200802020822 120
SMIB7/13672 200802101430 310
SMIB7/13672 200803121500 50
SMRB7/13672 200803121610 100
SMRB7/17924 200802030915 10000
SMIB7/17924 200802051030 333
SMIB71/823 200802021150 55
SMIC7/13672 200802020822 120
SMIC7/13672 200802101430 310
SMIC7/13672 200803121500 50
SMRC7/13672 200803121610 100
SMRC7/17924 200802030915 10000
SMIC7/17924 200802051030 333
SMIC71/823 200802021150 55
SMID7/13672 200802020822 120
SMID7/13672 200802101430 310
SMID7/13672 200803121500 50
SMRD7/13672 200803121610 100
SMRD7/17924 200802030915 10000
SMID7/17924 200802051030 333
SMID71/823 200802021150 55
SMID8/13672 200802020822 120
SMID8/13672 200802101430 310
SMID8/13672 200803121500 50
SMRD8/13672 200803121610 100
SMRD8/17924 200802030915 10000
SMID8/17924 200802051030 333
SMID81/8211 200802021150 55
SMID9/13672 200802020822 120
SMID9/13672 200802101430 310
SMID9/13672 200803121500 50
SMRD9/13672 200803121610 100
SMRD9/17924 200802030915 10000
SMID9/17924 200802051030 333
SMID91/821 200802021150 55
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
15
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

SMIE0/13672 200802020822 120


SMIE0/13672 200802101430 310
SMIE0/13672 200803121500 50
SMRE0/13672 200803121610 100
SMRD0/17924 200802030915 10000
SMID0/17924 200802051030 333
SMID01/821 200802021150 55
SMIE1/13672 200802020822 120
SMIE1/13672 200802101430 310
SMIE1/13672 200803121500 50
SMRE1/13672 200803121610 100
SMRD1/17924 200802030915 10000
SMRD1/17924 200802051030 333
SMID11/821 200802021150 55
SMIE2/13672 200802020822 120
SMIE2/13672 200802101430 310
SMIE2/13672 200803121500 50
SMRE2/13672 200803121610 100
SMIE2/17924 200802030915 10000
SMIE2/17924 200802051030 333
SMIE21/821 200802021150 55
SMIE3/13672 200802020822 120
SMIE3/13672 200802101430 310
SMIE3/13672 200803121500 50
SMRE3/13672 200803121610 100
SMID3/17924 200802030915 10000
SMID3/17924 200802051030 333
SMID31/821 200802021150 55
SMIE4/13672 200802020822 120
SMIE4/13672 200802101430 310
SMIE4/13672 200803121500 50
SMRE4/13672 200803121610 100
SMID4/17924 200802030915 10000
SMID4/17924 200802051030 333
SMID41/821 200802021150 55
SMIE4/13673 200802020822 120
SMIE4/13673 200802101430 310
SMIE4/13673 200803121500 50
SMRE4/13673 200803121610 100
SMIE4/17924 200802030915 10000
SMRE4/17924 200802051030 333
SMIE41/821 200802021150 55
SMIE4/13673 200802020822 120
SMIF4/13673 200802101430 310
SMIF4/13673 200803121500 50
SMRF4/13673 200803121610 100
SMIF4/17924 200802030915 10000
SMRF4/17924 200802051030 333
SMIF41/821 200802021150 55
SMIG4/13673 200802101430 310
SMIG4/13673 200803121500 50
SMRG4/13673 200803121610 100
SMIG4/17924 200802030915 10000
SMRG4/17924 200802051030 333
SMIG41/82 200802021150 55
SMIH4/13673 200802101430 310
SMIH4/13673 200803121500 50
SMRH4/13673 200803121610 100
SMIH4/17924 200802030915 10000
SMRH4/17924 200802051030 333
SMIH41/82111 200802021150 55
SMRI4/13673 200803121610 100
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
16
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

SMII4/17924 200802030915 10000


SMRI4/17924 200802051030 333
SMII41/821 200802021150 55
SMRI5/13673 200803121610 100
SMII5/17924 200802030915 10000
SMRI5/17924 200802051030 333
SMII51/821 200802021150 55
SMRI6/13673 200803121610 100
SMRI6-13673 200802311010 1OO
SMII6/17924 200802030915 10000
SMRI6/17924 200802051030 --333
SMII66/821 200802021150 55
SMRI7/13673 200803121610 100
SMII7/17924 200802030915 10000
SMRI7/17924 200802051030 333
SMII76/821111200802021150 55
SMRI8/13673 200803121610 100
SMII8/17924 200802030915 10000
SMRI8/17924 200802051030 333
SMII86/82111 200802021150 55
SMRI9/13673 200803121610 100
SMII9/17924 200802030915 10000
MBII9/17924 200802030915 10000
SMBI9/17924 200802030915 10000
SMRI9/17924 200802051030 333
SMII96/821111200802021150 55

Report Output:

File: TASK0242.TXT

1 J E S 2 J O B L O G -- S Y S T E M S Y S 1 -- N O D E N 1
0
08.55.07 JOB01712 ---- TUESDAY, 06 OCT 2009 ----
08.55.07 JOB01712 IRR010I USERID P390A IS ASSIGNED TO THIS JOB.
08.55.07 JOB01712 ICH70001I P390A LAST ACCESS AT 08:54:48 ON TUESDAY, OCTOBER 6, 2009
08.55.07 JOB01712 $HASP373 P390AC STARTED - INIT 1 - CLASS A - SYS SYS1
08.55.07 JOB01712 IEF403I P390AC - STARTED - TIME=08.55.07
08.55.09 JOB01712 IEF404I P390AC - ENDED - TIME=08.55.09
08.55.09 JOB01712 $HASP395 P390AC ENDED
0------ JES2 JOB STATISTICS ------
- 06 OCT 2009 JOB EXECUTION DATE
- 7 CARDS READ
- 226 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 13 SYSOUT SPOOL KBYTES
- 0.03 MINUTES EXECUTION TIME
1 //P390AC JOB (),'HOFFMANN', JOB01712
// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
2 //PLICOMP EXEC PLIZG,MBR=EPSMSV4
3 XXIBMZG PROC LIBPRFX='CEE',MBR=TEST
XX*
XX********************************************************************
XX*
XX* IBM ENTERPRISE PL/I FOR Z/OS AND OS/390
XX* VERSION 3 RELEASE 3 MODIFICATION 0
XX*
XX* RUN A PL/I PROGRAM
XX*
XX* PARAMETER DEFAULT VALUE USAGE
XX* LNGPRFX IBMZ.V3R3M0 PREFIX FOR LANGUAGE DATA SET NAMES
XX* LIBPRFX CEE PREFIX FOR LIBRARY DATA SET NAMES
XX* MBR MEMBER NAME FOR PROGRAM LOAD MODULE
XX*
XX*********************************************************************
XX* RUN STEP
XX*********************************************************************
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
17
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

4 XXGO EXEC PGM=&MBR,


XX REGION=2048K
IEFC653I SUBSTITUTION JCL - PGM=EPSMSV4,REGION=2048K
5 XXSTEPLIB DD DSN=P390A.PGM.LOAD,DISP=SHR
6 XX DD DSN=&LIBPRFX..SCEERUN,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSN=CEE.SCEERUN,DISP=SHR
7 XXSYSPRINT DD SYSOUT=*
8 XXPRINT DD SYSOUT=*
9 XXCEEDUMP DD SYSOUT=*
10 XXSYSUDUMP DD SYSOUT=*
11 //GO.FSM DD DSN=P390A.RUN.DATA(SMT302),DISP=SHR
12 //GO.FSMS DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
13 //GO.FMSG DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=2420)
STMT NO. MESSAGE
2 IEFC001I PROCEDURE PLIZG WAS EXPANDED USING SYSTEM LIBRARY USER.PROCLIB
ICH70001I P390A LAST ACCESS AT 08:54:48 ON TUESDAY, OCTOBER 6, 2009
IEF236I ALLOC. FOR P390AC GO PLICOMP
IEF237I 0A90 ALLOCATED TO STEPLIB
IEF237I 0A81 ALLOCATED TO
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO PRINT
IEF237I JES2 ALLOCATED TO CEEDUMP
IEF237I JES2 ALLOCATED TO SYSUDUMP
IEF237I 0A90 ALLOCATED TO FSM
IEF237I JES2 ALLOCATED TO FSMS
IEF237I JES2 ALLOCATED TO FMSG
IEF142I P390AC GO PLICOMP - STEP WAS EXECUTED - COND CODE 0008
IEF285I P390A.PGM.LOAD KEPT
IEF285I VOL SER NOS= USR001.
IEF285I CEE.SCEERUN KEPT
IEF285I VOL SER NOS= Z5RES2.
IEF285I P390A.P390AC.JOB01712.D0000101.? SYSOUT
IEF285I P390A.P390AC.JOB01712.D0000102.? SYSOUT
IEF285I P390A.P390AC.JOB01712.D0000103.? SYSOUT
IEF285I P390A.P390AC.JOB01712.D0000104.? SYSOUT
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.P390AC.JOB01712.D0000105.? SYSOUT
IEF285I P390A.P390AC.JOB01712.D0000106.? SYSOUT
IEF373I STEP/GO /START 2009279.0855
IEF374I STEP/GO /STOP 2009279.0855 CPU 0MIN 00.37SEC SRB 0MIN 00.81SEC VIRT 100K SYS 252K
EXT 6940K SYS 9220K
IEF375I JOB/P390AC /START 2009279.0855
IEF376I JOB/P390AC /STOP 2009279.0855 CPU 0MIN 00.37SEC SRB 0MIN 00.81SEC
1--- Stores Movement Summary Page: 1
Report: SMS XYZ FACTORY Date: 06.10.09
Part_Number Receipts Issues Net_Summary
_______________________________________________________
A5/13672 100 480 -380
A5/17924 10000 333 +9667
A5/820 0 55 -55
A5 10100 868 +9232
0A6/13672 100 480 -380
A6/17924 10000 333 +9667
A6 10100 813 +9287
0A61/821 0 55 -55
A61 0 55 -55
0A7/13672 100 480 -380
A7/17924 10000 333 +9667
A7 10100 813 +9287
0A71/821 0 55 -55
A71 0 55 -55
0B7/13672 100 480 -380
B7/17924 10000 333 +9667
B7 10100 813 +9287
0B71/823 0 55 -55
B71 0 55 -55
0C7/13672 100 480 -380
C7/17924 10000 333 +9667
C7 10100 813 +9287
0C71/823 0 55 -55
C71 0 55 -55
0D7/13672 100 480 -380
D7/17924 10000 333 +9667
D7 10100 813 +9287
0D71/823 0 55 -55
D71 0 55 -55

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
18
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

0D8/13672 100 480 -380


D8/17924 10000 333 +9667
D8 10100 813 +9287
0D81/8211 0 55 -55
D81 0 55 -55
0D9/13672 100 480 -380
D9/17924 10000 333 +9667
D9 10100 813 +9287
0D91/821 0 55 -55
D91 0 55 -55
0E0/13672 100 480 -380
E0 100 480 -380
1--- Stores Movement Summary Page: 2
Report: SMS XYZ FACTORY Date: 06.10.09
Part_Number Receipts Issues Net_Summary
_______________________________________________________
0D0/17924 10000 333 +9667
D0 10000 333 +9667
0D01/821 0 55 -55
D01 0 55 -55
0E1/13672 100 480 -380
E1 100 480 -380
0D1/17924 10333 0 +10333
D1 10333 0 +10333
0D11/821 0 55 -55
D11 0 55 -55
0E2/13672 100 480 -380
E2/17924 0 10333 -10333
E2 100 10813 -10713
0E21/821 0 55 -55
E21 0 55 -55
0E3/13672 100 480 -380
E3 100 480 -380
0D3/17924 0 10333 -10333
D3 0 10333 -10333
0D31/821 0 55 -55
D31 0 55 -55
0E4/13672 100 480 -380
E4 100 480 -380
0D4/17924 0 10333 -10333
D4 0 10333 -10333
0D41/821 0 55 -55
D41 0 55 -55
0E4/13673 100 480 -380
E4/17924 333 10000 -9667
E4 433 10480 -10047
0E41/821 0 55 -55
E41 0 55 -55
0E4/13673 0 120 -120
E4 0 120 -120
0F4/13673 100 360 -260
F4/17924 333 10000 -9667
F4 433 10360 -9927
0F41/821 0 55 -55
1--- Stores Movement Summary Page: 3
Report: SMS XYZ FACTORY Date: 06.10.09
Part_Number Receipts Issues Net_Summary
_______________________________________________________
F41 0 55 -55
0G4/13673 100 360 -260
G4/17924 333 10000 -9667
G4 433 10360 -9927
0H4/13673 100 360 -260
H4/17924 333 10000 -9667
H4 433 10360 -9927
0H41/82111 0 55 -55
H41 0 55 -55
0I4/13673 100 0 +100
I4/17924 333 10000 -9667
I4 433 10000 -9567
0I41/821 0 55 -55
I41 0 55 -55
0I5/13673 100 0 +100
I5/17924 333 10000 -9667
I5 433 10000 -9567
0I51/821 0 55 -55
I51 0 55 -55

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
19
Software Engineering - Task 2: Stores Movement Summary - Maintenance Date: 10/25/2009

0I6/13673 100 0 +100


I6/17924 0 10000 -10000
I6 100 10000 -9900
0I66/821 0 55 -55
I66 0 55 -55
0I7/13673 100 0 +100
I7/17924 333 10000 -9667
I7 433 10000 -9567
0I76/821111 0 55 -55
I76 0 55 -55
0I8/13673 100 0 +100
I8/17924 333 10000 -9667
I8 433 10000 -9567
0I86/82111 0 55 -55
I86 0 55 -55
0I9/13673 100 0 +100
I9/17924 333 10000 -9667
I9 433 10000 -9567
0I96/821111 0 55 -55
I96 0 55 -55

1--- Store Movements Report --- Messages --- PAGE: 1


MSG_No 1***5****10***5****20***5****30***5****40***5****50***5****60**5****70***5****80 Date: 06.10.09
ISMS01 V3PSMSV4 Started.
0ISMS02 SMIG41/82 200802021150 55 **in error,see below.
FSMS03 PART NUMBER G41/82 has an erroneous specification. See PGM description.
0ISMS02 SMRI6-13673 200802311010 1OO **in error,see below.
FSMS03 PART NUMBER I6-13673 has an erroneous specification. See PGM description.
FSMS04 Date 20080231 is wrong. Needed Format: YYYYMMDD or value is false.
FSMS05 Quantity 1OO has not a positive numeric value.
0ISMS02 SMRI6/17924 200802051030 --333 **in error,see below.
FSMS05 Quantity --333 has not a positive numeric value.
0ISMS02 MBII9/17924 200802030915 10000 **in error,see below.
FSMS01 Record_ID MB is not SM as inspected.
0ISMS02 SMBI9/17924 200802030915 10000 **in error,see below.
FSMS02 Record_Type B is wrong. Allowed are I or R.
ISMS01 V3PSMSV4 ended.

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page:
20
Software Engineering - Task 3: Merge 2 Data Sets V01 Date: 10/25/2009

PGM: EPMERG1 - Main program


File: V3PMERG1.TXT
*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001000
*PROCESS AGGREGATE, OFFSET, CMPAT(V1); 00002000
*PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); 00003000
/*PPL-TITLE: Task 03: Merge File FIA, FIB to File FOUT */ 00004000
/********************************************************************/ 00005000
/* Merge two datasets V01 */ 00006000
/* Publications: see PGM Design Task 03,Example 1 */ 00007000
/* */ 00008000
/* Author: Dipl.Ing. Werner Hoffmann */ 00009000
/* Date Written: 1907/03/05 */ 00010000
/* Date Changed: 2008/08/28 */ 00020000
/* */ 00030000
/* PROCEDURE: MAIN */ 00031000
/* TASK: This program merge two files to one output file. */ 00032000
/* */ 00033000
/* Files: */ 00034000
/* Input: FIA - Input File */ 00034100
/* FIB - Input File */ 00034200
/* Output: FOUT- Output File */ 00034300
/* Notes: - */ 00034400
/* */ 00034500
/********************************************************************/ 00034600
EPMERG1: 00034700
PROC OPTIONS(MAIN) REORDER; 00034800
00034900
/*** File FIA ---------------------------------------------------*/ 00035000
DCL FIA FILE RECORD INPUT /* File IA */ 00036000
ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); 00037000
DCL PIA POINTER STATIC; /*Pointer to IA Record */ 00038000
DCL 1 SIA BASED(PIA), /*IA Record Layout */ 00039000
2 XKEY CHAR(10), /*Key */ 00040000
2 XTEXT CHAR(70); /*Text */ 00050000
00060000
/*** File FIB ---------------------------------------------------*/ 00070000
DCL FIB FILE RECORD INPUT /* File IB */ 00080000
ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); 00090000
DCL PIB POINTER STATIC; /*Pointer to IA Record */ 00100000
DCL 1 SIB BASED(PIB), /*IA Record Layout */ 00101000
2 XKEY CHAR(10), /*Key */ 00102000
2 XTEXT CHAR(70); /*Text */ 00103000
00104000
/*** FILE FOUT --------------------------------------------------*/ 00105000
DCL FOUT FILE RECORD OUTPUT /* */ 00106000
ENV(CONSECUTIVE RECSIZE(80)); 00107000
00108000
DCL XCB CHAR(20) STATIC; /*Group Control Block */ 00109000
DCL 1 SCB DEF XCB, /*Group Control Block */ 00110000
2 XKEYIA CHAR(10), /*Current key record IA */ 00120000
2 XKEYIB CHAR(10); /*Current key record IB */ 00130000
00140000
/*** Builtin Functions ------------------------------------------*/ 00141000
DCL HIGH BUILTIN; /* */ 00142000
00142100
/*H1.1 Initate Routine --------------------------------------------*/ 00142200
OPEN FILE(FIA) INPUT; /*Open File IA */ 00142300
OPEN FILE(FIB) INPUT; /*Open File IB */ 00142400
OPEN FILE(FOUT) OUTPUT; /*Open File OUT */ 00142500
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 1
Software Engineering - Task 3: Merge 2 Data Sets V01 Date: 10/25/2009

/*H2 Merge File IA, IB to file OUT ==============================*/ 00142700


/*H3 Process Group O --------------------------------------------*/ 00142800
CALL EGETIA; /*Get first record file IA */ 00143000
CALL EGETIB; /*Get first record file IB */ 00144000
DO WHILE(XCB¬=HIGH(20)); /*More to do? */ 00145000
/*H4.1 Process one Group IA-----------------------------------------*/ 00147000
DO WHILE((XCB¬=HIGH(20)) & SCB.XKEYIA<=SCB.XKEYIB); 00148000
/*H4.1.1 Process record IA -----------------------------------------*/ 00150000
WRITE FILE(FOUT) FROM(SIA); 00160000
CALL EGETIA; 00161000
END; 00161100
/*H4.2 Process one Group IB ----------------------------------------*/ 00161200
DO WHILE((XCB¬=HIGH(20)) & SCB.XKEYIB<SCB.XKEYIA); 00161300
/*H4.2.1 Process IB record -----------------------------------------*/ 00161500
WRITE FILE(FOUT) FROM(SIB); 00161600
CALL EGETIB; 00161700
END; 00161800
END; 00161900
/*H1.2 Termination Routine ----------------------------------------*/ 00162000
CLOSE FILE(*); /*Close all Open Files */ 00164000
00165000
EGETIA: PROC REORDER; 00166000
/********************************************************************/ 00167000
/* FIA Record Processing */ 00167100
/* Task:-Get and return one IA record. */ 00167200
/********************************************************************/ 00167300
DCL HIGH BUILTIN; /* */ 00167400
00167500
/*HG1.0 Initiation routine -----------------------------------------*/ 00167600
ON ENDFILE(FIA) /*Set EOF Condition */ 00167700
BEGIN; 00167800
SCB.XKEYIA = HIGH(10); /*signal EOF Condition */ 00167900
GOTO LRETURN; /*nothing to do anymore */ 00169000
END; 00169100
00169105
/*HG2 Read and prepare record for processing. */ 00169200
READ FILE(FIA) SET(PIA); /*GET NEXT FIA RECORD */ 00169300
SCB.XKEYIA = SIA.XKEY; /*Save key into SCB */ 00169400
LRETURN: 00169600
RETURN; 00169700
END EGETIA; 00169800
00169900
EGETIB: PROC REORDER; 00170000
/********************************************************************/ 00171000
/* FIB Record Processing */ 00172000
/* Task:-Get and return one IB record. */ 00173000
/********************************************************************/ 00174000
DCL HIGH BUILTIN; /* */ 00175000
00176000
/*HG1.0 Initiation routine -----------------------------------------*/ 00177000
ON ENDFILE(FIB) /*Set EOF Condition */ 00178000
BEGIN; 00179000
SCB.XKEYIB = HIGH(10); /*signal EOF Condition */ 00180000
GOTO LRETURN; /*nothing to do anymore */ 00190100
END; 00190200
00190205
/*HG2 Read and prepare record for processing. */ 00190300
READ FILE(FIB) SET(PIB); /*GET NEXT FIB RECORD */ 00190400
SCB.XKEYIB = SIB.XKEY; /*Save key into SCB */ 00190500
LRETURN: 00190700
RETURN; 00190800
END EGETIB; 00190900
00191000
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 2
Software Engineering - Task 3: Merge 2 Data Sets V01 Date: 10/25/2009

END EPMERG1; 00192000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 3
Software Engineering - Task 3: Merge 2 Data Sets V01 Date: 10/25/2009

JCL:

File: TASK03M.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZCL,MBR=V3PMERG1
//* VERSION V01
//LKED.SYSIN DD *
NAME EPMERG1(R)
/*
//

File: TASK03G.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZG,MBR=EPMERG1
//* VERSION V01
//GO.FIA DD DSN=P390A.RUN.DATA(T03IA),DISP=SHR
//GO.FIB DD DSN=P390A.RUN.DATA(T03IB),DISP=SHR
//GO.FOUT DD DSN=P390A.RUN.DATA(T03OUT11),DISP=SHR
//GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
//PLICOMP EXEC PLIZG,MBR=EPMERG1
//* VERSION V01
//GO.FIA DD DSN=P390A.RUN.DATA(T03IA2),DISP=SHR
//GO.FIB DD DSN=P390A.RUN.DATA(T03IB2),DISP=SHR
//GO.FOUT DD DSN=P390A.RUN.DATA(T03OUT12),DISP=SHR
//GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
//

Test Data:

Test 1:

File FIA: T03IA.txt

0000000004File IA
0000000005File IA
0000000006File IA
0000000007File IA
0000000009File IA

File FIB: T03IB.txt

0000000001File IB
0000000002File IB
0000000003File IB
0000000004File IB
0000000007File IB
0000000008File IB

Test 2:

File FIA: T03IA2.txt

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 4
Software Engineering - Task 3: Merge 2 Data Sets V01 Date: 10/25/2009

0000000001File IA
0000000002File IA
0000000003File IA
0000000004File IA
0000000007File IA
0000000008File IA

File FIB: T03IB2.txt

0000000004File IB
0000000005File IB
0000000006File IB
0000000007File IB
0000000009File IB

Report Output:

File: TASK03G1.TXT similar for both tests…

1 J E S 2 J O B L O G -- S Y S T E M S Y S 1 -- N O D E N 1
0
09.34.09 JOB01934 ---- TUESDAY, 13 OCT 2009 ----
09.34.09 JOB01934 IRR010I USERID P390A IS ASSIGNED TO THIS JOB.
09.34.10 JOB01934 ICH70001I P390A LAST ACCESS AT 09:33:47 ON TUESDAY, OCTOBER 13, 2009
09.34.10 JOB01934 $HASP373 P390AC STARTED - INIT 1 - CLASS A - SYS SYS1
09.34.10 JOB01934 IEF403I P390AC - STARTED - TIME=09.34.10
09.34.13 JOB01934 IEF404I P390AC - ENDED - TIME=09.34.13
09.34.14 JOB01934 $HASP395 P390AC ENDED
0------ JES2 JOB STATISTICS ------
- 13 OCT 2009 JOB EXECUTION DATE
- 15 CARDS READ
- 145 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 7 SYSOUT SPOOL KBYTES
- 0.06 MINUTES EXECUTION TIME
1 //P390AC JOB (),'HOFFMANN', JOB01934
// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
2 //PLICOMP EXEC PLIZG,MBR=EPMERG1
3 XXIBMZG PROC LIBPRFX='CEE',MBR=TEST
XX*
XX********************************************************************
XX*
XX* IBM ENTERPRISE PL/I FOR Z/OS AND OS/390
XX* VERSION 3 RELEASE 3 MODIFICATION 0
XX*
XX* RUN A PL/I PROGRAM
XX*
XX* PARAMETER DEFAULT VALUE USAGE
XX* LNGPRFX IBMZ.V3R3M0 PREFIX FOR LANGUAGE DATA SET NAMES
XX* LIBPRFX CEE PREFIX FOR LIBRARY DATA SET NAMES
XX* MBR MEMBER NAME FOR PROGRAM LOAD MODULE
XX*
XX*********************************************************************
XX* RUN STEP
XX*********************************************************************
4 XXGO EXEC PGM=&MBR,
XX REGION=2048K
IEFC653I SUBSTITUTION JCL - PGM=EPMERG1,REGION=2048K
5 XXSTEPLIB DD DSN=P390A.PGM.LOAD,DISP=SHR
6 XX DD DSN=&LIBPRFX..SCEERUN,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSN=CEE.SCEERUN,DISP=SHR
7 //GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
X/SYSPRINT DD SYSOUT=*
8 XXPRINT DD SYSOUT=*
9 XXCEEDUMP DD SYSOUT=*
10 XXSYSUDUMP DD SYSOUT=*
//* VERSION V01
11 //GO.FIA DD DSN=P390A.RUN.DATA(T03IA),DISP=SHR
12 //GO.FIB DD DSN=P390A.RUN.DATA(T03IB),DISP=SHR
13 //GO.FOUT DD DSN=P390A.RUN.DATA(T03OUT11),DISP=SHR
14 //PLICOMP EXEC PLIZG,MBR=EPMERG1
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 5
Software Engineering - Task 3: Merge 2 Data Sets V01 Date: 10/25/2009

15 XXIBMZG PROC LIBPRFX='CEE',MBR=TEST


XX*
XX********************************************************************
XX*
XX* IBM ENTERPRISE PL/I FOR Z/OS AND OS/390
XX* VERSION 3 RELEASE 3 MODIFICATION 0
XX*
XX* RUN A PL/I PROGRAM
XX*
XX* PARAMETER DEFAULT VALUE USAGE
XX* LNGPRFX IBMZ.V3R3M0 PREFIX FOR LANGUAGE DATA SET NAMES
XX* LIBPRFX CEE PREFIX FOR LIBRARY DATA SET NAMES
XX* MBR MEMBER NAME FOR PROGRAM LOAD MODULE
XX*
XX*********************************************************************
XX* RUN STEP
XX*********************************************************************
16 XXGO EXEC PGM=&MBR,
XX REGION=2048K
IEFC653I SUBSTITUTION JCL - PGM=EPMERG1,REGION=2048K
17 XXSTEPLIB DD DSN=P390A.PGM.LOAD,DISP=SHR
18 XX DD DSN=&LIBPRFX..SCEERUN,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSN=CEE.SCEERUN,DISP=SHR
19 //GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
X/SYSPRINT DD SYSOUT=*
20 XXPRINT DD SYSOUT=*
21 XXCEEDUMP DD SYSOUT=*
22 XXSYSUDUMP DD SYSOUT=*
//* VERSION V01
23 //GO.FIA DD DSN=P390A.RUN.DATA(T03IA2),DISP=SHR
24 //GO.FIB DD DSN=P390A.RUN.DATA(T03IB2),DISP=SHR
25 //GO.FOUT DD DSN=P390A.RUN.DATA(T03OUT12),DISP=SHR
STMT NO. MESSAGE
2 IEFC001I PROCEDURE PLIZG WAS EXPANDED USING SYSTEM LIBRARY USER.PROCLIB
14 IEFC001I PROCEDURE PLIZG WAS EXPANDED USING SYSTEM LIBRARY USER.PROCLIB
ICH70001I P390A LAST ACCESS AT 09:33:47 ON TUESDAY, OCTOBER 13, 2009
IEF236I ALLOC. FOR P390AC GO PLICOMP
IEF237I 0A90 ALLOCATED TO STEPLIB
IEF237I 0A81 ALLOCATED TO
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO PRINT
IEF237I JES2 ALLOCATED TO CEEDUMP
IEF237I JES2 ALLOCATED TO SYSUDUMP
IEF237I 0A90 ALLOCATED TO FIA
IEF237I 0A90 ALLOCATED TO FIB
IEF237I 0A90 ALLOCATED TO FOUT
IEF142I P390AC GO PLICOMP - STEP WAS EXECUTED - COND CODE 0000
IEF285I P390A.PGM.LOAD KEPT
IEF285I VOL SER NOS= USR001.
IEF285I CEE.SCEERUN KEPT
IEF285I VOL SER NOS= Z5RES2.
IEF285I P390A.P390AC.JOB01934.D0000101.? SYSOUT
IEF285I P390A.P390AC.JOB01934.D0000102.? SYSOUT
IEF285I P390A.P390AC.JOB01934.D0000103.? SYSOUT
IEF285I P390A.P390AC.JOB01934.D0000104.? SYSOUT
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF373I STEP/GO /START 2009286.0934
IEF374I STEP/GO /STOP 2009286.0934 CPU 0MIN 00.34SEC SRB 0MIN 00.73SEC VIRT 104K SYS 260K
EXT 7036K SYS 9216K
IEF236I ALLOC. FOR P390AC GO PLICOMP
IEF237I 0A90 ALLOCATED TO STEPLIB
IEF237I 0A81 ALLOCATED TO
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO PRINT
IEF237I JES2 ALLOCATED TO CEEDUMP
IEF237I JES2 ALLOCATED TO SYSUDUMP
IEF237I 0A90 ALLOCATED TO FIA
IEF237I 0A90 ALLOCATED TO FIB
IEF237I 0A90 ALLOCATED TO FOUT
IEF142I P390AC GO PLICOMP - STEP WAS EXECUTED - COND CODE 0000
IEF285I P390A.PGM.LOAD KEPT
IEF285I VOL SER NOS= USR001.
IEF285I CEE.SCEERUN KEPT

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 6
Software Engineering - Task 3: Merge 2 Data Sets V01 Date: 10/25/2009

IEF285I VOL SER NOS= Z5RES2.


IEF285I P390A.P390AC.JOB01934.D0000105.? SYSOUT
IEF285I P390A.P390AC.JOB01934.D0000106.? SYSOUT
IEF285I P390A.P390AC.JOB01934.D0000107.? SYSOUT
IEF285I P390A.P390AC.JOB01934.D0000108.? SYSOUT
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF373I STEP/GO /START 2009286.0934
IEF374I STEP/GO /STOP 2009286.0934 CPU 0MIN 00.51SEC SRB 0MIN 00.72SEC VIRT 104K SYS 260K
EXT 7036K SYS 9216K
IEF375I JOB/P390AC /START 2009286.0934
IEF376I JOB/P390AC /STOP 2009286.0934 CPU 0MIN 00.85SEC SRB 0MIN 01.45SEC

Output Data:

Test 1 V01:

File FOUT: T03OUT11.txt

0000000001File IB
0000000002File IB
0000000003File IB
0000000004File IA
0000000004File IB
0000000005File IA
0000000006File IA
0000000007File IA
0000000007File IB
0000000008File IB
0000000009File IA

Test 2 V01:

File FOUT: T03OUT12.txt

0000000001File IA
0000000002File IA
0000000003File IA
0000000004File IA
0000000004File IB
0000000005File IB
0000000006File IB
0000000007File IA
0000000007File IB
0000000008File IA
0000000009File IB

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 7
Software Engineering - Task 3: Merge 2 Data Sets V02 Date: 10/25/2009

PGM: EPMERG2 - Main program


File: V3PMERG2.TXT
*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001000
*PROCESS AGGREGATE, OFFSET, CMPAT(V1); 00002000
*PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); 00003000
/*PPL-TITLE: Task 03: Merge File FIA, FIB to File FOUT */ 00004000
/********************************************************************/ 00005000
/* Merge two datasets V02 */ 00006000
/* Publications: see PGM Design Task 03,Example 1 */ 00007000
/* */ 00008000
/* Author: Dipl.Ing. Werner Hoffmann */ 00009000
/* Date Written: 1907/03/05 */ 00010000
/* Date Changed: 2008/08/28 */ 00020000
/* */ 00030000
/* PROCEDURE: MAIN */ 00031000
/* TASK: This program merge two files to one output file. */ 00032000
/* */ 00033000
/* Files: */ 00034000
/* Input: FIA - Input File */ 00034100
/* FIB - Input File */ 00034200
/* Output: FOUT- Output File */ 00034300
/* Notes: - */ 00034400
/* */ 00034500
/********************************************************************/ 00034600
EPMERG2: 00034700
PROC OPTIONS(MAIN) REORDER; 00034800
00034900
/*** File FIA ---------------------------------------------------*/ 00035000
DCL FIA FILE RECORD INPUT /* File IA */ 00036000
ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); 00037000
DCL PIA POINTER STATIC; /*Pointer to IA Record */ 00038000
DCL 1 SIA BASED(PIA), /*IA Record Layout */ 00039000
2 XKEY CHAR(10), /*Key */ 00040000
2 XTEXT CHAR(70); /*Text */ 00050000
00060000
/*** File FIB ---------------------------------------------------*/ 00070000
DCL FIB FILE RECORD INPUT /* File IB */ 00080000
ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); 00090000
DCL PIB POINTER STATIC; /*Pointer to IA Record */ 00100000
DCL 1 SIB BASED(PIB), /*IA Record Layout */ 00101000
2 XKEY CHAR(10), /*Key */ 00102000
2 XTEXT CHAR(70); /*Text */ 00103000
00104000
/*** FILE FOUT --------------------------------------------------*/ 00105000
DCL FOUT FILE RECORD OUTPUT /* */ 00106000
ENV(CONSECUTIVE RECSIZE(80)); 00107000
00108000
DCL XCB CHAR(20) STATIC; /*Group Control Block */ 00109000
DCL 1 SCB DEF XCB, /*Group Control Block */ 00110000
2 XKEYIA CHAR(10), /*Current key record IA */ 00120000
2 XKEYIB CHAR(10); /*Current key record IB */ 00130000
00140000
/*** Builtin Functions ------------------------------------------*/ 00141000
DCL HIGH BUILTIN; /* */ 00142000
00142100
/*H1.1 Initate Routine --------------------------------------------*/ 00142200
OPEN FILE(FIA) INPUT; /*Open File IA */ 00142300
OPEN FILE(FIB) INPUT; /*Open File IB */ 00142400
OPEN FILE(FOUT) OUTPUT; /*Open File OUT */ 00142500
/*H2 Merge File IA, IB to file OUT ==============================*/ 00142700
/*H3 Process Group O --------------------------------------------*/ 00142800
CALL EGETIA; /*Get first record file IA */ 00143000
CALL EGETIB; /*Get first record file IB */ 00144000
DO WHILE(XCB¬=HIGH(20)); /*More to do? */ 00145000
/*H4.1 Process one input record IA or IB ---------------------------*/ 00147000
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 1
Software Engineering - Task 3: Merge 2 Data Sets V02 Date: 10/25/2009

IF SCB.XKEYIA<=SCB.XKEYIB 00148000
THEN 00149000
DO; 00149100
/*H4.1.1 Process record IA -----------------------------------------*/ 00150000
WRITE FILE(FOUT) FROM(SIA); 00160000
CALL EGETIA; 00161000
END; 00161100
/*H4.2 Process one Group IB ----------------------------------------*/ 00161200
ELSE 00161300
DO; 00161400
/*H4.2.1 Process IB record -----------------------------------------*/ 00161500
WRITE FILE(FOUT) FROM(SIB); 00161600
CALL EGETIB; 00161700
END; 00161800
END; 00161900
/*H1.2 Termination Routine ----------------------------------------*/ 00162000
CLOSE FILE(*); /*Close all Open Files */ 00164000
00165000
EGETIA: PROC REORDER; 00166000
/********************************************************************/ 00167000
/* FIA Record Processing */ 00167100
/* Task:-Get and return one IA record. */ 00167200
/********************************************************************/ 00167300
DCL HIGH BUILTIN; /* */ 00167400
00167500
/*HG1.0 Initiation routine -----------------------------------------*/ 00167600
ON ENDFILE(FIA) /*Set EOF Condition */ 00167700
BEGIN; 00167800
SCB.XKEYIA = HIGH(10); /*signal EOF Condition */ 00167900
GOTO LRETURN; /*nothing to do anymore */ 00169000
END; 00169100
00169200
/*HG2 Read and prepare record for processing. */ 00169205
READ FILE(FIA) SET(PIA); /*GET NEXT FIA RECORD */ 00169300
SCB.XKEYIA = SIA.XKEY; /*SAve key into SCB */ 00169400
LRETURN: 00169600
RETURN; 00169700
END EGETIA; 00169800
00169900
EGETIB: PROC REORDER; 00170000
/********************************************************************/ 00171000
/* FIB Record Processing */ 00172000
/* Task:-Get and return one IB record. */ 00173000
/********************************************************************/ 00174000
DCL HIGH BUILTIN; /* */ 00175000
00176000
/*HG1.0 Initiation routine -----------------------------------------*/ 00177000
ON ENDFILE(FIB) /*Set EOF Condition */ 00178000
BEGIN; 00179000
SCB.XKEYIB = HIGH(10); /*signal EOF Condition */ 00180000
GOTO LRETURN; /*nothing to do anymore */ 00190100
END; 00190200
00190300
/*HG2 Read and prepare record for processing. */ 00169200
READ FILE(FIB) SET(PIB); /*GET NEXT FIB RECORD */ 00190400
SCB.XKEYIB = SIB.XKEY; /*Save key into SCB */ 00190500
LRETURN: 00190700
RETURN; 00190800
END EGETIB; 00190900
00191000
END EPMERG2; 00192000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 2
Software Engineering - Task 3: Merge 2 Data Sets V02 Date: 10/25/2009

JCL:

File: TASK03M.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZCL,MBR=V3PMERG2
//* VERSION V01
//LKED.SYSIN DD *
NAME EPMERG1(R)
/*
//

File: TASK03G.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZG,MBR=EPMERG2
//* VERSION V01
//GO.FIA DD DSN=P390A.RUN.DATA(T03IA),DISP=SHR
//GO.FIB DD DSN=P390A.RUN.DATA(T03IB),DISP=SHR
//GO.FOUT DD DSN=P390A.RUN.DATA(T03OUT21),DISP=SHR
//GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
//PLICOMP EXEC PLIZG,MBR=EPMERG1
//* VERSION V01
//GO.FIA DD DSN=P390A.RUN.DATA(T03IA2),DISP=SHR
//GO.FIB DD DSN=P390A.RUN.DATA(T03IB2),DISP=SHR
//GO.FOUT DD DSN=P390A.RUN.DATA(T03OUT22),DISP=SHR
//GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
//

Test Data:

Test 1:

File FIA: T03IA.txt

0000000004File IA
0000000005File IA
0000000006File IA
0000000007File IA
0000000009File IA

File FIB: T03IB.txt

0000000001File IB
0000000002File IB
0000000003File IB
0000000004File IB
0000000007File IB
0000000008File IB

Test 2:

File FIA: T03IA2.txt

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 3
Software Engineering - Task 3: Merge 2 Data Sets V02 Date: 10/25/2009

0000000001File IA
0000000002File IA
0000000003File IA
0000000004File IA
0000000007File IA
0000000008File IA

File FIB: T03IB2.txt

0000000004File IB
0000000005File IB
0000000006File IB
0000000007File IB
0000000009File IB

Report Output:

File: TASK03G2.TXT
1 J E S 2 J O B L O G -- S Y S T E M S Y S 1 -- N O D E N 1
0
09.36.20 JOB01935 ---- TUESDAY, 13 OCT 2009 ----
09.36.20 JOB01935 IRR010I USERID P390A IS ASSIGNED TO THIS JOB.
09.36.20 JOB01935 ICH70001I P390A LAST ACCESS AT 09:34:10 ON TUESDAY, OCTOBER 13, 2009
09.36.20 JOB01935 $HASP373 P390AC STARTED - INIT 1 - CLASS A - SYS SYS1
09.36.20 JOB01935 IEF403I P390AC - STARTED - TIME=09.36.20
09.36.25 JOB01935 IEF404I P390AC - ENDED - TIME=09.36.25
09.36.25 JOB01935 $HASP395 P390AC ENDED
0------ JES2 JOB STATISTICS ------
- 13 OCT 2009 JOB EXECUTION DATE
- 15 CARDS READ
- 145 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 7 SYSOUT SPOOL KBYTES
- 0.09 MINUTES EXECUTION TIME
1 //P390AC JOB (),'HOFFMANN', JOB01935
// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
2 //PLICOMP EXEC PLIZG,MBR=EPMERG2
3 XXIBMZG PROC LIBPRFX='CEE',MBR=TEST
XX*
XX********************************************************************
XX*
XX* IBM ENTERPRISE PL/I FOR Z/OS AND OS/390
XX* VERSION 3 RELEASE 3 MODIFICATION 0
XX*
XX* RUN A PL/I PROGRAM
XX*
XX* PARAMETER DEFAULT VALUE USAGE
XX* LNGPRFX IBMZ.V3R3M0 PREFIX FOR LANGUAGE DATA SET NAMES
XX* LIBPRFX CEE PREFIX FOR LIBRARY DATA SET NAMES
XX* MBR MEMBER NAME FOR PROGRAM LOAD MODULE
XX*
XX*********************************************************************
XX* RUN STEP
XX*********************************************************************
4 XXGO EXEC PGM=&MBR,
XX REGION=2048K
IEFC653I SUBSTITUTION JCL - PGM=EPMERG2,REGION=2048K
5 XXSTEPLIB DD DSN=P390A.PGM.LOAD,DISP=SHR
6 XX DD DSN=&LIBPRFX..SCEERUN,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSN=CEE.SCEERUN,DISP=SHR
7 //GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
X/SYSPRINT DD SYSOUT=*
8 XXPRINT DD SYSOUT=*
9 XXCEEDUMP DD SYSOUT=*
10 XXSYSUDUMP DD SYSOUT=*
//* VERSION V02
11 //GO.FIA DD DSN=P390A.RUN.DATA(T03IA),DISP=SHR
12 //GO.FIB DD DSN=P390A.RUN.DATA(T03IB),DISP=SHR
13 //GO.FOUT DD DSN=P390A.RUN.DATA(T03OUT21),DISP=SHR
14 //PLICOMP EXEC PLIZG,MBR=EPMERG2
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 4
Software Engineering - Task 3: Merge 2 Data Sets V02 Date: 10/25/2009

15 XXIBMZG PROC LIBPRFX='CEE',MBR=TEST


XX*
XX********************************************************************
XX*
XX* IBM ENTERPRISE PL/I FOR Z/OS AND OS/390
XX* VERSION 3 RELEASE 3 MODIFICATION 0
XX*
XX* RUN A PL/I PROGRAM
XX*
XX* PARAMETER DEFAULT VALUE USAGE
XX* LNGPRFX IBMZ.V3R3M0 PREFIX FOR LANGUAGE DATA SET NAMES
XX* LIBPRFX CEE PREFIX FOR LIBRARY DATA SET NAMES
XX* MBR MEMBER NAME FOR PROGRAM LOAD MODULE
XX*
XX*********************************************************************
XX* RUN STEP
XX*********************************************************************
16 XXGO EXEC PGM=&MBR,
XX REGION=2048K
IEFC653I SUBSTITUTION JCL - PGM=EPMERG2,REGION=2048K
17 XXSTEPLIB DD DSN=P390A.PGM.LOAD,DISP=SHR
18 XX DD DSN=&LIBPRFX..SCEERUN,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSN=CEE.SCEERUN,DISP=SHR
19 //GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2660)
X/SYSPRINT DD SYSOUT=*
20 XXPRINT DD SYSOUT=*
21 XXCEEDUMP DD SYSOUT=*
22 XXSYSUDUMP DD SYSOUT=*
//* VERSION V02
23 //GO.FIA DD DSN=P390A.RUN.DATA(T03IA2),DISP=SHR
24 //GO.FIB DD DSN=P390A.RUN.DATA(T03IB2),DISP=SHR
25 //GO.FOUT DD DSN=P390A.RUN.DATA(T03OUT22),DISP=SHR
STMT NO. MESSAGE
2 IEFC001I PROCEDURE PLIZG WAS EXPANDED USING SYSTEM LIBRARY USER.PROCLIB
14 IEFC001I PROCEDURE PLIZG WAS EXPANDED USING SYSTEM LIBRARY USER.PROCLIB
ICH70001I P390A LAST ACCESS AT 09:34:10 ON TUESDAY, OCTOBER 13, 2009
IEF236I ALLOC. FOR P390AC GO PLICOMP
IEF237I 0A90 ALLOCATED TO STEPLIB
IEF237I 0A81 ALLOCATED TO
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO PRINT
IEF237I JES2 ALLOCATED TO CEEDUMP
IEF237I JES2 ALLOCATED TO SYSUDUMP
IEF237I 0A90 ALLOCATED TO FIA
IEF237I 0A90 ALLOCATED TO FIB
IEF237I 0A90 ALLOCATED TO FOUT
IEF142I P390AC GO PLICOMP - STEP WAS EXECUTED - COND CODE 0000
IEF285I P390A.PGM.LOAD KEPT
IEF285I VOL SER NOS= USR001.
IEF285I CEE.SCEERUN KEPT
IEF285I VOL SER NOS= Z5RES2.
IEF285I P390A.P390AC.JOB01935.D0000101.? SYSOUT
IEF285I P390A.P390AC.JOB01935.D0000102.? SYSOUT
IEF285I P390A.P390AC.JOB01935.D0000103.? SYSOUT
IEF285I P390A.P390AC.JOB01935.D0000104.? SYSOUT
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF373I STEP/GO /START 2009286.0936
IEF374I STEP/GO /STOP 2009286.0936 CPU 0MIN 00.39SEC SRB 0MIN 00.78SEC VIRT 104K SYS 260K
EXT 7036K SYS 9216K
IEF236I ALLOC. FOR P390AC GO PLICOMP
IEF237I 0A90 ALLOCATED TO STEPLIB
IEF237I 0A81 ALLOCATED TO
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO PRINT
IEF237I JES2 ALLOCATED TO CEEDUMP
IEF237I JES2 ALLOCATED TO SYSUDUMP
IEF237I 0A90 ALLOCATED TO FIA
IEF237I 0A90 ALLOCATED TO FIB
IEF237I 0A90 ALLOCATED TO FOUT
IEF142I P390AC GO PLICOMP - STEP WAS EXECUTED - COND CODE 0000
IEF285I P390A.PGM.LOAD KEPT
IEF285I VOL SER NOS= USR001.
IEF285I CEE.SCEERUN KEPT

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 5
Software Engineering - Task 3: Merge 2 Data Sets V02 Date: 10/25/2009

IEF285I VOL SER NOS= Z5RES2.


IEF285I P390A.P390AC.JOB01935.D0000105.? SYSOUT
IEF285I P390A.P390AC.JOB01935.D0000106.? SYSOUT
IEF285I P390A.P390AC.JOB01935.D0000107.? SYSOUT
IEF285I P390A.P390AC.JOB01935.D0000108.? SYSOUT
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF373I STEP/GO /START 2009286.0936
IEF374I STEP/GO /STOP 2009286.0936 CPU 0MIN 01.33SEC SRB 0MIN 00.86SEC VIRT 104K SYS 260K
EXT 7036K SYS 9216K
IEF375I JOB/P390AC /START 2009286.0936
IEF376I JOB/P390AC /STOP 2009286.0936 CPU 0MIN 01.72SEC SRB 0MIN 01.64SEC

Output Data:

Test 1 V02:

File FOUT: T03OUT21.txt

0000000001File IB
0000000002File IB
0000000003File IB
0000000004File IA
0000000004File IB
0000000005File IA
0000000006File IA
0000000007File IA
0000000007File IB
0000000008File IB
0000000009File IA

Test 2 V02:

File FOUT: T03OUT22.txt

0000000001File IA
0000000002File IA
0000000003File IA
0000000004File IA
0000000004File IB
0000000005File IB
0000000006File IB
0000000007File IA
0000000007File IB
0000000008File IA
0000000009File IB

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 6
Software Engineering - Task 4: Inventory Update Date: 10/25/2009

PGM: EPINVV1 - Main program


File: V3PINVV1.TXT
*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001000
*PROCESS AGGREGATE, OFFSET, CMPAT(V1); 00002000
*PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); 00003000
/*PPL-TITLE: Inventory Update V01 */ 00004000
/********************************************************************/ 00005000
/* Inventory Update - Task 4 */ 00006000
/* Publications: see PGM Design V01 */ 00007000
/* */ 00008000
/* Author: Dipl.Ing. Werner Hoffmann */ 00009000
/* Date Written: 1907/03/05 */ 00010000
/* Date Changed: 2009/08/28 */ 00020000
/* */ 00030000
/* PROCEDURE: MAIN */ 00031000
/* TASK: This program updates the Inventory File. */ 00032000
/* Standard subroutines used: */ 00034000
/* EMSG - Message Print Routine */ 00034300
/* using Message Control Block V3DMSG01 */ 00034400
/* EADDR1 - Get new Address by a given displacement */ 00034500
/* */ 00034700
/* Files: */ 00034800
/* Input: FIV - Inventory File, Record Layout see: SIV */ 00034900
/* Input: FSM - Stores Movements, Record Layout see: SSM */ 00035000
/* Output: FOIV- New Inventory File. */ 00035100
/* FMSG- Messages - standard layout used. */ 00035300
/* Notes: - */ 00035400
/* */ 00035500
/********************************************************************/ 00035600
EPINVV1: 00035700
PROC OPTIONS(MAIN) REORDER; 00035800
00035900
/*** File FIV ---------------------------------------------------*/ 00036000
DCL FIV FILE RECORD INPUT /* Inventory File */ 00036100
ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); 00037000
DCL PIV POINTER STATIC; /*Pointer to IV Record */ 00038000
DCL 1 SIV BASED(PIV), /*IV Record Layout */ 00039000
2 XRID CHAR(2), /*Record ID */ 00040000
2 XUSD1 CHAR(1), /* unused */ 00050000
2 XPARTNO CHAR(10), /*Part Number */ 00060000
2 XDESC CHAR(21), /*Description */ 00070000
2 XUSD2 CHAR(1), /* unused */ 00080000
2 NQTY PIC'SSSSSSS9', /*Quantity */ 00100011
2 XUSD3 CHAR(37); /* unused */ 00101008
00101100
/*** File FSM ---------------------------------------------------*/ 00101200
DCL FSM FILE RECORD INPUT /* Stores Movements */ 00101300
ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); 00101400
DCL PSM POINTER STATIC; /*Pointer to SM Record */ 00101500
DCL 1 SSM BASED(PSM), /*SM Record Layout */ 00101600
2 XRID CHAR(2), /*Record ID */ 00101700
2 XRTYPE CHAR(1), /*Record Type, I OR R */ 00101800
2 XPARTNO CHAR(10), /*Part Number */ 00101900
2 NDATE PIC'99999999', /*Date YYYYMMDD */ 00102000
2 NTIME PIC'9999', /*Time HHMM */ 00102100
2 XUSD1 CHAR(1), /* unused */ 00102202
2 NQTY PIC'99999999', /*Quantity */ 00102300
2 XUSD2 CHAR(46); /* unused */ 00102402
00137000
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 1
Software Engineering - Task 4: Inventory Update Date: 10/25/2009

/*** FILE FOIV --------------------------------------------------*/ 00137108


DCL FOIV FILE RECORD OUTPUT /* */ 00137208
ENV(CONSECUTIVE RECSIZE(80)); 00137308
00137408
DCL 1 SCB STATIC, /*Group Control Block */ 00138015
2 XPARTNOIV CHAR(10), /*New Part Number IV */ 00139002
2 XPARTNOSM CHAR(10), /*New Part Number SM */ 00139116
2 YPARTNOSM CHAR(10); /*Part Number SM Group control*/ 00139215
DCL XCB CHAR(20) DEF SCB; /*Group Control Block */ 00139315
00139415
/*** Statisitcs Control Block -----------------------------------*/ 00139517
DCL 1 STAT STATIC, /*Statistic Control Block */ 00139615
2 NFIV BIN FIXED(31) /*FIV records */ 00139715
INIT(0), 00139815
2 NFSM BIN FIXED(31) /*FSM records */ 00139915
INIT(0), 00140015
2 NFSMNOTP BIN FIXED(31) /*FSM records not processed */ 00140115
INIT(0), 00140215
2 NFOIV BIN FIXED(31) /*FOIV records */ 00140315
INIT(0), 00140415
2 NFIVUPD BIN FIXED(31) /*FIV records updated */ 00140515
INIT(0); 00140615
00140715
/*** FILE FMSG --------------------------------------------------*/ 00140815
DCL FMSG FILE RECORD OUTPUT /* MSG File */ 00140915
ENV(CONSECUTIVE RECSIZE(121)); 00141015
DCL PMSG POINTER STATIC; /*Pointer to Message Line */ 00141115
%INCLUDE SYSSRC(V3DMSG04); /*Message Control Block IV Upd*/ 00141215
00141315
/*** Subroutines/Functions/Builtin ------------------------------*/ 00141915
DCL EMSG ENTRY(FILE,POINTER);/* Message Print Routine */ 00142015
DCL EADDR1 ENTRY(POINTER,BIN FIXED(31)) RETURNS(POINTER); 00142115
DCL ADDR BUILTIN; /* */ 00142215
DCL PLIRETC BUILTIN; /* */ 00142315
DCL HIGH BUILTIN; /* */ 00142415
DCL STRING BUILTIN; /* */ 00142515
DCL CHARACTER BUILTIN; /* */ 00142618
00142718
/*H1.1 Initate Routine --------------------------------------------*/ 00142818
PMSG = SMSG1.QPL; /*Point to Message Line */ 00142918
OPEN FILE(FIV) INPUT; /*Open Inventory File */ 00143018
OPEN FILE(FSM) INPUT; /*Open Stores Movement File */ 00143118
OPEN FILE(FMSG) OUTPUT; /*Open Message File */ 00143218
SLINE.XASA = ' '; /*Prepare and print start msg */ 00143318
SLINE.XMSGTYPE = 'I'; 00144000
SLINE.XENO = 'SMS01'; 00145000
SLINE.XMSGTXT = 'V3PINVV1 Started.'; 00145100
CALL EMSG(FMSG,PMSG1); 00145200
/*H2 Process OIV ================================================*/ 00145400
CALL EGETIV; /*Get first FIV Record */ 00145500
CALL EGETSM; /*Get first FSM Record */ 00145600
DO WHILE(XCB¬=HIGH(20)); /*More to do? */ 00145702
/*H3 Process one OIV Group -----------------------------------------*/ 00149017
SELECT; 00162800
WHEN(SCB.XPARTNOIV < SCB.XPARTNOSM) 00162915
/*H3.1 Unmatched IV record -----------------------------------------*/ 00163017
DO; 00163100
STAT.NFOIV = STAT.NFOIV + 1; /*count FOIV record */ 00163313
WRITE FILE (FOIV) FROM(SIV); /*Write Inventory record */ 00163413
CALL EGETIV; /*Get next FIV record */ 00163513
END; 00163613
WHEN(SCB.XPARTNOIV = SCB.XPARTNOSM) 00163715
DO; 00163913
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 2
Software Engineering - Task 4: Inventory Update Date: 10/25/2009

/*H3.2 Matched IV,SM records ---------------------------------------*/ 00164017


/*H4.0 Process SM Records for one SM Group =========================*/ 00164117
SCB.YPARTNOSM = SCB.XPARTNOSM; /*SM PartNo f. Grp.Control */ 00164217
DO WHILE(SCB.YPARTNOSM = SCB.XPARTNOSM); 00164315
/*H4.1 Process one SM Record ---------------------------------------*/ 00164417
SELECT(SSM.XRTYPE); 00164515
/*H4.1.1 ISSUE Record ----------------------------------------------*/ 00164617
WHEN('I') /* */ 00164715
SIV.NQTY = SIV.NQTY - SSM.NQTY; 00164815
/*H4.1.2 RECEIPT Record --------------------------------------------*/ 00164917
WHEN('R') /* */ 00165015
SIV.NQTY = SIV.NQTY + SSM.NQTY; 00165115
/*H4.1.3 not used --------------------------------------------------*/ 00165217
OTHERWISE; 00165315
END; 00165415
CALL EGETSM; /*Get next FSM Record */ 00165515
END; 00165615
/*H4.2 Process and terminate SM Group ------------------------------*/ 00165715
IF SIV.NQTY < 0 /*Check for neg. quantity */ 00166317
THEN 00166415
DO; 00166515
SLINE.XASA = ' '; /*Print warning msg */ 00166615
SLINE.XMSGTYPE = 'W'; 00166715
SLINE.XENO = 'SMS02'; 00166815
SLINE.XMSGTXT = 'PartNo: '||SIV.XPARTNO|| 00166916
' has neg. value: '||SIV.NQTY; 00167015
CALL EMSG(FMSG,PMSG1); 00167115
END; 00167215
STAT.NFOIV = STAT.NFOIV + 1; /*count FOIV record */ 00167415
STAT.NFIVUPD = STAT.NFIVUPD + 1; /*cnt FOIV record updated*/ 00167515
WRITE FILE (FOIV) FROM(SIV); /*Write Inventory record */ 00167715
CALL EGETIV; /*Get next FIV record */ 00167815
END; 00167915
OTHERWISE 00168015
DO; 00168215
/*H3.3 unmatched SM group record -----------------------------------*/ 00168317
/*H5 Process SM records for one SM group---------------------------*/ 00168417
SCB.YPARTNOSM = SCB.XPARTNOSM; /*SM PartNo f.Grp.Control*/ 00168515
SLINE.XASA = ' '; /*Print error msg */ 00168715
SLINE.XMSGTYPE = 'F'; 00168815
SLINE.XENO = 'SMS03'; 00168915
SLINE.XMSGTXT = 'PartNo: '||SCB.YPARTNOSM|| 00169016
' from FSM file has no associated Inventory record:'; 00169115
CALL EMSG(FMSG,PMSG1); 00169215
DO WHILE(SCB.YPARTNOSM = SCB.XPARTNOSM); 00169415
/*H5.1 Process one SM Record ---------------------------------------*/ 00169517
SLINE.XASA = ' '; /*Print SM rec. in error */ 00169615
SLINE.XMSGTYPE = 'I'; 00169715
SLINE.XENO = 'SMS03'; 00169815
SLINE.XMSGTXT = STRING(SSM); 00169915
CALL EMSG(FMSG,PMSG1); 00170015
STAT.NFSMNOTP = STAT.NFSMNOTP + 1; /*count not processed rec*/ 00170115
CALL EGETSM; /*Get next FSM Record */ 00170215
END; 00170315
END; 00170415
END; 00170515
END; 00170615
/*H1.2 Termination Routine ----------------------------------------*/ 00170715
SLINE.XASA = '0'; /*Print Statistics */ 00170817
SLINE.XMSGTYPE = 'I'; 00170915
SLINE.XENO = 'SMS02'; 00171015
SLINE.XMSGTXT = 'Statistics: '; 00171117
CALL EMSG(FMSG,PMSG1); 00171315
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 3
Software Engineering - Task 4: Inventory Update Date: 10/25/2009

SLINE.XASA = ' '; /*Print Statistics IV */ 00171417


SLINE.XMSGTYPE = 'I'; 00171517
SLINE.XENO = 'SMS02'; 00171617
SLINE.XMSGTXT = 'No. IV records read: '|| 00171719
CHARACTER(STAT.NFIV); 00171817
CALL EMSG(FMSG,PMSG1); 00171917
SLINE.XASA = ' '; /*Print Statistics SM */ 00172017
SLINE.XMSGTYPE = 'I'; 00172117
SLINE.XENO = 'SMS02'; 00172217
SLINE.XMSGTXT = 'No. SM records read: '|| 00172319
CHARACTER(STAT.NFSM); 00172417
CALL EMSG(FMSG,PMSG1); 00172517
SLINE.XASA = ' '; /*Statistics SM not processed*/ 00172617
SLINE.XMSGTYPE = 'I'; 00172717
SLINE.XENO = 'SMS02'; 00172817
SLINE.XMSGTXT = 'No. SM records not processed:'|| 00172919
CHARACTER(STAT.NFSMNOTP); 00173017
CALL EMSG(FMSG,PMSG1); 00173117
SLINE.XASA = ' '; /*Print Statistics FOIV */ 00173217
SLINE.XMSGTYPE = 'I'; 00173317
SLINE.XENO = 'SMS02'; 00173417
SLINE.XMSGTXT = 'No. IV records written: '|| 00173519
CHARACTER(STAT.NFOIV); 00173617
CALL EMSG(FMSG,PMSG1); 00173717
SLINE.XASA = ' '; /*Print Statistics IV updated */ 00173817
SLINE.XMSGTYPE = 'I'; 00173917
SLINE.XENO = 'SMS02'; 00174017
SLINE.XMSGTXT = 'No. IV records updated: '|| 00174119
CHARACTER(STAT.NFIVUPD); 00174217
CALL EMSG(FMSG,PMSG1); 00174317
SLINE.XASA = ' '; /*Print Termination Message */ 00174417
SLINE.XMSGTYPE = 'I'; 00174517
SLINE.XENO = 'SMS01'; 00174617
SLINE.XMSGTXT = 'V3PINVV1 ended.'; 00174717
CALL EMSG(FMSG,PMSG1); 00174817
CLOSE FILE(*); /*Close all Open Files */ 00174917
CALL PLIRETC(NRETC); /*Set Return Code */ 00175017
00175117
EGETIV: PROC REORDER; 00175217
/********************************************************************/ 00175317
/* FIV Record Processing */ 00175417
/* Task:-Get and return a IV record. */ 00175517
/********************************************************************/ 00175617
00175717
/*HG1 Initiation routine -----------------------------------------*/ 00175817
ON ENDFILE(FIV) /*EOF Condition */ 00175917
BEGIN; 00176017
SCB.XPARTNOIV = HIGH(10); /*Set EOF Condition */ 00176117
GOTO LRETURN; /*nothing to do anymore */ 00176217
END; 00176317
/*HG2 Read and prepare next IV record for processing ---------------*/ 00176417
READ FILE(FIV) SET(PIV); /*GET NEXT FSM RECORD */ 00176517
SCB.XPARTNOIV = SIV.XPARTNO; /*Save PartNumber */ 00176617
STAT.NFIV = STAT.NFIV + 1; /*count FIV record */ 00177015
LRETURN: 00177700
RETURN; 00177800
END EGETIV; 00187000
00187100
EGETSM: PROC REORDER; 00187200
/********************************************************************/ 00187300
/* FSM Record Processing */ 00187400
/* Task:-Get and return a SM record. */ 00187500
/********************************************************************/ 00187600
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 4
Software Engineering - Task 4: Inventory Update Date: 10/25/2009

00187700
/*HG1 Initiation routine -----------------------------------------*/ 00187800
ON ENDFILE(FSM) /*EOF Condition */ 00187900
BEGIN; 00188000
SCB.XPARTNOSM = HIGH(10); /*Set EOF Condition */ 00188102
GOTO LRETURN; /*nothing to do anymore */ 00188300
END; 00188400
/*HG2 Read and prepare next SM record for processing ---------------*/ 00188500
READ FILE(FSM) SET(PSM); /*GET NEXT FSM RECORD */ 00188600
SCB.XPARTNOSM = SSM.XPARTNO; /*Save PartNumber */ 00188702
STAT.NFSM = STAT.NFSM + 1; /*count FSM record */ 00188813
LRETURN: 00189000
RETURN; 00189100
END EGETSM; 00189200
00189300
END EPINVV1; 00190000

File: V3DMSG04.TXT
/*PPL-TITLE: Print Control Block V04 */ 00010001
/********************************************************************/ 00020000
/* Print Control Block PGM V3PSMSV4 */ 00030001
/********************************************************************/ 00040000
DCL PPCB1 POINTER INIT(ADDR(SPCB1));/*Pointer to PCB */ 00050000
DCL 1 SPCB1 UNALIGNED, /* Print Control Block */ 00060000
2 QSN POINTER /* Address of Page Number */ 00070000
INIT(EADDR1(ADDR(SPCB1.YHL(1)),52)), 00080000
2 QDT POINTER /* Address Edit-Date */ 00081000
INIT(EADDR1(ADDR(SPCB1.YHL(2)),49)), 00082000
2 QPL POINTER /* Address of Print Area */ 00090000
INIT(ADDR(SPCB1.YPL)), 00091000
2 MLCNT BIN FIXED(15) /* Number of max. Lines per Page */ 00100000
INIT(60), 00110000
2 MLNO BIN FIXED(15) /* Residuary printable No. of Lines*/ 00120000
INIT(0), 00130000
2 MPNO BIN FIXED(15) /* Current Page Number */ 00140000
INIT(0), 00150000
2 MHNO BIN FIXED(15) /* Number of Header Lines */ 00160000
INIT(4), 00170000
2 YPL CHAR(133) /* PrintLine -Communication Area---*/ 00180000
INIT((133)' '), 00190000
2 YHL(4) CHAR(133) INIT /* Header Lines */ 00200000
('1--- Stores Movement Summary Page: NNNNN 00210000
', 00220000
' Report: SMS XYZ FACTORY Date: DD.MM.YY 00221000
', 00222000
' Part_Number Receipts Issues Net_Summary 00222100
', 00222200
' _______________________________________________________ 00223000
'); 00224000
00230000

Note: Standard Subroutines are not shown!

JCL:

File: TASK04M.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 5
Software Engineering - Task 4: Inventory Update Date: 10/25/2009

// NOTIFY=P390A
//PLICOMP EXEC PLIZCL,MBR=V3PINVV1
//LKED.SYSIN DD *
INCLUDE OBJMOD(V3PSERA1)
INCLUDE OBJMOD(V3PSERDA)
INCLUDE OBJMOD(V3PEMSG)
NAME EPINVV1(R)
/*

File: TASK04G.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZG,MBR=EPINVV1
//GO.FIV DD DSN=P390A.RUN.DATA(TIVV01),DISP=SHR
//GO.FSM DD DSN=P390A.RUN.DATA(TSMV01),DISP=SHR
//GO.FOIV DD DSN=P390A.RUN.DATA(TOIV01),DISP=SHR
//GO.FMSG DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=2420)
//GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2330)
//

Test Data:

Test 1:

File FIV: TIVV01.txt

IV A5/13571 Bolt x1/2 555


IV A5/13572 Bolt x20/3d 1200
IV A5/13672 Gear c1 30700
IV A5/13673 Gear c2 224
IV A5/17924 Generator T51 55
IV A6/17925 Generator T651 123
IV B31/823 Wheel x2/3 10005
IV B31/950 Motor T6 5555
IV CA522/2005Nut x2 99500

File FIB: TSMV01.txt

SMIA5/13672 200802020822 120


SMIA5/13672 200802101430 310
SMIA5/13672 200803121500 50
SMRA5/13672 200803121610 100
SMRA5/17924 200802030915 10
SMIA5/17924 200802051030 66
SMIA6/17952 200802051035 2
SMIA6/17952 200802051040 3
SMIB31/82 200802021150 55
SMIB31/823 200802021155 10
SMIB31/823 200802021410 15

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 6
Software Engineering - Task 4: Inventory Update Date: 10/25/2009

Report Output:

File: TASK04R.TXT
1 J E S 2 J O B L O G -- S Y S T E M S Y S 1 -- N O D E N 1
0
13.31.19 JOB01994 ---- THURSDAY, 15 OCT 2009 ----
13.31.19 JOB01994 IRR010I USERID P390A IS ASSIGNED TO THIS JOB.
13.31.19 JOB01994 ICH70001I P390A LAST ACCESS AT 13:27:49 ON THURSDAY, OCTOBER 15, 2009
13.31.19 JOB01994 $HASP373 P390AC STARTED - INIT 1 - CLASS A - SYS SYS1
13.31.19 JOB01994 IEF403I P390AC - STARTED - TIME=13.31.19
13.31.21 JOB01994 IEF404I P390AC - ENDED - TIME=13.31.21
13.31.21 JOB01994 $HASP395 P390AC ENDED
0------ JES2 JOB STATISTICS ------
- 15 OCT 2009 JOB EXECUTION DATE
- 9 CARDS READ
- 102 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 5 SYSOUT SPOOL KBYTES
- 0.03 MINUTES EXECUTION TIME
1 //P390AC JOB (),'HOFFMANN', JOB01994
// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
2 //PLICOMP EXEC PLIZG,MBR=EPINVV1
3 XXIBMZG PROC LIBPRFX='CEE',MBR=TEST
XX*
XX********************************************************************
XX*
XX* IBM ENTERPRISE PL/I FOR Z/OS AND OS/390
XX* VERSION 3 RELEASE 3 MODIFICATION 0
XX*
XX* RUN A PL/I PROGRAM
XX*
XX* PARAMETER DEFAULT VALUE USAGE
XX* LNGPRFX IBMZ.V3R3M0 PREFIX FOR LANGUAGE DATA SET NAMES
XX* LIBPRFX CEE PREFIX FOR LIBRARY DATA SET NAMES
XX* MBR MEMBER NAME FOR PROGRAM LOAD MODULE
XX*
XX*********************************************************************
XX* RUN STEP
XX*********************************************************************
4 XXGO EXEC PGM=&MBR,
XX REGION=2048K
IEFC653I SUBSTITUTION JCL - PGM=EPINVV1,REGION=2048K
5 XXSTEPLIB DD DSN=P390A.PGM.LOAD,DISP=SHR
6 XX DD DSN=&LIBPRFX..SCEERUN,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSN=CEE.SCEERUN,DISP=SHR
7 //GO.SYSPRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=2330)
X/SYSPRINT DD SYSOUT=*
8 XXPRINT DD SYSOUT=*
9 XXCEEDUMP DD SYSOUT=*
10 XXSYSUDUMP DD SYSOUT=*
11 //GO.FIV DD DSN=P390A.RUN.DATA(TIVV01),DISP=SHR
12 //GO.FSM DD DSN=P390A.RUN.DATA(TSMV01),DISP=SHR
13 //GO.FOIV DD DSN=P390A.RUN.DATA(TOIV01),DISP=SHR
14 //GO.FMSG DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=121,BLKSIZE=2420)
STMT NO. MESSAGE
2 IEFC001I PROCEDURE PLIZG WAS EXPANDED USING SYSTEM LIBRARY USER.PROCLIB
ICH70001I P390A LAST ACCESS AT 13:27:49 ON THURSDAY, OCTOBER 15, 2009
IEF236I ALLOC. FOR P390AC GO PLICOMP
IEF237I 0A90 ALLOCATED TO STEPLIB
IEF237I 0A81 ALLOCATED TO
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO PRINT
IEF237I JES2 ALLOCATED TO CEEDUMP
IEF237I JES2 ALLOCATED TO SYSUDUMP
IEF237I 0A90 ALLOCATED TO FIV
IEF237I 0A90 ALLOCATED TO FSM
IEF237I 0A90 ALLOCATED TO FOIV
IEF237I JES2 ALLOCATED TO FMSG
IEF142I P390AC GO PLICOMP - STEP WAS EXECUTED - COND CODE 0008
IEF285I P390A.PGM.LOAD KEPT
IEF285I VOL SER NOS= USR001.
IEF285I CEE.SCEERUN KEPT
IEF285I VOL SER NOS= Z5RES2.
IEF285I P390A.P390AC.JOB01994.D0000101.? SYSOUT
IEF285I P390A.P390AC.JOB01994.D0000102.? SYSOUT

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 7
Software Engineering - Task 4: Inventory Update Date: 10/25/2009

IEF285I P390A.P390AC.JOB01994.D0000103.? SYSOUT


IEF285I P390A.P390AC.JOB01994.D0000104.? SYSOUT
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.P390AC.JOB01994.D0000105.? SYSOUT
IEF373I STEP/GO /START 2009288.1331
IEF374I STEP/GO /STOP 2009288.1331 CPU 0MIN 00.45SEC SRB 0MIN 00.72SEC VIRT 108K SYS 260K
EXT 7048K SYS 9216K
IEF375I JOB/P390AC /START 2009288.1331
IEF376I JOB/P390AC /STOP 2009288.1331 CPU 0MIN 00.45SEC SRB 0MIN 00.72SEC

1--- Inventory Update --- Messages --- … Page: 1


MSG_No 1***5****10***5****20***5****30***5****40***5****50***5****60**5****70***5****80… Date:15.10.09
ISMS01 V3PINVV1 Started.
WSMS02 PartNo: A5/17924 has neg. value: -1
FSMS03 PartNo: A6/17952 from FSM file has no associated Inventory record:
ISMS03 SMIA6/17952 200802051035 2
ISMS03 SMIA6/17952 200802051040 3
FSMS03 PartNo: B31/82 from FSM file has no associated Inventory record:
ISMS03 SMIB31/82 200802021150 55
0ISMS02 Statistics:
ISMS02 No. IV records read: 9
ISMS02 No. SM records read: 11
ISMS02 No. SM records not processed: 3
ISMS02 No. IV records written: 9
ISMS02 No. IV records updated: 3
ISMS01 V3PINVV1 ended.

Output Data:

File FOUT: TOIV01.txt

IV A5/13571 Bolt x1/2 555


IV A5/13572 Bolt x20/3d 1200
IV A5/13672 Gear c1 +30320
IV A5/13673 Gear c2 224
IV A5/17924 Generator T51 -1
IV A6/17925 Generator T651 123
IV B31/823 Wheel x2/3 +9980
IV B31/950 Motor T6 5555
IV CA522/2005Nut x2 99500

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 8
Software Engineering - Task 5: Telegram Analysis V01 Date: 10/25/2009

PGM: EPTELE - Main program, Subtasks


File: V3PTELE.TXT
/*PPL-TITLE: EPTELE- TELEGRAM ANALYSIS V01 */ 00004001
/********************************************************************/ 00005000
/* PGM_ENTRY: EPTELE */ 00006000
/* AUTHOR: DIPL.ING. WERNER HOFFMANN */ 00007000
/* Date written: 1978/09/17 */ 00008000
/* */ 00009000
/* Tasks: */ 00010000
/* EP1 - INPUT PROCESSING FILE: FTELE */ 00020001
/* EP2 - REPORT PROCESSING FILE: FREPORT */ 00030001
/********************************************************************/ 00060000
/* TELEGRAM ANALYSIS: PROGRAM CONTROLLER */ 00070000
EPTELE: 00080000
PROC OPTIONS(MAIN,TASK) REORDER; 00090005
/* COMMUNICATION AREA ----------------------------------------------*/ 00091000
DCL 1 SCA STATIC, 00100041
2 EWORD EVENT, 00110000
2 EREPORT EVENT, 00120000
2 XWORD CHAR(80) VARYING; 00130000
/* DEFAULTS, ENTRIES, BUILTINS -------------------------------------*/ 00131000
DCL BTRUE BIT(1) STATIC INIT('1'B); 00140000
DCL BFALSE BIT(1) STATIC INIT('0'B); 00150000
DCL (EP1,EP2) ENTRY; 00160000
00170000
/*H1**** CONTROL PROCESSING ----------------------------------- *****/ 00180005
COMPLETION(SCA.EWORD) = BFALSE; 00190042
COMPLETION(SCA.EREPORT) = BFALSE; 00200041
00210000
CALL EP2 TASK(T1) EVENT(E1); /* FREPORT PROCESSING */ 00220004
CALL EP1 TASK(T2) EVENT(E2); /* FTELE PROCESSING */ 00230021
WAIT(E1,E2); /* WAIT FOR COMPLETION */ 00240000
00241000
00242014
/********************************************************************/ 00242214
/* PGM_ENTRY: EP1 - INPUT PROCESSING - FILE: FTELE */ 00242342
/* Tasks: EP1 */ 00242742
/********************************************************************/ 00243014
/* TELEGRAM PROCESSING */ 00243142
EP1: 00243214
PROC REORDER; 00243315
/* FILE FTELE ------------------------------------------------------*/ 00243442
DCL FTELE FILE STREAM INPUT; 00243542
DCL BEOF BIT(1) STATIC; /*EOF CONDITION */ 00243642
/* VALUES, DEFAULTS ------------------------------------------------*/ 00243714
DCL XCHAR CHAR(1) STATIC; /*ONE CHARACTER OF FTELE */ 00243814
DCL BTRUE BIT(1) STATIC INIT('1'B); 00243914
DCL BFALSE BIT(1) STATIC INIT('0'B); 00244014
00244214
/*H1.1** Initialization Routine ------------------------------- *****/ 00244314
ON ENDFILE(FTELE) BEOF = BTRUE; 00244437
/*H2**** TELEGRAM PROCESSING - INPUT--------------------------- *****/ 00244642
BEOF = BFALSE; 00245014
OPEN FILE(FTELE) INPUT; 00245114
GET FILE(FTELE) EDIT(XCHAR)(A(1)); /* GET FIRST CHARACTER */ 00245342
DO WHILE(¬BEOF); /* MORE CHARACTER GROUPS IN */ 00245414
/*H3 PROCESS A BLOCK ------------------------------------------ */ 00245541
IF XCHAR = ' ' 00245614
THEN 00245714
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 1
Software Engineering - Task 5: Telegram Analysis V01 Date: 10/25/2009

/*H3.1 SPACE PROCESSING ------------------------------------- */ 00245841


DO WHILE(¬BEOF & XCHAR = ' '); 00245941
GET FILE(FTELE) EDIT(XCHAR)(A(1));/*SKIP OVER SPACES */ 00246042
END; 00246114
ELSE 00246214
/*H3.2 WORD PROCESSING -------------------------------------- */ 00246341
DO; 00246441
SCA.XWORD = ''; 00246541
DO WHILE(¬BEOF & XCHAR ¬= ' '); 00246614
SCA.XWORD = SCA.XWORD || XCHAR; 00246741
GET FILE(FTELE) EDIT(XCHAR)(A(1));/*GET NEXT CHARACTER */ 00246842
END; 00246914
/*TEST*PUT FILE(SYSPRINT) LIST('EP1-1 ',SCA.XWORD) SKIP; */ 00247041
COMPLETION(SCA.EWORD) = BTRUE; /*THERE IS A COMPLETE WORD */ 00247141
WAIT(SCA.EREPORT); /*WAIT FOR COMPL. IN REPORT */ 00247241
COMPLETION(SCA.EREPORT)= BFALSE;/*RESET STATUS */ 00247341
END; 00247414
END; 00247514
/*H1.2 Termination Routine ------------------------------------- */ 00247614
CLOSE FILE(FTELE); 00247714
/* NOTE: EVENT E1 IS COMPLETED ON RETURN */ 00247842
END EP1; 00247914
00248014
/********************************************************************/ 00248214
/* PGM_ENTRY: EP2 - TELEGRAM ANALYSIS - REPORT PROCESSING */ 00248342
/* TASKS: EP2 */ 00248742
/********************************************************************/ 00249014
/* TELEGRAM REPORT PROCESSING */ 00249114
EP2: 00249214
PROC REORDER; 00249315
/* FILE FREPORT ----------------------------------------------------*/ 00249442
DCL FREPORT FILE PRINT OUTPUT; 00249514
/* TELEGRAM INFORMATIONS -------------------------------------------*/ 00249642
DCL 1 STELE STATIC, 00249742
2 NO PIC'ZZZ9', /*TELEGRAM NUMBER */ 00249842
2 NWORD_COUNT PIC'ZZZZ9', /*WORDS IN TELEGRAM */ 00249942
2 NOSIZE_COUNT PIC'ZZZZ9'; /*WORDS OVERSIZE */ 00250042
/* DEFAULTS, BUILTINS ----------------------------------------------*/ 00250114
DCL BTRUE BIT(1) STATIC INIT('1'B); 00250242
DCL BFALSE BIT(1) STATIC INIT('0'B); 00250314
00250542
/*H1.1* Initialization Routine -------------------------------- *****/ 00250642
OPEN FILE(FREPORT) OUTPUT; 00250742
STELE.NO = 0; 00250842
/*H1.2* REPORT PROCESSING ------------------------------------- *****/ 00250942
/*H1.2.1 PROCESS REPORT HEADING -------------------------------- */ 00251042
PUT FILE(FREPORT) LIST('TELEGRAM ANALYSIS') SKIP; 00251142
WAIT(SCA.EWORD); /*WAIT FOR A WORD */ 00251242
COMPLETION(SCA.EWORD) = BFALSE; /*RESET STATUS */ 00251342
/*TST*PUT FILE(SYSPRINT) LIST('EP2-1 ',SCA.XWORD) SKIP;*/ 00251442
/*H2 PROCESS TELEGRAMS ------------------------------------------*/ 00251542
DO WHILE(SCA.XWORD ¬= 'ZZZZ'); 00251642
/*H3.1 REAL TELEGRAM PROCESSING -INITIALIZATION --------------- */ 00251742
STELE.NWORD_COUNT, STELE.NOSIZE_COUNT = 0; 00251842
DO WHILE(SCA.XWORD ¬= 'ZZZZ'); 00251942
IF SCA.XWORD = 'STOP' 00252041
/*H4.1 STOP WORD --------------------------------------------- */ 00252141
THEN; /*IGNORE STOP WORD */ 00252214
/*H4.2 COUNT A TELEGRAM WORD --------------------------------- */ 00252342
ELSE 00252414
DO; 00252514
IF LENGTH(SCA.XWORD) > 12 00252641
THEN STELE.NOSIZE_COUNT = STELE.NOSIZE_COUNT + 1; 00252714
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 2
Software Engineering - Task 5: Telegram Analysis V01 Date: 10/25/2009

STELE.NWORD_COUNT = STELE.NWORD_COUNT + 1; 00252814


END; 00252914
/*H4.3 TELEGRAM WORD -TERMINATION ---------------------------- */ 00253041
COMPLETION(SCA.EREPORT) = BTRUE; /* WORD CONTROL BLOCK IS NOT */ 00253141
/* LONGER NEEDED */ 00253241
WAIT(SCA.EWORD); /* WAIT FOR NEXT WORD */ 00253341
COMPLETION(EWORD) = BFALSE; /* RESET STATUS */ 00253441
/*TST*PUT FILE(SYSPRINT) LIST('EP2-2 ',SCA.XWORD) SKIP;*/ 00253541
END; 00253614
/*H3.2 REAL TELEGRAM PROCESSING -PRINT A TELEGRAM ------------- */ 00253741
STELE.NO = STELE.NO + 1; 00253814
PUT FILE(FREPORT) LIST ('TELEGRAM '||STELE.NO) SKIP; 00253918
PUT FILE(FREPORT) LIST (' '||STELE.NWORD_COUNT|| 00254018
' WORDS OF WHICH '||STELE.NOSIZE_COUNT|| 00254120
' OVERSIZE') SKIP; 00254216
/*H3.3 REAL TELEGRAM PROCESSING -TERMINATION ------------------ */ 00254341
COMPLETION(SCA.EREPORT) = BTRUE; /* WORD CONTROL BLOCK IS NOT */ 00254441
/* LONGER NEEDED */ 00254541
WAIT(SCA.EWORD); /* WAIT FOR NEXT WORD */ 00254641
COMPLETION(EWORD) = BFALSE; /* RESET STATUS */ 00254741
/*TST*PUT FILE(SYSPRINT) LIST('EP2-3 ',SCA.XWORD) SKIP;*/ 00254841
END; 00254914
/*H1.2 PROCESS REPORT TERMINATION ------------------------------ */ 00255041
COMPLETION(SCA.EREPORT) = BTRUE; /* WORD CONTROL BLOCK IS NOT */ 00255142
/* LONGER NEEDED */ 00255242
PUT FILE(FREPORT) LIST('END TELEGRAM ANALYSIS') SKIP; 00255316
CLOSE FILE(FREPORT); 00255414
/*NOTE: EVENT E2 IS COMPLETED ON RETURN */ 00255542
END EP2; 00255614
00256011
END EPTELE; 00260000

JCL:

File: TASK05M.TXT

Note: PL/I F Compiler is used.

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PL1LFCL,MBR=V3PTELE
//LKED.SYSIN DD *
NAME EPTELE(R)
/*

File: TASK05G.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PL1LFG,MBR=EPTELE
//GO.FTELE DD DSN=P390A.RUN.DATA(T05001),DISP=SHR
//GO.FREPORT DD SYSOUT=*,DCB=BLKSIZE=121
//GO.SYSPRINT DD SYSOUT=*,DCB=BLKSIZE=133

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 3
Software Engineering - Task 5: Telegram Analysis V01 Date: 10/25/2009

Test Data:

Test 1:

File FTELE: T05001.txt

Habe Informationen gefunden STOP


Die Erste Donau-Dampfschiffahrts-Gesellschaft (oft auch Donaudampfschiffahrtsges
ellschaft, kurz DDSG) ist eine österreichische Schifffahrtsgesellschaft zur
Beschiffung der Donau und ihrer Nebenflüsse STOP In den 1990er Jahren wurde die
Gesellschaft aufgeteilt und privatisiert STOP ZZZZ
Ihre Nachfolgegesellschaften sind die DDSG Blue Danube im
Passagierbereich und die DDSG Cargo im Frachttransportbereich STOP
Letztere wurde 2007 weiterverkauft und wieder in Erste
Donau-Dampfschiffahrts-Gesellschaft rück-umbenannt STOP
Die Zentrale befindet sich am Wiener Handelskai 265 ZZZZ Der Flottenstand der DD
SG umfasste zu dieser Zeit über 200 Dampfschiffe und ca. 1.000 Güterkähne STOP
Weiter verfügte die DDSG über eigene Schiffswerften sowie ein
Kohlebergwerk bei Fünfkirchen und mehrere Niederlassungen an der Donau
STOP Auf den Schiffen der DDSG wurden damals auch Postsendungen mit eigenen Brie
fmarken befördert ZZZZ ZZZZ

Report Output:

File: TASK05R.TXT
1 J E S 2 J O B L O G -- S Y S T E M S Y S 1 -- N O D E N 1
0
15.59.13 JOB02322 ---- MONDAY, 19 OCT 2009 ----
15.59.13 JOB02322 IRR010I USERID P390A IS ASSIGNED TO THIS JOB.
15.59.13 JOB02322 ICH70001I P390A LAST ACCESS AT 15:56:45 ON MONDAY, OCTOBER 19, 2009
15.59.13 JOB02322 $HASP373 P390AC STARTED - INIT 1 - CLASS A - SYS SYS1
15.59.13 JOB02322 IEF403I P390AC - STARTED - TIME=15.59.13
15.59.15 JOB02322 IEF404I P390AC - ENDED - TIME=15.59.15
15.59.15 JOB02322 $HASP395 P390AC ENDED
0------ JES2 JOB STATISTICS ------
- 19 OCT 2009 JOB EXECUTION DATE
- 7 CARDS READ
- 67 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 3 SYSOUT SPOOL KBYTES
- 0.02 MINUTES EXECUTION TIME
1 //P390AC JOB (),'HOFFMANN', JOB02322
// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
2 //PLICOMP EXEC PL1LFG,MBR=EPTELE
3 XXPL1LFG PROC USER=P390A,MBR=DUMMY 00037040
4 XXGO EXEC PGM=&MBR 00037150
IEFC653I SUBSTITUTION JCL - PGM=EPTELE
5 XXSTEPLIB DD DSN=&USER..PGM.LOAD,DISP=SHR 00037160
IEFC653I SUBSTITUTION JCL - DSN=P390A.PGM.LOAD,DISP=SHR
6 XX DD DSN=SYS1.SIBMTASK,DISP=SHR 00037160
7 XX DD DSN=SYS1.PL1LIB,DISP=SHR 00037160
8 //GO.SYSPRINT DD SYSOUT=*,DCB=BLKSIZE=133
X/SYSPRINT DD SYSOUT=* 00037170
9 //GO.FTELE DD DSN=P390A.RUN.DATA(T05001),DISP=SHR
10 //GO.FREPORT DD SYSOUT=*,DCB=BLKSIZE=121
STMT NO. MESSAGE
2 IEFC001I PROCEDURE PL1LFG WAS EXPANDED USING SYSTEM LIBRARY USER.PROCLIB
ICH70001I P390A LAST ACCESS AT 15:56:45 ON MONDAY, OCTOBER 19, 2009
IEF236I ALLOC. FOR P390AC GO PLICOMP
IEF237I 0A90 ALLOCATED TO STEPLIB
IEF237I 0A80 ALLOCATED TO
IEF237I 0A92 ALLOCATED TO
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I 0A90 ALLOCATED TO FTELE
IEF237I JES2 ALLOCATED TO FREPORT
IEF142I P390AC GO PLICOMP - STEP WAS EXECUTED - COND CODE 0000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 4
Software Engineering - Task 5: Telegram Analysis V01 Date: 10/25/2009

IEF285I P390A.PGM.LOAD KEPT


IEF285I VOL SER NOS= USR001.
IEF285I SYS1.SIBMTASK KEPT
IEF285I VOL SER NOS= Z5RES1.
IEF285I SYS1.PL1LIB KEPT
IEF285I VOL SER NOS= PGM001.
IEF285I P390A.P390AC.JOB02322.D0000101.? SYSOUT
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.P390AC.JOB02322.D0000102.? SYSOUT
IEF373I STEP/GO /START 2009292.1559
IEF374I STEP/GO /STOP 2009292.1559 CPU 0MIN 00.86SEC SRB 0MIN 00.02SEC VIRT 200K SYS 268K
EXT 0K SYS 9308K
IEF375I JOB/P390AC /START 2009292.1559
IEF376I JOB/P390AC /STOP 2009292.1559 CPU 0MIN 00.86SEC SRB 0MIN 00.02SEC

1
TELEGRAM ANALYSIS
TELEGRAM 1
32 WORDS OF WHICH 5 OVERSIZE
TELEGRAM 2
33 WORDS OF WHICH 6 OVERSIZE
TELEGRAM 3
46 WORDS OF WHICH 4 OVERSIZE
END TELEGRAM ANALYSIS

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 5
Software Engineering - Task 5: Telegram Analysis V02 Date: 10/25/2009

PGM: EPTELE2 - Main program, Subprograms


File: V3PTELE2.TXT
*PROCESS OPTIONS SOURCE NEST MACRO STORAGE; 00001002
*PROCESS AGGREGATE, OFFSET, CMPAT(V1); 00002002
*PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); 00003002
/*PPL-TITLE: EPTELE2- TELEGRAM ANALYSIS V02 */ 00029001
/********************************************************************/ 00029100
/* PGM_ENTRY: EPTELE2 */ 00029201
/* Author: DIPL.ING. WERNER HOFFMANN */ 00029301
/* Date written: 1978/09/17 */ 00029400
/* */ 00029500
/* Files: */ 00029601
/* FTELE - Input Telegrams. */ 00029701
/* FREPORT - Telegram Report. */ 00029801
/* Subroutines: */ 00029901
/* EGETWRD - Get a Telegram Word */ 00030001
/********************************************************************/ 00060000
EPTELE2: 00080001
PROC OPTIONS(MAIN) REORDER; 00090001
/* Data ------------------------------------------------------------*/ 00091001
DCL XWORD CHAR(80) VARYING INIT(''); 00130004
/* DEFAULTS, ENTRIES, BUILTINS -------------------------------------*/ 00131000
DCL LENGTH BUILTIN; 00160004
00170000
/* Files -----------------------------------------------------------*/ 00249401
DCL FTELE FILE STREAM INPUT; 00249501
DCL BEOF BIT(1) STATIC; /*EOF Condition */ 00249601
DCL FREPORT FILE PRINT OUTPUT; 00249800
/* Telegram Informations -------------------------------------------*/ 00249901
DCL 1 STELE STATIC, 00250000
2 NO PIC'ZZZ9', /*Telegram Number */ 00250101
2 NWORD_COUNT PIC'ZZZZ9', /*Words in Telegram */ 00250201
2 NOSIZE_COUNT PIC'ZZZZ9'; /*Words oversized */ 00250301
DCL BTRUE BIT(1) STATIC INIT('1'B); 00250704
DCL BFALSE BIT(1) STATIC INIT('0'B); 00250804
00250904
/*H1.1* Initialization Routine -------------------------------- *****/ 00251004
ON ENDFILE(FTELE) BEOF = BTRUE; 00251104
BEOF = BFALSE; 00251201
OPEN FILE(FTELE) INPUT; 00251301
OPEN FILE(FREPORT) OUTPUT; 00251400
STELE.NO = 0; 00251500
/*H1.2* Report Processing ------------------------------------- *****/ 00251603
/*H1.2.1 Process Report Heading ----------------------------------- */ 00251703
PUT FILE(FREPORT) LIST('TELEGRAM ANALYSIS') SKIP; 00251800
CALL EGETWRD; /*Get a Telegram Word */ 00251901
/*TST*PUT FILE(SYSPRINT) LIST('EP2-1 ',XWORD) SKIP;*/ 00252005
/*H2 Process Telegrams ---------------------------------------------*/ 00252103
DO WHILE(XWORD ¬= 'ZZZZ'); 00252201
/*H3.1 Real Telegram Processing -Initialization ------------------- */ 00252305
STELE.NWORD_COUNT, STELE.NOSIZE_COUNT = 0; 00252400
DO WHILE(XWORD ¬= 'ZZZZ'); 00252501
IF XWORD = 'STOP' 00252601
/*H4.1 STOP Word -------------------------------------------------- */ 00252705
THEN; /*Ignore STOP word */ 00252803
/*H4.2 Count a Telegram Word -------------------------------------- */ 00252905
ELSE 00253000
DO; 00253100
STELE.NWORD_COUNT = STELE.NWORD_COUNT + 1; 00253203
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 1
Software Engineering - Task 5: Telegram Analysis V02 Date: 10/25/2009

IF LENGTH(XWORD) > 12 00253301


THEN STELE.NOSIZE_COUNT = STELE.NOSIZE_COUNT + 1; 00253400
END; 00253600
/*H4.3 Telegram Word -Termination --------------------------------- */ 00253705
CALL EGETWRD; /*Get a Telegram Word */ 00253801
/*TST*PUT FILE(SYSPRINT) LIST('EP2-2 ',XWORD) SKIP;*/ 00253905
END; 00254000
/*H3.2 Real Telegram Processing -Print a Telegram ----------------- */ 00254105
STELE.NO = STELE.NO + 1; 00254200
PUT FILE(FREPORT) LIST ('TELEGRAM '||STELE.NO) SKIP; 00254300
PUT FILE(FREPORT) LIST (' '||STELE.NWORD_COUNT|| 00254400
' WORDS OF WHICH '||STELE.NOSIZE_COUNT|| 00254500
' OVERSIZE') SKIP; 00254600
/*H3.3 Real Telegram Processing -Termination ---------------------- */ 00254705
CALL EGETWRD; /*Get a Telegram Word */ 00254801
/*TST*PUT FILE(SYSPRINT) LIST('EP2-3 ',XWORD) SKIP;*/ 00255005
END; 00255100
/*H1.2 Process Report Termination --------------------------------- */ 00255203
PUT FILE(FREPORT) LIST('END TELEGRAM ANALYSIS') SKIP; 00255500
CLOSE FILE(FTELE); 00255601
CLOSE FILE(FREPORT); 00255700
00256000
/********************************************************************/ 00257001
/* PGM_ENTRY: EGETWRD - Get a Telegram Word */ 00258001
/* Data updated: XWORD */ 00258002
/********************************************************************/ 00259101
EGETWRD: 00259301
PROC REORDER; 00259401
/* VALUES, DEFAULTS ------------------------------------------------*/ 00259801
DCL XCHAR CHAR(1) STATIC; /*ONE CHARACTER OF FTELE */ 00259901
00262001
GET FILE(FTELE) EDIT(XCHAR)(A(1)); /* GET FIRST CHARACTER */ 00268001
/*H3 Process a String --------------------------------------------- */ 00269103
IF XCHAR = ' ' 00269201
THEN 00269301
/*H3.1 Space processing - ------------------------------------ */ 00269401
DO WHILE(¬BEOF & XCHAR = ' '); 00269501
GET FILE(FTELE) EDIT(XCHAR)(A(1));/*SKIP OVER SPACES */ 00269601
END; 00269701
/*H3.2 Word processing -------------------------------------------- */ 00269901
XWORD = ''; 00271001
DO WHILE(¬BEOF & XCHAR ¬= ' '); 00272001
XWORD = XWORD || XCHAR; 00273001
GET FILE(FTELE) EDIT(XCHAR)(A(1)); /*GET NEXT CHARACTER */ 00274001
END; 00275001
/*TST*PUT FILE(SYSPRINT) LIST('EGETWRD-1 ',XWORD) SKIP;*/ 00276005
RETURN; 00277001
END EGETWRD; 00279601
00279701
END EPTELE2; 00280001

JCL:

File: TASK05M2.TXT

Note: PL/I F Compiler is used.

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 2
Software Engineering - Task 5: Telegram Analysis V02 Date: 10/25/2009

// NOTIFY=P390A
//PLICOMP EXEC PLIZCL,MBR=V3PTELE2
//LKED.SYSIN DD *
NAME EPTELE2(R)
/*

File: TASK05G2.TXT

//P390AC JOB (),'HOFFMANN',


// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
// NOTIFY=P390A
//PLICOMP EXEC PLIZG,MBR=EPTELE2
//GO.FTELE DD DSN=P390A.RUN.DATA(T05002),DISP=SHR
//GO.FREPORT DD SYSOUT=*,DCB=BLKSIZE=1210
//GO.SYSPRINT DD SYSOUT=*,DCB=BLKSIZE=1330
//
//GO.FTELE DD DSN=P390A.RUN.DATA(T05001),DISP=SHR

Test Data:

Test 1:

File FTELE: T05001.txt

Habe Informationen gefunden STOP


Die Erste Donau-Dampfschiffahrts-Gesellschaft (oft auch Donaudampfschiffahrtsges
ellschaft, kurz DDSG) ist eine österreichische Schifffahrtsgesellschaft zur
Beschiffung der Donau und ihrer Nebenflüsse STOP In den 1990er Jahren wurde die
Gesellschaft aufgeteilt und privatisiert STOP ZZZZ
Ihre Nachfolgegesellschaften sind die DDSG Blue Danube im
Passagierbereich und die DDSG Cargo im Frachttransportbereich STOP
Letztere wurde 2007 weiterverkauft und wieder in Erste
Donau-Dampfschiffahrts-Gesellschaft rück-umbenannt STOP
Die Zentrale befindet sich am Wiener Handelskai 265 ZZZZ Der Flottenstand der DD
SG umfasste zu dieser Zeit über 200 Dampfschiffe und ca. 1.000 Güterkähne STOP
Weiter verfügte die DDSG über eigene Schiffswerften sowie ein
Kohlebergwerk bei Fünfkirchen und mehrere Niederlassungen an der Donau
STOP Auf den Schiffen der DDSG wurden damals auch Postsendungen mit eigenen Brie
fmarken befördert ZZZZ ZZZZ

Report Output:

File: TASK05R2.TXT
1 J E S 2 J O B L O G -- S Y S T E M S Y S 1 -- N O D E N 1
0
15.06.49 JOB02397 ---- WEDNESDAY, 21 OCT 2009 ----
15.06.49 JOB02397 IRR010I USERID P390A IS ASSIGNED TO THIS JOB.
15.06.49 JOB02397 ICH70001I P390A LAST ACCESS AT 15:06:22 ON WEDNESDAY, OCTOBER 21, 2009
15.06.49 JOB02397 $HASP373 P390AC STARTED - INIT 1 - CLASS A - SYS SYS1
15.06.49 JOB02397 IEF403I P390AC - STARTED - TIME=15.06.49
15.06.51 JOB02397 IEF404I P390AC - ENDED - TIME=15.06.51
15.06.51 JOB02397 $HASP395 P390AC ENDED
0------ JES2 JOB STATISTICS ------
- 21 OCT 2009 JOB EXECUTION DATE
- 7 CARDS READ
- 86 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 4 SYSOUT SPOOL KBYTES
- 0.03 MINUTES EXECUTION TIME
1 //P390AC JOB (),'HOFFMANN', JOB02397
// CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 3
Software Engineering - Task 5: Telegram Analysis V02 Date: 10/25/2009

// NOTIFY=P390A
2 //PLICOMP EXEC PLIZG,MBR=EPTELE2
3 XXIBMZG PROC LIBPRFX='CEE',MBR=TEST
XX*
XX********************************************************************
XX*
XX* IBM ENTERPRISE PL/I FOR Z/OS AND OS/390
XX* VERSION 3 RELEASE 3 MODIFICATION 0
XX*
XX* RUN A PL/I PROGRAM
XX*
XX* PARAMETER DEFAULT VALUE USAGE
XX* LNGPRFX IBMZ.V3R3M0 PREFIX FOR LANGUAGE DATA SET NAMES
XX* LIBPRFX CEE PREFIX FOR LIBRARY DATA SET NAMES
XX* MBR MEMBER NAME FOR PROGRAM LOAD MODULE
XX*
XX*********************************************************************
XX* RUN STEP
XX*********************************************************************
4 XXGO EXEC PGM=&MBR,
XX REGION=2048K
IEFC653I SUBSTITUTION JCL - PGM=EPTELE2,REGION=2048K
5 XXSTEPLIB DD DSN=P390A.PGM.LOAD,DISP=SHR
6 XX DD DSN=&LIBPRFX..SCEERUN,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSN=CEE.SCEERUN,DISP=SHR
7 //GO.SYSPRINT DD SYSOUT=*,DCB=BLKSIZE=1330
X/SYSPRINT DD SYSOUT=*
8 XXPRINT DD SYSOUT=*
9 XXCEEDUMP DD SYSOUT=*
10 XXSYSUDUMP DD SYSOUT=*
11 //GO.FTELE DD DSN=P390A.RUN.DATA(T05002),DISP=SHR
12 //GO.FREPORT DD SYSOUT=*,DCB=BLKSIZE=1210
STMT NO. MESSAGE
2 IEFC001I PROCEDURE PLIZG WAS EXPANDED USING SYSTEM LIBRARY USER.PROCLIB
ICH70001I P390A LAST ACCESS AT 15:06:22 ON WEDNESDAY, OCTOBER 21, 2009
IEF236I ALLOC. FOR P390AC GO PLICOMP
IEF237I 0A90 ALLOCATED TO STEPLIB
IEF237I 0A81 ALLOCATED TO
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO PRINT
IEF237I JES2 ALLOCATED TO CEEDUMP
IEF237I JES2 ALLOCATED TO SYSUDUMP
IEF237I 0A90 ALLOCATED TO FTELE
IEF237I JES2 ALLOCATED TO FREPORT
IEF142I P390AC GO PLICOMP - STEP WAS EXECUTED - COND CODE 0000
IEF285I P390A.PGM.LOAD KEPT
IEF285I VOL SER NOS= USR001.
IEF285I CEE.SCEERUN KEPT
IEF285I VOL SER NOS= Z5RES2.
IEF285I P390A.P390AC.JOB02397.D0000101.? SYSOUT
IEF285I P390A.P390AC.JOB02397.D0000102.? SYSOUT
IEF285I P390A.P390AC.JOB02397.D0000103.? SYSOUT
IEF285I P390A.P390AC.JOB02397.D0000104.? SYSOUT
IEF285I P390A.RUN.DATA KEPT
IEF285I VOL SER NOS= USR001.
IEF285I P390A.P390AC.JOB02397.D0000105.? SYSOUT
IEF373I STEP/GO /START 2009294.1506
IEF374I STEP/GO /STOP 2009294.1506 CPU 0MIN 00.32SEC SRB 0MIN 00.78SEC VIRT 108K SYS 252K
EXT 7032K SYS 9216K
IEF375I JOB/P390AC /START 2009294.1506
IEF376I JOB/P390AC /STOP 2009294.1506 CPU 0MIN 00.32SEC SRB 0MIN 00.78SEC

1TELEGRAM ANALYSIS
TELEGRAM 1
32 WORDS OF WHICH 5 OVERSIZE
TELEGRAM 2
33 WORDS OF WHICH 6 OVERSIZE
TELEGRAM 3
46 WORDS OF WHICH 4 OVERSIZE
END TELEGRAM ANALYSIS

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: pwhoffmann@aol.com Page: 4

You might also like