Software Engineering

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Software Engineering as PDF for free.

More details

  • Words: 39,101
  • Pages: 182
Software Engineering

Program Design & Development

Mainframe

Guest Lecture Final Presentation October 2009 – 2nd Version

presented by

Dipl. Ing. Ing. Werner Hoffmann EMAIL: pwhoffmann@[email protected] See: © Copyright Note in Note Page.

Date: 03.10.2009

SE_PGM_Design_V2.ppt

A member of IEEE and ACM Please see the notes pages for additional comments. 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 At least this lecture may be interested for:

Software Engineering Program Design & Development © 2009

• Researcher for Education / Training, • IT Professionals, • Professors, and Students.

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

Program Design & Development

Date: 03.10.2009

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 Program Design & Development © 2009

The goals for this session are to gain a solid understanding of the following 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:

• using the program development environment; • learning the programming language syntax; • and developing logic design.

You need to improve your design methods – this session might be right for you…

• 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: A

T p F

1 B

3. DO WHILE Block: A 1 Date: 03.10.2009

T p

F

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

T

1

A

p

F

A DOWHILE (p) A ENDWHILE

Equivalent Control Logic Structure: Pseudo-Code:

F 1

A

q

T

where q = ¬p

REPEAT 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

2) Control Logic Structure Equivalences: Example 2: CASE Block:

Basic Control Logic Structure: F1

T p1 F

T p2 F

1

F2



n

pn F

Date: 03.10.2009

2

Fn

T

Fotherwise

Program Design & Development

(4)

Pseudo-Code: IF p1 THEN F1 ELSE IF p2 THEN F2 ELSE … … IF pn THEN Fn ELSE Fotherwise ENDIF … ENDIF ENDIF Pseudo-Code: SELECT WHEN (p1) F1 WHEN (p2) F2 … WHEN (pn) Fn OTHERWISE Fotherwise ENDSELECT 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 ENDDO

-

Iterative DO

-

LOOP’s

-

CASE block’s

-

SEARCH block’s

-

etc.

LOOP F1 EXITIF (p1) … Fn ENDLOOP SELECT (exp) CASE (1) F1 CASE (2) F2 … 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 p3

Pseudo-Code:

T

DOWHILE (p1) IF (p2) THEN DOWHILE (p3) B ENDWHILE ELSE A ENDIF ENDWHILE C

B A

2 p2 F

p1

T

T F

C

Date: 03.10.2009

The goal is to construct a well defined hierarchy for the solution. 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 FALSE POP TOP

Date: 03.10.2009

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

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 2 T

T 1

p

q

B

F

F

A

Structured control flow:

TRUE

T T TRUE

1

POP

T p

F

B

3

TRUE

2

q

POP

TOP

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 T TRUE

1

POP

T p

F

B

3

TRUE

2

q

POP

TOP

F

F FALSE

Pseudo-Code:

Date: 03.10.2009

TRUE REPEAT POP IF p THEN {A,TRUE} ELSE {B, IF q THEN TRUE ELSE FALSE ENDIF} ENDIF UNTIL TOP 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!

w

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 Key Terms:

Concepts:

• Cohesion • Control flow • Coupling • Data flow • Logical model • Module • Primitive • Process • Requirement • Structure chart • Structured analysis • Structured design • Transform analysis Date: 03.10.2009

(1)

• System inputs/outputs • The logical definition phase • Define the application context • Define the application functions • Define the application results

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)

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

Key Terms:

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

o

Date: 03.10.2009

Iteration

o

Program Design & Development

*

Page: 22

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

22

Modular Design Module Structures:

(4)

Data Segments

Segment D1 Main Module -Data-

Segment D2

Include data D2

Include data D1 Include process P1 Process P1

External Module E1

CALL E1 CALL E2 Include process P2

Internal Module E2 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

Data Model, (H)IPO and Data Structures

(1)

Data Modeling: • Data Objects, Attributes, and Relationships • Cardinality and Modality • Data Flow Diagrams • Data Structure Diagrams • Graphs, • Trees, • Nets, • ….

A

Graphs, Nets are not part of this lecture!

Program Design & Development

C

B

D

Date: 03.10.2009

Trees (Example)

E

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

Data Model, (H)IPO and Data Structures

(1)

(H)IPO / Data Structures: • HIPO (Hierarchy plus Input-Process-Output) • IPO(S) Input – Process – Output – Storage • Output Analysis Strategy • Used Notation:

Condition Selection

Sequence

Iteration

Simple component A

A

A

B

C

Date: 03.10.2009

B

o

A

C

o

Program Design & Development

B *

Null component -

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

Data Model, (H)IPO and Data Structures

(2)

Structure Diagrams: (example)

Sequence

A

Iteration

C *

Date: 03.10.2009

Selection

D

B

E

o

F

Program Design & Development

o

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

Data Model, (H)IPO and Data Structures

(3)

Typical faults when preparing the structure diagrams are: A ok.

A wrong

A wrong B *

C

C

B-Body

Case 1: Wrong Iteration-Sequence

C o

B o

B *

Case 3: Wrong Selection Sequence

D

A ok.

A ok.

A wrong

D

B-C Body

B*

C*

Case 2: Wrong Iterations-Iteration

Date: 03.10.2009

B-Body

C-Body

B *

C *

Program Design & Development

B o

C o 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

A general Program Design Strategy

(1)

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

A general Program Design Strategy Workflow:

(2)

Problem Environment

Data Structures

Tasks to be performed

Reading & writing

Program Structure

Executable operations

Program Date: 03.10.2009

Note: Design is about structure!

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

A general Program Design Strategy

(3)

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

A general Program Design Strategy

(4)

The main goal for “Program Design” is: • Find best solution for a given problem: • Data Structures may prepare Systems for Modularization: Data Structure

0

Date: 03.10.2009

Structured Modules/Code

o

How we see the structure in a Source code:

Create “single entry/single exit” procedures in a program…

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

Task 1: Stores Movement Summary A)

Stores Movements Summary.

(1)

(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 MRIA5/13672 MRIA5/13672 MRRA5/13672 MRRA5/17924 MRIA5/17924 MRIB31/82 etc.

0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150

Date: 03.10.2009

120 310 50 100 10000 333 55

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 filerecord (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

Task 1: Stores Movement Summary A)

Stores Movements Summary.

(2)

(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 A5/17924 B31/82 etc.

Date: 03.10.2009

-380 667 -55

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

Task 1: Stores Movement Summary B)

Input

(3)

Solution • Step 1.1: Physical Structures.

SMF-Store Movements

SMS Report

SM-Store * Movement Records

Date: 03.10.2009

Page

Output

*

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

Task 1: Stores Movement Summary B)

(4)

Solution • Step 1.2: Logical Data Structures.

Input / Process

Transfer

SMF-Store Movements

Output

SMS Report

SGNETM Internal presentation

Group - Part

*

SM

Page

Net Movements

*

___________________ Part_Number Stores_Movement_Summary

SM-Store * Movement Records

Header Line *

Print Line

*

PCB

Print Control Block ISSUE Record

0

Receipt Record

________________________ …

o

SFSMS Print Line … External presentation

Main Module

Date: 03.10.2009

Program Design & Development

Print Module

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

Task 1: Stores Movement Summary B) Solution Step 1.2: Logical Data Structures.

Input / Process

(5)

Boundary clash ! Transfer

SMF-Store Movements

Output

SMS Report

SGNETM Internal presentation

Group - Part

*

Page

Net Movements

*

___________________ 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 …

Main Module

Date: 03.10.2009

External presentation

Program Design & Development

relationship Print Module

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: Subtasking, 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 subroutine. Here I’m using a general defined print service routine.

39

(6)

Task 1: Stores Movement Summary B)

Solution • Step 2.1: Design Program Structure.

Architectural Design / Interface Design

SMF-Store Movements

SMS -Main

Note:

Group Netmovements

Group - Part

*

-The hierarchical program structure fits best when it follows the data structures !

SM-Record Processing

SM-Store * Movement Records

Issue-Record Processing Receipt Record Processing

ISSUE Record

Date: 03.10.2009

0

Receipt Record o

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

Task 1: Stores Movement Summary B)

(7)

Solution • Step 2.2: Design Program Structure.

Architectural Design / Interface Design Initial Routine

PCB

Declaration

Print Control Block ________________________ …

SMS -Main

SMS Report

Print Line …

Group Netmovements

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

Task 1: Stores Movement Summary B)

(8)

Solution . Step 3.1: Design Program (Main Program). Usage: SM, SGNETM, PCB; Files: FSM, FSMS. *H1.1 Initial routine.* ON Endfile FSM: Mark EOF Condition. OPEN File FSM input, File FSMS output. *H2 Process File FSM.* Get first SM record. *H3 Process all groups of Netmovements.* DOWHILE not EOF FSM. *H3.1 Process one group of Netmovements.* *H3.1.1 Group Netmovement processing.* Save current SM: Partnumber to SGNETM: Partnumber. Clear SGNETM: Summary. *H4 Process SM records for one Netmovement group.* DOWHILE not EOF FSM & (SM: Partnumber = SGNETM: Partnumber). *H4.1 Process one SM record.* SELECT SMF: Record_Type. *H4.1.1 ISSUE Record.* WHEN I: Subtract SM: Quantity from SGNETM: Summary. *H4.1.2 RECEIPT Record.* WHEN R: Add SM: Quantity to SGNETM: Summary. 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

Procedural Design: Pseudo Code

Used Data: SM: see SM record layout, SGNETM: internal presentation - PartNumber - Summary SFSMS: Print Line – external presentation - ASA * ASA Control Character - PartNumber * Part Number - Filler - NetSummary * Net Summary/Part - Filler PCB: see PGM EPRINT

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

Task 1: Stores Movement Summary B)

Solution . Step 3.2: Design Program EPRINT.

(9)

Procedural Design: Pseudo Code

*H1

*H2

*H2.1 *H2.2

*H3

Usage: PCB; Files: FSMS. Check for early Page Change.* IF SL: XASA = '1' THEN {Clear PCB: MLNO; Change SL: XASA to ‘ ‘.} Check for printing Header Lines.* IF PCB: MLNO – Number {SL: XASA} <= 0 THEN Set Current Date into Header.* {Check and set Date into Header Line.} Print Header Lines.* Initialize PCB: MLNO by PCB: MLCNT. {Count PCB: MPNO by 1; Edit Page Number. DO for all Header Lines [PCB: MHNO]. Write Header Line to FSMS. IF SL: XASA = ‘1’ THEN Subtract PCB: MLNO by 1. ELSE Subtract PCB: MLNO by Number {SL: XASA}. ENDIF. ENDDO. ENDIF. Write Print Line.* Write Print Line PCB: YPL to FSMS. Subtract PCB: MLNO by Number {SL: XASA}. Initiate Print Line PCB: YPL.

Date: 03.10.2009

Program Design & Development

Used Data: PCB: Print Control Block -… - MLCNT * Number of max. lines/page - MLNO * Residuary printable no. of lines - MPNO * Current page number - MHNO * Number of Header lines - YPL * PrintLine - YHL(*) * Header Lines SL: Print Line based on YPL - XASA * ASA Cpntrol Character - XLINE * Remaining Print Line

PGM:

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

Task 1: Stores Movement Summary

(10)

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



Task 3: Collating or Matching Problem

(Homework)



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

Task 2: Stores Movement SummaryA)

Stores Movements Summary.

(1) Maintenance

(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 MRIA5/13672 MRIA5/13672 MRRA5/13672 MRRA5/17924 MRIA5/17924 MRIB31/82 etc.

200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150

Date: 03.10.2009

120 310 50 100 10000 333 55

Note: Century added to date/time!

Program Design & Development

- Layout of PartNumber: see nexct foil!

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 filerecord (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

Task 2: Stores Movement Summary A)

Stores Movements Summary.

(2) Maintenance

(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 Report: SMS XYZ FACTORY Date: 04.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 A6/13672 A6/17924 A6 A61/821 A61

100 10000 10100

480 333 813

-380 +9667 +9287

0 0

55 55

-55 -55

-A summary line of a assembly (first part of the PartNumber) is added; -Assembies are separated by a blank line. -Specification of the PartNumber: LAaa/NNNnnnn | |+--- 2nd. Part: 3 to max. 7 | | numeric digits, | +---- slash-sign +---------- 1st. Part: Assembly Number, must start with a letter followed by 1 to max. 3 alphanumeric character (A…Z,ÄÖÜ,0…9) 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

Task 2: A)

Stores Movement Summary

Stores Movements Summary.

- Maintenance

(3)

(see Notes too)

Message Report Layout: Stores Movement Summary (Example) --- Store Movements Report --- Messages --MSG_No 1***5****10***5****20***5****30***5****40***5****50***5****60**5****70***5****80 ISMS01 V3PSMSV3 Started.

PAGE: Date:

1 04.10.09

ISMS02 SMIG41/82 200802021150 55 FSMS03 PART NUMBER G41/82 has an erroneous specification. See PGM description.

**in error,see below.

ISMS02 FSMS03 FSMS04 FSMS05

**in error,see below.

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

ISMS02 SMRI6/17924 200802051030 --333 FSMS05 Quantity --333 has not a positive numeric value.

**in error,see below.

ISMS02 MBII9/17924 200802030915 10000 FSMS01 Record_ID MB is not SM as inspected.

**in error,see below.

ISMS02 SMBI9/17924 200802030915 10000 FSMS02 Record_Type B is wrong. Allowed are I or R.

**in error,see below.

etc. ISMS01 V3PSMSV3 ended. Note: Description see Notes!

Program Design & Development

Date: 03.10.2009

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

Task 2:

Stores Movement Summary

- Maintenance

(4)

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

Task 2: Stores Movement Summary C)

Input

(5) Maintenance

Solution • Step 1.1: Physical Structures.

SMF-Store Movements

SMS Report

SM-Store * Movement Records

Page

*

MSG Report

Page

Date: 03.10.2009

Output

Output

*

Program Design & Development

Page: 50

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

50

Task 2: Stores Movement Summary C)

(6) Maintenance

Solution • Step 1.2: Logical Data Structures – Part 1. SCB – Group Control Block

Input / Process

Group - Assembly Number * Group – Part Number

* SM

EGETSM 1

Proved SM-Store * Movement Records

2

(Proved) FSMStore Movements

Start/ Stop MSG

Transfer

SANETM Internal presentation

Output

SMS Report

Assembly_Number Receipts Issues Stores_Movement_Summary

Page

SGNETM Internal presentation

*

Part_Number Receipts Issues Stores_Movement_Summary

Header Line *

Print Line

*

PCB

Print Control Block ISSUE Record

0

Receipt Record

________________________ …

o

SFSMS Print Line …

Main Module

Main Program

Date: 03.10.2009

External presentation

Program Design & Development

Print Module

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

Task 2: C)

Stores Movement Summary -

(7) Maintenance

Solution • Step 1.3: Logical Data Structures – Part 2. SCB – Group Control Block

Input / Process

FSM-Store Movements

ESMOK

MSG Report

Missing Information!

SM

FSM Record

Output

* Page

*

FSM Record o in error

Proved SM-Store o Movement Record 1

Header Line *

Print Line

*

MCB

FSM Record

Error MSG

*

MSG Control Block ________________________ … SLINE Print Line

2

Main Module

Subprogram EGETSM

Date: 03.10.2009

… External presentation

Program Design & Development

Print Module

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

Task 2: Stores Movement Summary C)

(8) Maintenance

Architectural Design / Interface Design Solution • Step 2.1: Design Program Structure – Main Program.

SMS -Main

(Proved) FSMStore Movements

EGETSM - Get first proved SM record

Input / Process

Group - Assembly Number *

Assembly Netmovements

Group – Part Number

Group Netmovements SM-Record Processing Receipt Record Processing

EGETSM

*

Proved SM-Store * Movement Records

Issue-Record Processing EGETSM - Get next proved SM record

Date: 03.10.2009

ISSUE Record

0

Program Design & Development

Receipt Record o

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

Task 2: C)

(9)

Stores Movement Summary -

Maintenance

Architectural Design / Interface Design Solution • Step 2.3: Design Program Structure – Main Program. Declaration

PCB

Initial Routine

FSMS

Print Control Block

SMS -Main

Output

________________________ …

EGETSM - Get first proved SM record

SMS Report

Print Line …

Assembly Netmovements

Page

*

Group Netmovements 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

Task 2: C)

Stores Movement Summary -

(10) Maintenance

Architectural Design / Interface Design Solution • Step 2.4: Design Program Structure – Main Program. Declaration

MCB

Initial Routine FMSG

MSG Control Block

SMS -Main

Output

________________________ …

EGETSM - Get first proved SM record

MSG Report

Print Line …

Assembly Netmovements

Page

*

Group Netmovements 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 C)

Maintenance

Architectural Design / Interface Design Solution • Step 2.5: Design Program Structure - EGETSM. MCB

Output

SCB

MSG Control Block

EGETSM

Print Line

MSG Report

Page

Header Line *

*

Print Line

*

SM-Record Processing

Input / Process

ESMOK Function

Proved SM Record FSM-Store Movements

SM

FSM R. in Error

FSM Record *

FSM Record Error MSGS EMSG

FSM Record o in error

1

EVERIFY Function

Proved SM o Record

FSM Record

Date: 03.10.2009

Program Design & Development

Error MSG

*

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

Task 2: Stores Movement Summary D)

(12) Maintenance

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

Usage: SCB, SM, SAGNETM, SGNETM, PCB, MSG, YASA; Files: FSM, FSMS, FMSG. *H1.1 Initial routine.* -AOPEN File FSM input, File FSMS, FMSG output. *H6 Print Start MSG [EMSG]. *H2 Process File FSM.* *H6.1 *H3 Process all Groups of Assemblies and Parts.* Get first proved SM Record [EGETSM]. *H6.1.1 DOWHILE not (SCB: YASSNO=HIGH) *more to do* *H4 Process one Group of Assembly.* *H6.1.2 *H4.1 Group Assembly Processing – Initial Routine.* Save current SCB: AssemblyNumber to SANETM: AssemblyNumber. Clear SANETM: Receipts,Issues. DOWHILE SCB: AssemblyNumber = SANETM: AssemblyNumber. *H5 Process one Group of Parts.* *H5.1 Group Part Netmovements – Initial Routine.* Save currrent SCB: PartNumber to SGNETM: PartNumber. Clear SGNETM: Receipts, Issues. -A*H5.2 Group PartNumber Netmovements Processing (Edit & Print Routine).* SGNETM: Summary = SGNETM: Receipts – SGNETM: Issues. Prepare Print Line {YASA, SGNETM: Partnumber, Receipts, Issues, Summary}. CALL EPRINT {Print File FSMS,PCB Print Control Block}. Add SGNETM: Receipts & ISSUES to SAGNETM: Receipts & Issues. Set YASA to ‘ ‘. ENDWHILE. *H4.2 Group Assembly Processing (Edit & Print Routine).* SANETM: Summary = SANETM: Receipts – SANETM: ISSUES. Prepare Print Line {YASA, SANETM: AssemblyNumber, Receipts, Issues, Summary}. CALL EPRINT (Print File FSMS,PCB Print Control Block}. Set YASA to ‘0’. ENDWHILE. *H1.2 Termination Routine.* Print Termination MSG [EMSG]. Close all Files {FSM, FSMS}. Set final Return Code.

Date: 03.10.2009

Program Design & Development

Procedural Design: Pseudo Code

Process proved SM Records for one Group PartNumber. DOWHILE SCB: Partnumber = SGNETM: Partnumber. Process one SM record.* SELECT SSM: Record_Type. ISSUE Record.* WHEN I: Add SM: Quantity to SGNETM: Issue. RECEIPT Record.* WHEN R: Add SM: Quantity to SGNETM: Receipts. ENDSELECT. Get next proved SM Record [EGETSM]. ENDWHILE.

Used Data: SCB: see SCB layout, SM: see SM record layout, SANETM: internal presentation - AssemblyNumber - Receipts - Issues - Summary SGNETM: internal presentation - PartNumber - Receipts - Issues - Summary SFSMS: Print Line – external presentation - ASA * ASA Control Character - PartNumber * Part Number - Filler - NetSummary * Net Summary/Part - Filler SLINE: MSG Line – external presentation see PGM EMSG Page: 57 PCB: see PGM EPRINT 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

Task 2: D)

Stores Movement Summary

-

(13) Maintenance

Solution . Step 3.2: Design Program (EGETSM).

Usage: SCB, SSM, MCB; Files: FSM, FMSG. *HG1 Initial routine.* ON ENDFILE FSM { Set SCB: AssemblyNumber & PartNumber to HIGH.; RETURN } Get next FSM record. DOWHILE not ESMOK. *Precheck for FSM errors * *HG2.0 Prepare MSG message and print FSM record [EMSG]. *HG3.1 Check Record-ID.* IF SSM: Record-ID not ‘SM’ THEN {Prepare and print error MSG [EMSG] } ELSE *HG3.2 Check Record-Type.* IF SSM: Record-Type not = ‘I’ or ‘R’ 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

Procedural Design: Pseudo Code

Used Data: SCB: see SCB layout, SM: see SSM record layout, SLINE: MSG Line – external presentation see PGM EMSG MCB:

see PGM EMSG

Page: 58

-

58

Task 2: D)

Stores Movement Summary

-

(14) Maintenance

Solution . Step 3.3: Design Program (ESMOK).

Usage: SSM; Files: FSM. *HC1.1 Check Record-ID.* IF SSM: Record-ID not ‘SM’ THEN RETURN FALSE. *HC1.2 Check Record-Type.* IF SSM: Record-Type not = ‘I’ or ‘R’ 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

Procedural Design: Pseudo Code

Used Data: SM: see SSM record layout,

Page: 59

-

59

Task 2: Stores Movement Summary D)

(15) Maintenance

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.* SELECT Ym. Pseudo Code *H2.1.1 Letter specification:* External Routine 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.* Value: max. 30 character, WHEN ‘A’ IF Yv not in alphanumeric THEN {Set Result to FALSE; Set Bmoretodo to FALSE.} Mask: max. 40 character. THEN {Add 1 to Iv and Im.} 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.} Numeric: 0…9 ELSE {Add 1 to Iv and Im.} Xspecial: any EBCDIC charcter WHEN ‘n’ IF Yn not in numeric THEN {add 1 to Im.} 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.

Procedural Design:

Date: 03.10.2009

Program Design & Development

Page: 60

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

60

Task 2: Stores Movement Summary -

D)

(16) Maintenance

Procedural Design:

Solution . Step 3.5: Design Test Program for EVERIFY.

Pseudo Code

Usage: EVERIFY: Input: Value, Mask; Result: TRUE = ok., FALSE = in error

Value: max. 30 character, Mask: max. 40 character.

*H1.1 Initialization Routine.* ON ENDFILE SYSIN Set Bmoretodo to FASLE. Set Bmoretodo to TRUE. Print Start MSG to file SYSPRINT. Step thrpugh test runs.* Get Value and Mask from file SYSIN. DOWHILE Bmoretodo. *H2.1 Test one value by a given mask.* Bverify = EVERIFY(Value,Mask). 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.

Used Data:

*H2

ETMASK1 EVERIFY Function

*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

Task 2: Stores Movement Summary E)

(17) Maintenance

Review: Function EVERIFY •

Study and Analyze given Solution,



Make a Code Review – search for possible pitfalls, •

Date: 03.10.2009

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

Program Design & Development

Page: 62

62

Task 2: Stores Movement Summary E)

(18) Maintenance

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

Task 3: Collating or Matching Problem A)

(1)

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 File FIA: File FIB:

4, 5, 6, 7, 9 1, 2, 3, 4, 7, 8

Example see: JSP, Klaus Kilberth, page 108…110

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: File FIB: File FOUT:

Date: 03.10.2009

1, 2, 3, 1, 2, 3;

4,

5, 6, 7,

4,

4; 4;

7, 8

5, 6, 7; 7, 8;

9

Input

9

Output

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

FIA-File

FOUT-File

Input File FIB

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 Example 1: Merging of two datasets Logical data structures

Used Data: Files: Rec. IA, Rec. IB Internal: SCB ON ENDFILE: - Key IA Set Key value to - Key IB HIGH Merge FIA,FIB to FOUT

SCB FIA-File

FOUT-File

FIB-File

Process Group O *

(1)

Process Group IA Group O *

Group IA *

Group IA -

(2)

Process Rec. IA *

Group IB -

Group IB *

Process Group IB -

(3)

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) D)

Used Data:

Task 3: V01 Design Pseudo Code

ON ENDFILE: Files: FIA, Set SCB Key value FIB, to HIGH FOUT Records: SIA - XKEY - XTEXT SIB - XKEY - XTEXT Internal: SCB or XCB - XKEYIA - XKEYIB

Example 1: Merging of two datasets

Usage: Input: Files FIA,FIB; Output: FOUT; Record Layouts: SIA, SIB; Control block: XCB respectively SCB *H1.1 Initialization Routine.* {OPEN File FIA, FIB INPUT; File FOUT OUTPUT.} *H2 Merge File FIA, FIB to File FOUT.* *H3 Process group O,* {CALL EGETIA; CALL EGETIB.} EGETIA: 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. *H4.2.1 Process record IB.* Write SIB to file FOUT. CALL EGETIB. ENDWHILE. ENDWHILE. *H1.2 Termination Routine.* Close all Files.

EGETIB: *HG1 Initiation Routine.* ON ENDFILE FIB {Set SCB.XKEYIB to HIGH; RETURN.} *HG2 Read and prepare record for processing.* {Read a record from FIB; Set SCB.XKEYIB to SIB.KEY.} 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: •

Date: 03.10.2009

Any points you like to discuss?

Program Design & Development

Page: 70

-

70

Task 3: Collating or Matching Problem A)

(1)

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: File FIB:

4, 5, 6, 7, 9 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

FIA-File

FOUT-File

Input File FIB

FIB-File

Group O *

Record IA *

Date: 03.10.2009

Record IA

Record IB

Program Design & Development

Record IB *

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) C)

Used Data:

Task 3: V02 Design Program Structure

Files: FIA, FIB, GOUT Rec. SIA ON ENDFILE: - XKEY, Set SCB Key value - KTEXT to HIGH SIB - XKEY - XTEXT Internal: SCB (1) - XKEYIA - XKEYIB

Example 1: Merging of two datasets Logical data structures

Merge IA,IB to O

SCB Process Group O * FIA-File

FOUT-File

FIB-File

(2)

Process Rec. IA Group O *

Process Rec. IB Record IA *

Record IA

Record IB

(3)

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) D)

Used Data:

Task 3: V02 Design Pseudo Code

ON ENDFILE: Files: FIA, Set Key value to FIB, HIGH FOUT Records: SIA - XKEY - XTEXT SIB - XKEY - XTEXT Internal: SCB or XCB - XKEYIA - XKEYIB

Example 1: Merging of two datasets

Usage: Input: Files FIA,FIB; Output: FOUT; Record Layouts: SIA, SIB; Control block: XCB respectively SCB *H1.1 Initialization Routine.* {OPEN File FIA, FIB INPUT; File FOUT OUTPUT.} *H2 Merge File FIA, FIB to File FOUT.* *H3 Process group O,* {CALL EGETIA; CALL EGETIB.} EGETIA: 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 { *H4.2.1

Process record IB.* Write SIB to file FOUT. CALL EGETIB.

} ENDWHILE. *H1.2 Termination Routine.* Close all Files.

EGETIB: *HG1 Initiation Routine.* ON ENDFILE FIB {Set SCB.XKEYIB to HIGH; RETURN.} *HG2 Read and prepare record for processing.* {Read a record from FIB; Set SCB.XKEYIB to SIB.KEY.} RETURN.

Make it as simple as possible! Date: 03.10.2009

Program Design & Development

PGM:

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



Task 5: Telegram Analysis – Boundary Clash (Homework)

(Homework)

3. Conclusion

Date: 03.10.2009

Program Design & Development

Page: 76

-

76

Task 4: Inventory Update - Collating Problem A)

(1)

Task 4: V01 Requirements Inventory

FINV

Stores Movements

Inventory - New PGM Update Inventory

FOINV 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

Task 4: Inventory Update - Collating Problem A)

Inventory.

(2)

(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 IV A5/13572 Bolt x20/3d IV A5/13672 Gear c1 IV A5/13673 Gear c2 IV A6/17924 Generator T51 IV A6/17925 Generator T651 IV B31/823 Wheel x2/3 IV B31/950 Motor T6 IV CA522/2005Nut x2 etc.

Date: 03.10.2009

555 1200 30700 224 55 123 10005 5555 99500

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

Task 4: Inventory Update - Collating Problem A)

Stores Movements. (see

(3)

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 SMIA5/13672 SMIA5/13672 SMRA5/13672 SMRA5/17924 SMIA5/17924 SMIA6/17952 SMIA6/17952 SMIB31/82 SMIB31/823 SMIB31/823 etc. Date: 03.10.2009

200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802051035 200802051040 200802021150 200802021155 200802021410

120 310 50 100 10 66 2 3 55 10 15 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

Task 4: Inventory Update - Collating Problem A)

Inventory Message Report.

(4)

(see Notes too)

Example:

--- Inventory Update --- Messages --Page: MSG_No 1***5****10***5****20***5****30***5****40***5****50***5****60**5****… Date: 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 ISMS02 ISMS02 ISMS02 ISMS02 ISMS02 ISMS01

Statistics: No. IV records read: No. SM records read: No. SM records not processed: No. IV records written: No. IV records updated: V3PINVV1 ended.

Date: 03.10.2009

1 15.10.09

9 11 3 9 3

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

Task 4: Inventory Update – Collating Problem

(5)

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

Task 4: Inventory Update – Collating Problem

(6)

C) Solution: Logical Data Structures (1) Input

Input FSM-Store Movements

FIV Inventory

matched group

IV Record *

0

IV Record

FOIV Inventory

Unmatched group o

0

SM

unmatched

Output

SM

SM Record *

matched o IV Record

SM Issue Record

0

SM Record *

IV Record *

SM Receipt o 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

Task 4: Inventory Update – Collating Problem

(7)

C) Solution: Logical Data Structures (2) IV Update

Input

SCB

FIV Inventory

Input

(1)

IV Group *

FMSG

(3)

(2)

Unmatched group IV o

FOIV Inventory

FSM-Store Movements

IV Update Conditions: (1): PartNo IV < PartNo SM (2): PartNo IV = PartNo SM (3): PartNo SM < PartNo IV

Output

STAT

matched group SM 0

Unmatched group SM o

SM Record *

SM Record *

Unmatched group SM o

matched group IV/SM 0

IV Record * unmatched

SM Record *

IV Record

unmatched IV Record

0

IV Record *

matched o IV Record

SM Issue

matched

SM Issue Record

Date: 03.10.2009

Record

SM Record *

IV Record

0

SM Receipt o REcord

Program Design & Development

0

SM Receipt o REcord

Note: - FMSG Data Structure not shown; - Standard Implementation used.

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

Task 4: Inventory Update – Collating Problem

Used Data:

D) Solution: Program Design SCB

IV Update

STAT

FMSG

IV Update

IV Update (1)

IV Group *

IV Group *

Unmatched Grp IV o unmatched Rec. IV

Unmatched group IV o

Unmatched group SM o

matched group IV/SM 0

matched Grp IV/SM o

Files: FIV, FSM, FOIV, FMSG Rec. SIV - XPartNo, -… SSM - XPartNo, -… (2) Internal: SCB - XPartNo IV - XPartNo SM - YPartNo SM (3)

matched IV Rec,

unmatched

SM Record *

IV Record

(5)

SM Rec. * SM Issue. o

matched

SM Record *

IV Record

Record

0

(4)

SM Receipt o REcord

unmatched Rec. SM *

ON ENDFILE: Set SCB Key value to HIGH

XCB (5)

STAT - No. IV records read, - No. SM records read, - No. SM records not processed, - No. IV records written, - No. IV records updated.



SM Receipt. o

Unmatched Grp SM o SM Issue

(8)

(5)

Conditions: (1): XCB not HIGH (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

Task 4: Inventory Update – Collating Problem D) Solution: Program Design Usage: Input: Files FIV,FSM; Output: FOIV, FMSG; Record Layouts: SIV, SSM; Control Block: XCB respectively SCB, STAT *H1.1 Initialization Routine.* {OPEN File FIV, FSM INPUT; File FOIV, FMSG OUTPUT.} Write Start message to FMSG. *H2 Process IV Update group.* {CALL EGETIV, CALL EGETSM.} *Get first input records.* DOWHILE XCB not HIGH. *H3 Process one IV Update group.* SELECT. WHEN SCB.XPartNo IV < SCB.XPartNo SM *H3.1 Unmatched IV record.* {Count FOIV record, Write SIV to FOIV, CALL EGETIV.} WHEN SCB.XPartNo IV = SCB.XPartNo SM *H3.2 Matched IV,SM records.* -AWHEN SCB.XpartNo Sm < SCB.XPartNo IV *H3.3 Unmatched SM group.* -BENDSELECT. ENDWHILE. *H1.2 Termination Routine.* Write complete Statistic to FMSG. Write End message to FMSG. Close all Files. Set Return Code.

Date: 03.10.2009

(9)

-A*H4.0 Process SM records for one SM group.* Save SCB.XPartNo SM to SCB.YPartNo SM. DOWHILE SCB.YPartNo SM = SCB.XPartNo SM. *H4.1 Process one SM Record.* SELECT SSM.XRTYPE. WHEN ‘I’ *H4.1.1 Issue Record.* Subtract SSM.NQTY from SIV.NQTY. WHEN ‘R’ *H4.1.2 Receipt Record.* Add SSM.NQTY to SIV.NQTY. ENDSELECT. CALL EGETSM. ENDWHILE. *H4.2 Process and terminate SM group.* IF SIV.NQTY < 0 {Write warning msg to FMSG.} Count FOIV and IVupdated record. Write SIV to FOIV. CALL EGETIV. -B*H5

Process SM records for one SM group.* Save SCB.XPartNo SM to SCB.YPartNo SM, Print error MSG –no associated IV record-, DOWHILE SCB.YPartNo SM = SCB.XPartNo SM. *H5.1 Process one SM record in error.* Print SM record to FMSG. Count not processed record. CALL EGETSM. PGM: ENDWHILE.

Program Design & Development

Page: 85

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

85

Task 4: Inventory Update – Collating Problem

(10)

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

Task 4: Inventory Update – Collating Problem E)

(11)

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

Task 5: Telegram Analysis A)

(1)

Task 5: Requirements Report

Telegram

FTELE

PGM Telegram Analysis

FPRINT

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

Task 5: Telegram Analysis A)

(2)

Task 5: Input (Example) Report

Telegram PGM Telegram Analysis

FTELE

FPRINT

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

Task 5: Telegram Analysis A)

(3)

Task 5: Report Report

Telegram PGM Telegram Analysis

FTELE

FPRINT

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

Date: 03.10.2009

5 OVERSIZE 6 OVERSIZE 4 OVERSIZE

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 Subtask EP1

Input

Record *

Spaces

Output

EP2

FREPORT

(1) (1) Tel. Body

String *

(1)

Null ZZZZ Telegram

Real Telegram *

Report Heading

Report Ending Tel. Body

(2) Character *

SCA -EWORD -EREPORT -XWORD

EP1 Stream I/O Note: record not seen by EP1

FTELE

Subtask EP1 process

process

(3) 0

Word

Telegram Word *

o

ZZZZ * Telegram R.*

(2) Space *

Character *

STOP

Word

0

(3) Conditions: (1) ¬EOF (2) ¬EOF & XCHAR = ' ' (3) ¬BEOF & XCHAR ¬= ' '

Date: 03.10.2009

0

Over sized -

Conditions: (1) XWORD ¬= 'ZZZZ‘ (2) XWORD = 'STOP' (3) LENGTH(XWORD) > 12

Line 1

Line 2

STAT -NO -NWORD -NOOSIZE

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

Task 5: Telegram Analysis B)

(5)

Task 5: Program Structure – Subtask EP1 Subtask EP1

Input

process

Record *

SCA -EWORD -EREPORT -XWORD

EP1 * Stream I/O Note: record not seen by EP1

FTELE

EP1 FTELE processing Process FTELE *

String Process String Skip over spaces

Character *

Spaces

0

Space *

Word

o

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

Task 5: Telegram Analysis C)

(6)

Task 5: Program Structure – Subtask EP2 Subtask EP1

Output

EP2

FREPORT

process

SCA -EWORD -EREPORT -XWORD

EP2 FREPORT processing Report Heading

Tel. Body

Process Telegrams

Real Telegram *

Null ZZZZ Telegram

Report Heading

Report Ending Tel. Body

Telegram Word *

ZZZZ *

Process Real Telegrams STOP Word Word

Telegram R. *

Word over size Print Telegram Infos

STOP

0

Word

0

Line 1 Over sized -

Date: 03.10.2009

Line 2

Report Ending

STAT -NO -NWORD -NOOSIZE

Program Design & Development

Page: 94

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

94

Task 5: Telegram Analysis D)

(7)

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.* OPEN File FREPORT Output. Set NO = 0. *H1.2 Report processing.* *H1.2.1 Process Report Heading.* Print Report Heading. WAIT EWORD. *H2 Process Telegrams.* DOWHILE XWORD ¬= 'ZZZZ‘. *H3.1 Real Telegram Processing- Initialization.* Set NWORD_COUNT, NOSIZE_COUNT = 0. -A*H3.2 Real Telegram Processing – Print a Telegram.* Count NO. Print Line 1, Line2. *H3.3 Real Telegram Processing – Termination.* POST EREPORT. WAIT EWORD. ENDWHILE. *H1.2 Process Report Termination.* POST EREPORT. PRINT Report Ending. CLOSE File FREPORT.

-A-

DOWHILE XWORD ¬= 'ZZZZ‘. IF XWORD = 'STOP' *H4.1 STOP Word.* {} *Ignore STOP word.*4 *H4.2 Count a Telegram Word.* ELSE {Count NWORD_COUNT. IF LENGTH(XWORD) > 12 THEN Count NOSIZE_COUNT. } *H4.3 Telegram Word – Termination.* POST EREPORT. WAIT EWORD. ENDWHILE.

ETELE: Main Program. Using: Control Block: SCA. CALL EP2 EVENT E1. * FREPORT PROCESSING.* CALL EP1 EVENT E2. * FTELE PROCESSING.* WAIT E1,E2.

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

Task 5: Telegram Analysis

(9)

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

Task 5: Telegram Analysis V02

(10)

F) Task 5: Home Work.

Telegram Analysis Specification: see V01



Design a Solution without using multi-programming elements: • • • • •

Date: 03.10.2009

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

Program Design & Development

Page: 98

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

98

Task 5: Telegram Analysis V02 G)

(11)

Task 5: Program Structure – Main Program , Part 1 ETELE2

Output

process

ETELE2 Telegram Processing EP2

-XWORD

FREPORT Report Heading Process Telegrams

Tel. Body

Report Heading

Real Telegram *

Null ZZZZ Telegram

Telegram Word *

STOP

0

Word

Report Ending

ZZZZ *

Tel. Body

Telegram R. *

Line 1

Date: 03.10.2009

STOP Word Word Word over size Print Telegram Infos

Report Ending

0

Over sized -

Process Real Telegrams

Line 2

STAT -NO -NWORD -NOOSIZE

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

Task 5: Telegram Analysis V02 G)

(12)

Task 5: Program Structure – EGETWRD , Part 2 Subroutine EGETWRD

Input

(1)

process

ETELE2 Telegram Processing Report Heading

Record *

EP1 * Stream I/O Note: record not seen by EP1

FTELE

XWORD

Process Telegrams Process Real Telegrams

String

STOP Word Word Word over size

Character *

Spaces

Word

0

o

Print Telegram Infos

(2) Space *

Character *

Report Ending 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

Task 5: Telegram Analysis V02 H)

Task 5: Pseudo Code

-A-

ETELE2: Using Files: FTELE,FREPORT, Data: XWORD,STAT *H1.1 Initialization Routine.* OPEN File FTELE Input, FREPORT Output. Set NO = 0. *H1.2 Report processing.* *H1.2.1 Process Report Heading.* Print Report Heading. CALL EGETWRD. *H2 Process Telegrams.* DOWHILE XWORD ¬= 'ZZZZ‘. *H3.1 Real Telegram Processing- Initialization.* Set NWORD_COUNT, NOSIZE_COUNT = 0. -A*H3.2 Real Telegram Processing – Print a Telegram.* Count NO. Print Line 1, Line2. *H3.3 Real Telegram Processing – Termination.* CALL EGETWRD. ENDWHILE. *H1.2 Process Report Termination.* PRINT Report Ending. CLOSE File FTELE, FREPORT.

Date: 03.10.2009

(13)

DOWHILE XWORD ¬= 'ZZZZ‘. IF XWORD = 'STOP' *H4.1 STOP Word.* {} *Ignore STOP word.*4 *H4.2 Count a Telegram Word.* ELSE {Count NWORD_COUNT. IF LENGTH(XWORD) > 12 THEN Count NOSIZE_COUNT. } *H4.3 Telegram Word – Termination.* CALL EGETWRD. ENDWHILE.

EGETWRD: Using Files: FTELE, Data: XWORD. Get a character [XCHAR]. *H3.1 Space processing.* IF XCHAR = ' ' DOWHILE ¬EOF & XCHAR = ' ‘. get next character [XCHAR]. ENDWHILE. *H3.2 Word processing.* Initialize XWORD. DOWHILE ¬EOF & XCHAR ¬= ' ‘. {Append XCHAR to XWORD, get next character [XCHAR].} ENDWHILE. RETURN XWORD. PGM:

Program Design & Development

Page: 101

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

101

Task 5: Telegram Analysis V02

(14)

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: • A Revolution in Programming?

“Of course! Why didn't 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, PrenticeHall,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, PrenticeHall, 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 Software Engineering Program Design & Development © 2009

(1)

Now let’s start final discussion…

“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: [email protected] or [email protected] 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 [email protected] or [email protected].

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; *PROCESS AGGREGATE, OFFSET, CMPAT(V1); *PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: STORES SUMMARY MOVEMENTS V02 */ /********************************************************************/ /* PRODUCE STORES MOVEMENTS SUMMARY REPORT */ /* PUBLICATIONS: SEE PGM DESIGN V02 */ /* */ /* AUTHOR: DIPL.ING. WERNER HOFFMANN */ /* DATE WRITTEN: 1907/03/05 */ /* DATE CHANGED: 2009/08/28 */ /* */ /* PROCEDURE: MAIN */ /* TASK: THIS PROGRAM PRODUCE A STORES SUMMARY REPORT. */ /* REPORT-ID: SMS */ /* STANDARD SUBROUTINES USED: */ /* EPRINT - REPORT PROCEDURE, */ /* USING PRINT CONTROL BLOCK V3DPCB01 */ /* EADDR1 - GET NEW ADDRESS BY A GIVEN DISPLACEMENT */ /* */ /* FILES: */ /* INPUT: FSM - STORES MOVEMENTS, RECORD LAYOUT SEE: SSM */ /* OUTPUT: FSMS- REPORT STORES SUMMARY MOVEMENTS, */ /* PRINT LINE LAYOUT: SEE SFSMS */ /* NOTES: */ /* */ /********************************************************************/ EPSMSV2: PROC OPTIONS(MAIN) REORDER; /*** DCL DCL DCL DCL 1 2 2 2 2 2 2 2 2 /*** DCL DCL DCL 1 2 2 2 2 2

FILE FSM ---------------------------------------------------*/ FSM FILE RECORD INPUT /* */ ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); BFSMEOF BIT(1) INIT('0'B);/* EOF IDENTIFIER */ PSM POINTER STATIC;/* POINTER TO MF RECORD */ SSM BASED(PSM), /* MF RECORD LAYOUT */ XRID CHAR(2), /* RECORD ID */ XRTYPE CHAR(1), /* RECORD TYPE, I OR R */ XPARTNO CHAR(10), /* PART NUMBER */ NDATE PIC'999999', /* DATE YYMMDD */ NTIME PIC'9999', /* TIME HHMM */ X01 CHAR(1), /* FILLER */ NQTY PIC'99999999', /* QUANTITY */ X02 CHAR(48); /* FILLER */ FILE FSMS --------------------------------------------------*/ FSMS FILE RECORD OUTPUT/* */ ENV(CONSECUTIVE RECSIZE(133)); PFSMS POINTER STATIC;/* POINTER TO PRINT LINE */ SFSMS BASED(PFSMS), /* STORES MOVEMENT SUMMARY PRINTL.*/ XASA CHAR(1), /* ASA CONTROL CHARACTER */ XPARTNO CHAR(10), /* PART NUMBER */ X01 CHAR(10), /* FILLER */ NNETS PIC'SSSSSSSSS9',/* NET SUMMARY PER PART */ X02 CHAR(100); /* FILLER */

%INCLUDE SYSSRC(V3DPCB01);

/* PRINT CONTROL BLOCK

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

*/

00001009 00002004 00003017 00010000 00020000 00030000 00031000 00033000 00033100 00033200 00033300 00033400 00033500 00033911 00034011 00034117 00034217 00034317 00034417 00034517 00034617 00034718 00034817 00034917 00035017 00036017 00039000 00040000 00050000 00051000 00052000 00060011 00070000 00080011 00081018 00090018 00100000 00101000 00110000 00120000 00130000 00131000 00132006 00133000 00133100 00134000 00135000 00136016 00137000 00138011 00139000 00139200 00139300 00139406 00139500 00139600 00139703 Page: 1

Software Engineering -

Task 1: Stores Movement Summary

Date: 10/25/2009

/*** DCL 1 2 2

GROUP NET SGNETM XPARTNO NNETS

MOVEMENTS INFORMATIONS ---------------------------*/ STATIC, /* GROUP NET MOVEMENTS */ CHAR(10), /* PART NUMBER */ BIN FIXED(31); /* NET MOVEMENTS */

/*** DCL DCL DCL

SUBROUTINES/FUNCTIONS/BUILTIN ------------------------------*/ EPRINT ENTRY(FILE,POINTER);/* PRINT PROCEDURE */ EADDR1 ENTRY(POINTER,BIN FIXED(31)) RETURNS(POINTER); ADDR BUILTIN; /* */

/*H1.1

INITIAL ROUTINE --------------------------------------------*/ ON ENDFILE(FSM) BFSMEOF = '1'B;/*SET EOF CONDITION */ PFSMS = SPCB1.QPL; /*POINT TO PRINT LINE */ OPEN FILE(FSM) INPUT; /*OPEN STORES MOVEMENT FILE */ OPEN FILE(FSMS) OUTPUT; /*OPEN PRINT FILE */ /*H2 PROCESS FILE FSM ===========================================*/ /*H3 PROCESS ALL GROUPS OF NETMOVEMENTS =========================*/ READ FILE(FSM) SET(PSM); /*GET FIRST FSM RECORD */ DO WHILE(¬BFSMEOF); /*H3.1 PROCESS ONE GROUP OF NETMOVEMENTS --------------------------*/ /*H3.1. GROUP NETMOVEMENTS PROCESSING (INITIAL ROUTINE)-------------*/ SGNETM.XPARTNO = SSM.XPARTNO; /*SAVE PART NUMBER */ SGNETM.NNETS = 0; /* CLEAR NET MOVEMENTS SUMMARY */ /*H4 PROCESS SM RECORDS FOR ONE NETMOVEMENT GROUP ==============*/ DO WHILE(¬BFSMEOF & (SSM.XPARTNO=SGNETM.XPARTNO)); /*H4.1 PROCESS ONE SM RECORD -------------------------------------*/ SELECT(SSM.XRTYPE); /*H4.1.1 ISSUE RECORD ---------------------------------------------*/ WHEN('I') /* */ SGNETM.NNETS = SGNETM.NNETS - SSM.NQTY; /*H4.1.2 RECEIPT RECORD -------------------------------------------*/ WHEN('R') /* */ SGNETM.NNETS = SGNETM.NNETS + SSM.NQTY; /*H4.1.3 NOT USED -------------------------------------------------*/ OTHERWISE; END; READ FILE(FSM) SET(PSM);/*GET NEXT FSM RECORD */ END; /*H3.2 GROUP NETMOVEMENTS PROCESSING (EDIT AND PRINT ROUTINE)------*/ SFSMS.XPARTNO = SGNETM.XPARTNO; /*PREPARE PRINT LINE */ SFSMS.NNETS = SGNETM.NNETS; CALL EPRINT(FSMS,PPCB1); /*PRINT GROUP SUMMARY LINE */ END; /*H1.2 TERMINATION ROUTINE ----------------------------------------*/ CLOSE FILE(*); /*CLOSE ALL OPEN FILES */ END EPSMSV2;

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00139800 00139900 00140100 00140300 00140406 00140500 00140600 00141000 00141110 00142001 00150000 00151000 00152011 00160015 00160111 00160201 00161218 00161318 00161418 00161511 00161618 00161718 00161818 00161906 00162018 00162118 00162218 00162318 00162418 00162501 00162618 00162718 00162801 00162918 00163017 00163114 00163201 00163318 00163401 00163501 00163611 00163711 00163801 00163901 00164001 00164101 00165010

Page: 2

Software Engineering -

Task 1: Stores Movement Summary

Date: 10/25/2009

File: V3DPCB01.TXT /*PPL-TITLE: Print Control Block V01 */ /********************************************************************/ /* Print Control Block PGM V3PSMSV2 */ /********************************************************************/ DCL PPCB1 POINTER INIT(ADDR(SPCB1));/*Pointer to PCB V01*/ DCL 1 SPCB1 UNALIGNED, /* Print Control Block V01*/ 2 QSN POINTER /* Address of Page Number */ INIT(EADDR1(ADDR(SPCB1.YHL(1)),38)), 2 QDT POINTER /* Address Edit-Date */ INIT(EADDR1(ADDR(SPCB1.YHL(2)),35)), 2 QPL POINTER /* Address of Print Area */ INIT(ADDR(SPCB1.YPL)), 2 MLCNT BIN FIXED(15) /* Number of max. Lines per Page */ INIT(60), 2 MLNO BIN FIXED(15) /* Residuary printable No. of Lines*/ INIT(0), 2 MPNO BIN FIXED(15) /* Current Page Number */ INIT(0), 2 MHNO BIN FIXED(15) /* Number of Header Lines */ INIT(4), 2 YPL CHAR(133) /* PrintLine -Communication Area -*/ INIT((133)' '), 2 YHL(4) CHAR(133) INIT /* Header Lines */ ('1--- Stores Movement Summary Page: NNNNN ', ' Report: SMS XYZ FACTORY Date: DD.MM.YY ', ' PART_NUMBER NET_SUMMARY ', ' _________________________________________ ');

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00010016 00020000 00030016 00040000 00050001 00060016 00070016 00080010 00081016 00082010 00090016 00091007 00100016 00110000 00120016 00130000 00140016 00150000 00160016 00170010 00180016 00190010 00200016 00210014 00220001 00221012 00222001 00222112 00222210 00223002 00224001 00230000

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; *PROCESS AGGREGATE, OFFSET, CMPAT(V1); *PROCESS OPT(2) TEST(ALL,SYM) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: Print Routine */ /********************************************************************/ /* */ /* ENTRY POINT: EPRINT */ /* AUTHOR: DIPL.ING. WERNER HOFFMANN */ /* PUBLICATIONS: SC33-0009 PL/I LANGUAGE REFERENCE MANUAL */ /* SC33-0006 PL/I PROGRAMMER'S GUIDE */ /* DATE WRITTEN: 1972/03/05 */ /* DATE CHANGED: 2009/08/28 */ /* */ /* DEFINITION: -THE PROCEDURE EPRINT WRITES A PRINT LINE DEFINED */ /* IN THE PCB (PRINT CONTROL BLOCK) TO THE DEFINED */ /* PRINT DATA SET. */ /* -IF NECESSARY HEADER LINES ARE PRINTED BEFORE THE */ /* PRINT LINE IS WRITTEN. */ /* -FOLLOWING ASA CONTROL CHARACTER ARE ACCEPTED: */ /* '1' - NEW PAGE */ /* ' ' - (BLANK) NEW LINE */ /* '0' - ONE SPACE LINE */ /* '-' - TWO SPACE LINES */ /* -METHOD USED: RECORD I/O, MOVE MODUS */ /* */ /* PROCEDURE CALL: */ /* CALL EPRINT(DDFILE,PPCB); */ /* | +--- POINTER TO PRINT CB */ /* +---------- FILE NAME */ /* */ /* DEFINITION IN CALLING PROCEDURE: */ /* DCL EPRINT ENTRY(FILE,POINTER); */ /* DCL DDFILE FILE RECORD OUTPUT ENV(CONSECUTIVE RECSIZE(133)); */ /* PRINT CONTROL BLOCK, EXAMPLE SEE V3DPCM00 */ /* CODING IN CALLING PROCEDURE: */ /* INITIAL ROUTINE: */ /* OPEN FILE(DDFILE) OUTPUT; */ /* TERMINATION ROUTINE: */ /* CLOSE FILE(DDFILE); */ /* */ /* CALLING ROUTINES/FUNCTIONS: */ /* EDATE */ /* */ /* NOTES: - AFTER PRINTING OF THE LINE: */ /* - THE LINE WILL BE INITIALIZED BY ' ' (BLANK) */ /* CHARACTERS. */ /* */ /********************************************************************/ EPRINT: PROC(DDFILE,PPCB); /* */ DCL PPCB POINTER; /* POINTS TO PCB */ DCL NHNO BIN FIXED(15) STATIC;/* NUMBER HEADER LINES */ DCL 1 SPCBA BASED(PPCB), /*DSECT PCB */ 2 QSN POINTER, /*ADDRESS OF PAGE NUMBER */ 2 QDT POINTER, /*ADDRESS EDIT.DATE */ 2 QPL POINTER, /*ADDRESS PRINT LINE */ Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00001003 00002004 00003003 00010020 00020000 00030000 00040000 00041000 00050000 00060000 00070000 00080000 00090000 00100000 00110000 00120000 00130000 00140000 00150000 00160000 00170000 00180000 00190000 00200000 00210000 00220000 00230000 00240000 00241000 00243000 00250000 00260000 00261019 00261219 00261319 00261419 00261519 00261619 00261719 00261819 00261920 00262020 00262120 00262220 00262320 00263000 00264000 00270000 00280000 00290000 00300008 00301007 00310008 00320000 00330000 00340011 Page: 4

Software Engineering -

2 2 2 2 2 2 DCL DCL DCL 1 2 2 DCL DCL DCL DCL DCL DCL DCL DCL /*H1

Task 1: Stores Movement Summary

Date: 10/25/2009

MLCNT BIN FIXED(15), /*MAX. NUMBER LINES/PAGE */ MLNO BIN FIXED(15), /*NUMBER OF REMAINING PRINTABLE L. */ MPNO BIN FIXED(15), /*PAGE NUMBER */ MHNO BIN FIXED(15), /*NUMBER HEADER LINES */ YPZ CHAR(133), /*PRINT LINE */ YHL(1:NHNO REFER(SPCBA.MHNO)) CHAR(133); /*HEADER LINES */ DSNR PIC'ZZZZ9' BASED(SPCBA.QSN);/*PAGE NUMBER */ PL POINTER STATIC;/*POINTER TO BASED LINE */ SL BASED(PL), /*PRINT LINE */ XASA CHAR(1), /*ASA CONTROL CHARACTER */ XLINE CHAR(132); /*PRINT AREA */ JHDR BIN FIXED(15) STATIC;/*CURRENT HEADER LINE */ XCASA CHAR(3) STATIC INIT(' 0-');/*ACCEPTED ASA C.CHAR. */ XCASASL CHAR(2) DEF(XCASA) POS(2); /*ASA C.CHR.WITH SKIPL.*/ DDFILE FILE; /* RECORD I/O DEFINITION */ (ADDR,INDEX) BUILTIN; /* */ EDATE ENTRY(POINTER);/*EDIT DATE ROUTINE */ PDDMY POINTER STATIC;/*POINTER TO DATE FIELD */ YDATE CHAR(8) BASED(PDDMY);/*DATE,FORMAT TT.MM.YY */ -CHECK FOR EARLY PAGE CHANGE --------------------------------*/ PL = ADDR(SPCBA.YPZ); IF SL.XASA = '1' THEN DO; SPCBA.MLNO = 0; /*PREPARE FOR NEW PAGE */ SL.XASA = ' '; /*CHANGE ASA C.CHAR. TO DEFAULT */ END;

/*H2

-CHECK FOR PRINTING HEADER LINES ----------------------------*/ IF SPCBA.MLNO-INDEX(XCASASL,SL.XASA)<=0 /*NEED FOR NEW PAGE?*/ THEN DO; /*H2.1 -CHECK FOR SETTING DATE INTO HEADER LINE --------------------*/ PDDMY = SPCBA.QDT; /*POINT TO DATE FIELD */ IF YDATE = 'DD.MM.YY' /*NOT ESTABLISHED? */ THEN DO; CALL EDATE(PDDMY); /*GET AND EDIT DATE */ END; /*H2.2 -PRINT HEADER LINES -----------------------------------------*/ SPCBA.MLNO=SPCBA.MLCNT;/*INIT LINE COUNTER */ SPCBA.MPNO=SPCBA.MPNO 1; /*COUNT PAGE NUMBER */ DSNR = SPCBA.MPNO; /*EDIT PAGE NUMBER */ DO JHDR = 1 TO SPCBA.MHNO;/*STEP THROUGH HEADER AREA */ PL = ADDR(SPCBA.YHL(JHDR));/*POINT TO HEADER LINE */ WRITE FILE(DDFILE) FROM(SL);/*WRITE HEADER LINE */ IF SL.XASA = '1' /* NEW PAGE , COUNT 1ST LINE AS 1 */ THEN SPCBA.MLNO = SPCBA.MLNO - 1; ELSE SPCBA.MLNO = SPCBA.MLNO INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES*/ END; END; /*H3

-WRITE PRINT LINE -------------------------------------------*/ WRITE FILE(DDFILE) FROM(SPCBA.YPZ);/*WRITE PRINT LINE */ PL = SPCBA.QPL; /*POINT TO PRINT LINE */ SPCBA.MLNO = SPCBA.MLNO INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES */ SPCBA.YPZ = (133)' '; /*INITIATE PRINT LINE */ END EPRINT;

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00350000 00351000 00352000 00353000 00360006 00370011 00380000 00390010 00400010 00410000 00420000 00430000 00440000 00441009 00450000 00460000 00461001 00462011 00463001 00470000 00482007 00483015 00490000 00500000 00510000 00520000 00530000 00540000 00541000 00542000 00550009 00560000 00570000 00571001 00572001 00573002 00574001 00575001 00576004 00577001 00579101 00580000 00590000 00600000 00610004 00620011 00630000 00631018 00632023 00633022 00650000 00660000 00670000 00671000 00672000 00680000 00690011 00700000 00701000 00710006 00720000 00730000 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; *PROCESS AGGREGATE, OFFSET; *PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: GET AND EDIT SYSTEM DATE */ /********************************************************************/ /* FUNCTION TO GET ACTUAL SYSTEM DATE */ /* PUBLICATIONS: */ /* - C28-8201-2 */ /* */ /* AUTHOR: DIPL.ING. WERNER HOFFMANN */ /* DATE WRITTEN: 1972/03/05 */ /* DATE CHANGED: 2009/08/28 */ /* */ /* PROCEDURE CALL: CALL EDATE (PPOS); */ /* +---- ADDRESS OF DATE FIELD */ /* DECLARATION: */ /* DCL EDATE ENTRY(POINTER); */ /* */ /* NOTES: - THE RESULTING FORMAT WILL BE: */ /* DD.MM.YY */ /* | | + YEAR */ /* | +--- MONTH */ /* +------ DAY */ /********************************************************************/ EDATE: PROC(PPOS) REORDER; DCL XDATE CHAR(6) STATIC;/*SYSTEM DATE */ DCL 1 S1DATE DEF XDATE, /* DATE */ 2 XYY CHAR(2), /* YEAR */ 2 XMM CHAR(2), /* MONTH */ 2 XDD CHAR(2); /* DAY */ DCL PE POINTER STATIC;/*POINTER TO ADDRESS OF DATE */ DCL PPOS POINTER; /* ADDRESS OF PRINTED DATE */ DCL XPRDATE CHAR(8) BASED(PE);/*PRINTED DATE */ DCL DATE BUILTIN; /* */ /*H1 /*

GET SYSTEM DATE AND REFORMAT DATE, RETURN REFORMATED DATE TO THE CALLING ROUTINE PE=PPOS; /*POINT TO PRINT AREA XDATE = DATE; /*PICK UP SYSTEM DATE & EDIT DATE XPRDATE=S1DATE.XDD||'.'||S1DATE.XMM||'.'||S1DATE.XYY; END EDATE;

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

*/ */ */ */

00001003 00002002 00003003 00010001 00020000 00030000 00031000 00032000 00033000 00033101 00034001 00035001 00036001 00040000 00050000 00070000 00080000 00090000 00091000 00092000 00093000 00094000 00095000 00100000 00110000 00120000 00130000 00140000 00141000 00142000 00143000 00144000 00150000 00151001 00160000 00161000 00161103 00161203 00162000 00163000 00163100 00164000 00165000

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; *PROCESS AGGREGATE, OFFSET; *PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: CAlCULATE NEW ADDRESS BY ADDING A GIVEN DISPLACEMENT */ /********************************************************************/ /* FUNCTION TO GET A NEW ADDRESS BY ADDING A GIVEN DISPLACEMENT */ /* FUNCTION-CALL: P=EADDR1(PCHAR,NPOS); */ /* | +--- DISPLACEMENT +0...max. F(31) */ /* | MAX.VALUE: 32767 */ /* +--------- POINTER */ /* DECLARATION: */ /* DCL EADDR1 ENTRY(POINTER,BIN FIXED(31)) RETURNS(POINTER); */ /* */ /********************************************************************/ EADDR1: PROC(PCHAR,NPOS) RETURNS(POINTER); DCL PE POINTER STATIC;/*POINTER TO ADDRESS AREA */ DCL PCHAR POINTER; /*STARTING ADDRESS */ DCL NPOS BIN FIXED(31); /*DISPLACEMENT */ DCL XC(32767) CHAR(1) BASED(PE);/* BYTE AREA */ DCL ADDR BUILTIN; /* ADDRESS BUILTIN FUNCTION */ /*H1 /*

CALCULATE NEW ADDRESS BY USING THE GIVEN DISPLACEMENT, RETURN NEW ADDRESS TO THE CALLING ROUTINE PE=PCHAR; /*INITIATE BYTE AREA ADDRESS RETURN(ADDR(XC(NPOS))); /*GET NEW ADDRESS & RETURN POINTER END EADDR1;

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

*/ */ */ */

00001003 00002001 00003003 00010003 00020000 00030003 00040000 00050000 00051003 00060000 00070000 00080000 00090000 00100000 00110000 00120000 00130000 00140000 00141002 00150000 00160000 00161000 00161103 00161203 00162000 00163003 00164000 00165000

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: [email protected]

Page: 8

Software Engineering -

Task 1: Stores Movement Summary

Date: 10/25/2009

Test Data: File: SMT201.txt SMIA5/13672 SMIA5/13672 SMIA5/13672 SMRA5/13672 SMRA5/17924 SMIA5/17924 SMIB31/82 SMIB31/8

0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802031150

120 310 50 100 10000 333 55 50

File: SMT201.txt SMIA5/13672 SMIA5/13672 SMIA5/13672 SMRA5/13672 SMRA5/17924 SMIA5/17924 SMIA5/82 SMIA6/13672 SMIA6/13672 SMIA6/13672 SMRA6/13672 SMRA6/17924 SMIA6/17924 SMIA61/82 SMIA7/13672 SMIA7/13672 SMIA7/13672 SMRA7/13672 SMRA7/17924 SMIA7/17924 SMIA71/82 SMIB7/13672 SMIB7/13672 SMIB7/13672 SMRB7/13672 SMRB7/17924 SMIB7/17924 SMIB71/82 SMIC7/13672 SMIC7/13672 SMIC7/13672 SMRC7/13672 SMRC7/17924 SMIC7/17924 SMIC71/82 SMID7/13672 SMID7/13672 SMID7/13672 SMRD7/13672 SMRD7/17924 SMID7/17924 SMID71/82 SMID8/13672 SMID8/13672 SMID8/13672 SMRD8/13672 SMRD8/17924

0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915

120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

Page: 9

Software Engineering -

SMID8/17924 SMID81/82 SMID9/13672 SMID9/13672 SMID9/13672 SMRD9/13672 SMRD9/17924 SMID9/17924 SMID91/82 SMIE0/13672 SMIE0/13672 SMIE0/13672 SMRE0/13672 SMRD0/17924 SMID0/17924 SMID01/82 SMIE1/13672 SMIE1/13672 SMIE1/13672 SMRE1/13672 SMRD1/17924 SMRD1/17924 SMID11/82 SMIE2/13672 SMIE2/13672 SMIE2/13672 SMRE2/13672 SMIE2/17924 SMIE2/17924 SMIE21/82 SMIE3/13672 SMIE3/13672 SMIE3/13672 SMRE3/13672 SMID3/17924 SMID3/17924 SMID31/82 SMIE4/13672 SMIE4/13672 SMIE4/13672 SMRE4/13672 SMID4/17924 SMID4/17924 SMID41/82 SMIE4/13673 SMIE4/13673 SMIE4/13673 SMRE4/13673 SMIE4/17924 SMRE4/17924 SMIE41/82 SMIE4/13673 SMIF4/13673 SMIF4/13673 SMRF4/13673 SMIF4/17924 SMRF4/17924 SMIF41/82 SMIG4/13673 SMIG4/13673 SMRG4/13673 SMIG4/17924

Task 1: Stores Movement Summary

0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802020822 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0802101430 0803121500 0803121610 0802030915

Date: 10/25/2009

333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 310 50 100 10000

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected] 10

Page:

Software Engineering -

SMRG4/17924 SMIG41/82 SMIH4/13673 SMIH4/13673 SMRH4/13673 SMIH4/17924 SMRH4/17924 SMIH41/82 SMRI4/13673 SMII4/17924 SMRI4/17924 SMII41/82 SMRI5/13673 SMII5/17924 SMRI5/17924 SMII51/82 SMRI6/13673 SMII6/17924 SMRI6/17924 SMII66/82 SMRI7/13673 SMII7/17924 SMRI7/17924 SMII76/82 SMRI8/13673 SMII8/17924 SMRI8/17924 SMII86/82 SMRI9/13673 SMII9/17924 SMRI9/17924 SMII96/82

Task 1: Stores Movement Summary

0802051030 0802021150 0802101430 0803121500 0803121610 0802030915 0802051030 0802021150 0803121610 0802030915 0802051030 0802021150 0803121610 0802030915 0802051030 0802021150 0803121610 0802030915 0802051030 0802021150 0803121610 0802030915 0802051030 0802021150 0803121610 0802030915 0802051030 0802021150 0803121610 0802030915 0802051030 0802021150

Date: 10/25/2009

333 55 310 50 100 10000 333 55 100 10000 333 55 100 10000 333 55 100 10000 333 55 100 10000 333 55 100 10000 333 55 100 10000 333 55

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected] 11

Page:

Software Engineering -

Task 1: Stores Movement Summary

Date: 10/25/2009

Report Output: File: TASK01T1.TXT 1 0

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

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: [email protected] 12

Page:

Software Engineering -

Task 1: Stores Movement Summary

IEF285I VOL SER NOS= USR001. IEF285I P390A.P390AC.JOB01562.D0000105.? IEF373I STEP/GO /START 2009276.0844 IEF374I STEP/GO /STOP 2009276.0844 CPU EXT 6928K SYS 9216K IEF375I JOB/P390AC /START 2009276.0844 IEF376I JOB/P390AC /STOP 2009276.0844 CPU

Date: 10/25/2009

SYSOUT 0MIN 00.29SEC SRB

0MIN 00.84SEC VIRT

0MIN 00.29SEC SRB

0MIN 00.84SEC

100K SYS

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 0

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

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: [email protected] 13

Page:

252K

Software Engineering -

Task 1: Stores Movement Summary

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 EXT 6928K SYS 9216K IEF375I JOB/P390AC /START 2009276.0838 IEF376I JOB/P390AC /STOP 2009276.0838 CPU 0MIN 00.32SEC SRB

Date: 10/25/2009

0MIN 00.69SEC VIRT

100K SYS

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: [email protected] 14

Page:

252K

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: [email protected] 15

Page:

Software Engineering -

Task 2: Stores Movement Summary-Maintenance Function EVERIFY

Date: 10/25/2009

PGM: EVERIFY – Function File: V3PMSK01.TXT *PROCESS OPTIONS SOURCE NEST MACRO STORAGE; *PROCESS OPT(2) OFFSET XREF(SHORT) ATTRIBUTES(FULL); /*PPL-TITLE: Verify input data by Mask Version 01 */ /*PROCESS TEST, GN, STMT; */ /********************************************************************/ /* Function to verify input data by a mask specification */ /* Publications: */ /* - C28-8201-2 */ /* */ /* Author: Dipl.Ing. Werner Hoffmann */ /* Date written: 2009/08/28 */ /* Date changed: 2009/08/28 */ /* */ /* Invoking Function: */ /* Bresult = EVERIFY(Xvalue,Xmask); */ /* | +-------- Mask Specification */ /* +-------------- value to prove */ /* Declaration in calling procedure: */ /* DCL EVERIFY ENTRY(CHAR(30) VARYING,CHAR(40) VARYING) */ /* RETURNS(BIT(1)); */ /* NOTES: */ /* Xvalue => character format,1..to max. 30 bytes */ /* Xmask => character format,1..to max. 40 bytes */ /* L or l => means letters A...Z and ÖÜÄ */ /* A or a => means alphanumeric A...ZÖÜÄ 0...9*/ /* N or n => means numeric 0...9 */ /* B or b => means blank character */ /* >? => means next char.must be there */ /* ? any EBCDIC character */ /* Note: Uppercase means "must be there" */ /* Lowercase means "can be there" */ /* Must-Part must be specified before an */ /* optional part. */ /* Example: LAaa>/NNNnnnnBBBB ok. */ /* LaaA>/nnnnNNNBBBB false spec. */ /* This may be a mask for a 10 byte value */ /* */ /* Bresult=> BIT(1) '1'B means OK. */ /* '0'B means in error */ /* Notes: Be carefully in defining the mask! A short mask or a wrong*/ /* definition may result in Bresult = '0'B; */ /********************************************************************/ EVERIFY: PROC(Xvalue,Xmask) RETURNS(BIT(1)) REORDER; DCL Xvalue CHAR(30) VARYING;/*value to prove */ DCL Xmask CHAR(40) VARYING;/*given mask */ DCL Bresult BIT(1); /*result value */ DCL (Iv,Im) BIN FIXED(15) STATIC;/*points to current character*/ DCL (LIv,LIm) BIN FIXED(15) STATIC;/*last actual character pos. */ DCL (Yv,Ym) CHAR(1) STATIC;/*actual character */ DCL Bmoretodo BIT(1); /*process status */ DCL Xletter CHAR(29) STATIC/*letter */ INIT('ABCDEFGHIJKLMNOPQRSTUVWXYZÖÜÄ'); DCL Xalphanum CHAR(39) STATIC/*alphanumeric */ INIT('ABCDEFGHIJKLMNOPQRSTUVWXYZÖÜÄ0123456789'); DCL Xnum CHAR(10) STATIC /*numeric */ Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00001001 00002014 00004001 00004113 00005001 00006001 00007001 00008001 00009001 00009101 00009201 00009301 00009401 00009501 00009601 00009701 00009801 00009901 00010001 00010101 00010201 00011013 00012013 00012103 00012203 00012303 00012403 00012513 00012603 00012713 00012813 00012915 00013015 00013115 00013215 00013315 00013415 00013515 00014009 00014113 00014213 00015001 00016001 00017004 00018001 00019001 00019201 00019307 00019407 00019513 00019613 00019702 00019802 00019902 00020002 00020102 Page: 1

Software Engineering -

Task 2: Stores Movement Summary-Maintenance Function EVERIFY

Date: 10/25/2009

INIT('0123456789'); Xblank CHAR(1) STATIC /*blank INIT(' '); DCL Xspecial CHAR(1) STATIC /*special sign - given by mask INIT('?'); DCL (INDEX,LENGTH,SUBSTR) BUILTIN;/*BUILTIN Functions

00020202 */ 00020302 00020402 */ 00020502 00020602 */ 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 DCL

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

Page: 2

Software Engineering -

Task 2: Stores Movement Summary-Maintenance Function EVERIFY

Date: 10/25/2009

THEN DO; Iv = Iv + 1; Im = Im + 2; END; ELSE DO; Bresult = '0'B; Bmoretodo = '0'B; END; END; /*H2.1.5 Blank specification --------------------------------------*/ WHEN('B') IF Yv = Xblank THEN DO; Iv = Iv + 1; Im = Im + 1; END; ELSE DO; Bresult = '0'B; Bmoretodo = '0'B; END; WHEN('b') IF Yv = Xblank THEN DO; Iv = Iv + 1; Im = Im + 1; END; ELSE Im = Im + 1; /*H2.1.6 invalid mask specification -------------------------------*/ OTHERWISE DO; Bresult = '0'B; Bmoretodo = '0'B; END; END;

00028704 00028809 00028903 00029013 00029103 00029203 00029304 00029409 00029503 00029603 00029704 00029803 00029913 00030003 00030109 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; *PROCESS AGGREGATE, OFFSET; *PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: ETMSK01, PROCEDURE TO TEST EVERIFY */ /********************************************************************/ /* PGM_ENTRY: ETMSK01 */ /* AUTHOR: DIPL.ING. WERNER HOFFMANN */ /* Date written: 2009/09/17 */ /* */ /* CALL: */ /* BVERIFY = EVERIFY(XVALUE,XMASK); */ /* */ /* Data: SYSIN - Test Data in format DATA, */ /* SYSPRINT - Testresult. */ /********************************************************************/ ETMASK1: /* ENTRY POINT */ PROC OPTIONS(MAIN) REORDER; DCL XVALUE CHAR(30) VARYING STATIC;/* VALUE */ DCL XMASK CHAR(40) VARYING STATIC;/* MASK */ DCL XRESULT CHAR(13) STATIC; /* RESULT MSG */ DCL BVERIFY BIT(1); /*RESULT EVERIFY */ DCL BMORETODO BIT(1) INIT('1'B); /*CONTROLLING TEST LOOP */ DCL EVERIFY ENTRY(CHAR(30) VARYING,CHAR(40) VARYING) Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00001000 00002000 00003000 00004001 00005000 00006001 00007000 00010013 00050000 00060000 00070001 00099700 00099813 00099913 00100013 00100114 00101013 00110005 00120005 00121014 00130014 00140014 00151002 Page: 3

Software Engineering -

Task 2: Stores Movement Summary-Maintenance Function EVERIFY

RETURNS(BIT(1));

Date: 10/25/2009

/* 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 XVALUE XVALUE XVALUE XVALUE XVALUE

= = = = = =

'C3/1234 ', 'C/123 ', 'C3AB/1234 ', 'C3AB/12345', 'C3/1234 X ', '13/1234 ',

XMASK XMASK XMASK XMASK XMASK XMASK

= = = = = =

'LAaa>/NNNnnnnBBBB'; 'LAaa>/NNNnnnnBBBB'; 'LAaa>/NNNnnnnBBBB'; 'LAaa>/NNNnnnnBBBB'; 'LAaa>/NNNnnnnBBBB'; 'LAaa>/NNNnnnnBBBB';

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

Page: 4

Software Engineering -

XVALUE XVALUE XVALUE XVALUE

= = = =

'V3/1A34 'V3/1234 '/123456 'C3/1234

Task 2: Stores Movement Summary-Maintenance

Date: 10/25/2009

Function EVERIFY

', ', ', ',

XMASK XMASK XMASK XMASK

= = = =

'LAaa>/NNNnnnnBBBB'; 'LAaa>/NNNnnnnB'; 'LAaa>/NNNnnnnBBBB'; 'LAaa>/NNNnnnnbbbb';

Report Output: File: TASK01T1.TXT 1 0

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

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: [email protected]

Page: 5

Software Engineering -

Task 2: Stores Movement Summary-Maintenance Function EVERIFY

IEF285I P390A.P390AC.JOB01780.D0000102.? IEF285I P390A.P390AC.JOB01780.D0000103.? IEF285I P390A.P390AC.JOB01780.D0000104.? IEF285I P390A.RUN.DATA IEF285I VOL SER NOS= USR001. IEF373I STEP/GO /START 2009280.1523 IEF374I STEP/GO /STOP 2009280.1523 CPU EXT 7036K SYS 9208K IEF375I JOB/P390AC /START 2009280.1523 IEF376I JOB/P390AC /STOP 2009280.1523 CPU 1V3TMSK01 STARTED. C3/1234 C/123 C3AB/1234 C3AB/12345 C3/1234 X 13/1234 V3/1A34 V3/1234 /123456 C3/1234 V3TMSK01 ENDED.

LAaa>/NNNnnnnBBBB LAaa>/NNNnnnnBBBB LAaa>/NNNnnnnBBBB LAaa>/NNNnnnnBBBB LAaa>/NNNnnnnBBBB LAaa>/NNNnnnnBBBB LAaa>/NNNnnnnBBBB LAaa>/NNNnnnnB LAaa>/NNNnnnnBBBB LAaa>/NNNnnnnbbbb

Date: 10/25/2009

SYSOUT SYSOUT SYSOUT KEPT

0MIN 00.31SEC SRB

0MIN 00.80SEC VIRT

0MIN 00.31SEC SRB

0MIN 00.80SEC

IS IS IS IS IS IS IS IS IS IS

100K SYS

244K

OK. IN ERROR. OK. OK. IN ERROR. IN ERROR. IN ERROR. IN ERROR. IN ERROR. OK.

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

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; *PROCESS AGGREGATE, OFFSET, CMPAT(V1); *PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: Stores Summary Movements V04 */ /********************************************************************/ /* Produce Stores Movement Summary Report */ /* Publications: see PGM Design V04 */ /* */ /* Author: Dipl.Ing. Werner Hoffmann */ /* Date Written: 1907/03/05 */ /* Date Changed: 2009/08/28 */ /* */ /* PROCEDURE: MAIN */ /* TASK: This program produce a Stores Summary Report. */ /* REPORT-ID: SMS */ /* Standard subroutines used: */ /* EPRINT - Report Procedure, */ /* using Print Control Block V3DPCB01 */ /* EMSG - Message Print Routine */ /* using Message Control Block V3DMSG01 */ /* EADDR1 - Get new Address by a given displacement */ /* EVERIFY- Check Part Number */ /* */ /* Files: */ /* Input: FSM - Stores Movements, Record Layout see: SSM */ /* Output: FSMS- Report Stores Summary Movements, */ /* Print Line Layout: see SFSMS */ /* MSG - Messages - standard layout used. */ /* Notes: */ /* */ /********************************************************************/ EPSMSV4: PROC OPTIONS(MAIN) REORDER; /*** DCL DCL DCL 1 2 2 2 2 2 2 2 2 /*** DCL DCL DCL 1 2 2 2 2

File FSM ---------------------------------------------------*/ FSM FILE RECORD INPUT /* Stores Movements */ ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); PSM POINTER STATIC; /*Pointer to SM Record */ SSM BASED(PSM), /*SM Record Layout */ XRID CHAR(2), /*Record ID */ XRTYPE CHAR(1), /*Record Type, I OR R */ XPARTNO CHAR(10), /*Part Number */ NDATE PIC'99999999', /*Date YYYYMMDD */ NTIME PIC'9999', /*Time HHMM */ X01 CHAR(1), /*Filler */ NQTY PIC'99999999', /*Quantity */ X02 CHAR(46); /*Filler */ FILE FSMS --------------------------------------------------*/ FSMS FILE RECORD OUTPUT /* */ ENV(CONSECUTIVE RECSIZE(133)); PFSMS POINTER STATIC; /*Pointer to Print Line */ SFSMS BASED(PFSMS), /*Stores Movement Summary Prtl*/ XASA CHAR(1), /*ASA Control Character */ XPARTNO CHAR(10), /*Part Number */ X01 CHAR(05), /*Filler */ NRECEIPT PIC'ZZZZZZZZZ9', /*Receipt Summary per Part/Ass*/

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00001000 00002000 00003000 00004005 00005000 00006005 00007005 00008000 00009005 00010005 00020005 00030000 00031000 00032005 00033000 00034005 00034105 00034205 00034305 00034405 00034505 00034605 00034700 00034805 00034905 00035005 00035105 00035209 00035405 00035500 00036000 00037009 00038000 00039000 00040009 00050011 00060000 00080011 00090011 00100011 00101011 00102011 00103011 00104011 00105011 00106011 00107011 00109000 00110011 00120000 00130011 00131011 00132011 00133011 00134011 00135011 Page: 1

Software Engineering -

2 2 2 2 2 DCL

X02 NISSUE X03 NNETS X04 YASA

Task 2: Stores Movement Summary - Maintenance

CHAR(05), /*Filler PIC'ZZZZZZZZZ9', /*Issue Summary per Part/Ass. CHAR(04), /*Filler PIC'SSSSSSSSSS9', /*Net Summary per Part/Ass CHAR(77); /*Filler CHAR(1) STATIC INIT(' ');/*Next ASA Control Char.

%INCLUDE SYSSRC(V3DPCB04);

/*Print Control Block

Date: 10/25/2009

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

DCL 1 2 2 /*** DCL

SCB YASSNO YPARTNO FILE FMSG FMSG

STATIC, /*Group Control Block */ CHAR(04), /*New Assembly Number */ CHAR(10); /*New Part Number */ --------------------------------------------------*/ FILE RECORD OUTPUT /* */ ENV(CONSECUTIVE RECSIZE(121)); DCL PMSG POINTER STATIC; /*Pointer to Message Line */ %INCLUDE SYSSRC(V3DMSG01); /*Message Control Block */ /*** DCL 1 2 2 2 2

Group Net SGNETM XPARTNO NISSUE NRECEIPT NNETS

Movements Informations -- Parts ------------------*/ STATIC, /*Group Net Movements */ CHAR(10), /*Part Number */ BIN FIXED(31), /*Net Issues */ BIN FIXED(31), /*Net Receipts */ BIN FIXED(31); /*Net Movements */

/*** DCL 1 2 2 2 2

Group Net SANETM XASSNO NISSUE NRECEIPT NNETS

Movements Informations -- Assembly ---------------*/ STATIC, /*Assembly Net Movements */ CHAR(04), /*Assembly Number */ BIN FIXED(31), /*Net Issues */ BIN FIXED(31), /*Net Receipts */ BIN FIXED(31); /*Net Movements */

/*** DCL DCL DCL DCL

Subroutines/Functions/Builtin ------------------------------*/ EPRINT ENTRY(FILE,POINTER);/* Print Procedure */ EMSG ENTRY(FILE,POINTER);/* Message Print Routine */ EADDR1 ENTRY(POINTER,BIN FIXED(31)) RETURNS(POINTER); EVERIFY ENTRY(CHAR(30) VARYING,CHAR(40) VARYING) RETURNS(BIT(1)); ADDR BUILTIN; /* */ SUBSTR BUILTIN; /* */ PLIRETC BUILTIN; /* */ HIGH BUILTIN; /* */

DCL DCL DCL DCL

/*H1.1 Initate Routine --------------------------------------------*/ PFSMS = SPCB1.QPL; /*Point to Print Line */ PMSG = SMSG1.QPL; /*Point to Message Line */ OPEN FILE(FSM) INPUT; /*Open Stores Movement File */ OPEN FILE(FSMS) OUTPUT; /*Open Print File */ OPEN FILE(FMSG) OUTPUT; /*Open Message File */ SLINE.XASA = ' '; /*Prepare and print start msg */ SLINE.XMSGTYPE = 'I'; SLINE.XENO = 'SMS01'; SLINE.XMSGTXT = 'V3PSMSV4 Started.'; CALL EMSG(FMSG,PMSG1); /*H2 Process File FSM ===========================================*/ /*H3 Process all Groups of Netmovements (Assemblies and Parts)===*/ CALL EGETSM; /*Get first proved FSM Record */ DO WHILE(SCB.YASSNO¬=HIGH(4)); /*More to do? */ /*H4 Process one Group of Assembly ---------------------------------*/ /*H4.1 Group Assembly Processing (Initial Routine) -----------------*/ SANETM.XASSNO = SCB.YASSNO; /* Save Assembly Number */ SANETM.NISSUE = 0; /* Clear ISSUE Movements Sum. */ Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00135111 00135211 00135311 00135411 00136011 00137005 00137100 00138011 00139000 00139111 00139211 00139311 00139409 00139611 00139709 00139811 00139911 00140000 00140105 00140211 00140311 00140411 00140511 00140611 00140700 00140800 00140905 00141011 00141111 00141211 00141311 00141411 00141500 00141605 00141705 00141805 00141900 00142000 00142100 00142500 00142600 00142700 00142800 00142900 00143005 00143105 00143205 00144005 00145005 00145109 00145211 00145300 00145400 00145510 00145609 00146005 00147005 00148005 00149000 00150011 00160011 00161105 00161205 Page: 2

Software Engineering -

Task 2: Stores Movement Summary - Maintenance

Date: 10/25/2009

SANETM.NRECEIPT= 0; /* Clear RECEIPT Movements Sum*/ DO WHILE(SCB.YASSNO=SANETM.XASSNO); /*H5 Process one Group of Netmovements - Part ----------------------*/ /*H5.1 Group Netmovements Processing (Initial Routine) -------------*/ SGNETM.XPARTNO = SCB.YPARTNO; /*Save Part Number */ SGNETM.NISSUE = 0; /*Clear ISSUE Movements Sum. */ SGNETM.NRECEIPT= 0; /*Clear RECEIPT Movements Sum.*/ /*H6 Process SM Records for one Netmovement Group ==================*/ DO WHILE(SCB.YPARTNO=SGNETM.XPARTNO); /*H6.1 Process one SM Record -------------------------------------*/ SELECT(SSM.XRTYPE); /*H6.1.1 ISSUE Record ---------------------------------------------*/ WHEN('I') /* */ SGNETM.NISSUE = SGNETM.NISSUE + SSM.NQTY; /*H6.1.2 RECEIPT Record -------------------------------------------*/ WHEN('R') /* */ SGNETM.NRECEIPT = SGNETM.NRECEIPT + SSM.NQTY; /*H6.1.3 not used -------------------------------------------------*/ OTHERWISE; END; CALL EGETSM; /*Get next proved FSM Record */ END; /*H5.2 Group Netmovements Processing (Edit and Print Routine)------*/ SFSMS.XASA = YASA; /*ASA Control Character */ SFSMS.XPARTNO = SGNETM.XPARTNO; /*Prepare Print Line */ SFSMS.NISSUE = SGNETM.NISSUE; SFSMS.NRECEIPT= SGNETM.NRECEIPT; SFSMS.NNETS = SGNETM.NRECEIPT-SGNETM.NISSUE; CALL EPRINT(FSMS,PPCB1); /*Print Group Summary Line */ SANETM.NISSUE = SANETM.NISSUE + SGNETM.NISSUE;/*Aseembly Proc. */ SANETM.NRECEIPT= SANETM.NRECEIPT + SGNETM.NRECEIPT; YASA = ' '; /*Set ASA Control Character */ END; /*H4.2 Group Assembly Processing (Edit and Print Routine)----------*/ SFSMS.XASA = YASA; /*ASA Control Character */ SFSMS.XPARTNO = SANETM.XASSNO; /*Prepare Print Line */ SFSMS.NISSUE = SANETM.NISSUE; SFSMS.NRECEIPT= SANETM.NRECEIPT; SFSMS.NNETS = SANETM.NRECEIPT-SANETM.NISSUE; CALL EPRINT(FSMS,PPCB1); /*Print Group Summary Line */ YASA = '0'; /*Set ASA Control Character */ END; /*H1.2 Termination Routine ----------------------------------------*/ SLINE.XASA = ' '; /*Print Termination Message */ SLINE.XMSGTYPE = 'I'; SLINE.XENO = 'SMS01'; SLINE.XMSGTXT = 'V3PSMSV4 ended.'; CALL EMSG(FMSG,PMSG1); CLOSE FILE(*); /*Close all Open Files */ CALL PLIRETC(NRETC); /*Set Return Code */ EGETSM: PROC REORDER; /********************************************************************/ /* FSM Record Processing */ /* Task:-Get and return a proved SM record. */ /* -Detected errors are printed on file PRINT. */ /* Notes: - IF the SM record is error free, additional the */ /* assembly/part number will be picked up and are stored */ /* into YASSNO/YPARTNO. */ /********************************************************************/ DCL XVALUE CHAR(30) VARYING STATIC;/*Value need to proof */ DCL XMASK1 CHAR(40) VARYING STATIC /*Mask for Part Number */ INIT('LAaa>/NNNnnnnBBBB'); Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00161305 00161400 00161511 00161611 00161705 00161805 00161905 00162011 00162100 00162211 00162300 00162411 00162500 00162600 00162711 00162800 00162900 00163011 00163100 00163200 00163305 00163400 00163511 00163605 00163705 00163800 00163900 00164000 00164105 00164205 00164300 00164405 00164500 00164611 00164705 00164805 00164900 00165000 00165100 00165205 00165305 00165400 00165505 00165605 00165700 00165800 00165910 00166009 00166105 00166205 00166300 00167200 00167305 00167405 00167505 00167605 00167705 00167805 00167905 00168005 00168105 00168205 00168300 Page: 3

Software Engineering -

DCL

Task 2: Stores Movement Summary - Maintenance

Date: 10/25/2009

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: [email protected]

Page: 4

Software Engineering -

Task 2: Stores Movement Summary - Maintenance

Date: 10/25/2009

DO; SLINE.XASA = ' '; /*Print Error Message */ SLINE.XMSGTYPE = 'F'; SLINE.XENO = 'SMS04'; SLINE.XMSGTXT = 'Date '||SSM.NDATE|| ' is wrong. Needed Format: YYYYMMDD or value is false.'; CALL EMSG(FMSG,PMSG1); END; /*HG3.5 Check Quantity ---------------------------------------------*/ XVALUE = SSM.NQTY; IF ¬EVERIFY(XVALUE,XMASK2) THEN DO; SLINE.XASA = ' '; /*Print Error Message */ SLINE.XMSGTYPE = 'F'; SLINE.XENO = 'SMS05'; SLINE.XMSGTXT = 'Quantity '||SSM.NQTY|| ' has not a positive numeric value.'; CALL EMSG(FMSG,PMSG1); END; END; END; /*HG4 Record is in error, get next SM Record -----------------------*/ READ FILE(FSM) SET(PSM); /*Get next FSM Record */ END; /*HG5 SM Record is ok. , pick up SCB fields ------------------------*/ SCB.YPARTNO = SSM.XPARTNO; SCB.YASSNO = SUBSTR(SSM.XPARTNO,1,INDEX(SSM.XPARTNO,'/')-1); LRETURN: RETURN; ESMOK: PROC REORDER RETURNS(BIT(1)); /********************************************************************/ /* SM Record - Precheck Routine */ /* Result: '1'B SM record is ok. */ /* '0'B SM record is in error */ /* Note:-Control will be returned on first error. */ /* -There is a dependency between this routine and routine */ /* EGETSM. */ /********************************************************************/ DCL VALIDDATE BUILTIN; /* */ /*HC1.1 Check Record ID --------------------------------------------*/ IF SSM.XRID ¬= 'SM' THEN RETURN('0'B); ELSE /*HC1.2 Check Record Type ------------------------------------------*/ IF INDEX('IR',SSM.XRTYPE) = 0 THEN RETURN('0'B); ELSE DO; /*HC1.3 Check Part Number ------------------------------------------*/ XVALUE = SSM.XPARTNO; IF ¬EVERIFY(XVALUE,XMASK1) THEN RETURN('0'B); /*HC1.4 Check Date -------------------------------------------------*/ IF ¬VALIDDATE(SSM.NDATE,'YYYYMMDD') THEN RETURN('0'B); /*HC1.5 Check Quantity ---------------------------------------------*/ XVALUE = SSM.NQTY; IF ¬EVERIFY(XVALUE,XMASK2) THEN RETURN('0'B); END; Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00175000 00175105 00175200 00175300 00175400 00175500 00175609 00175800 00175905 00176000 00176100 00176200 00176300 00176405 00176500 00176600 00176700 00176800 00176909 00177100 00177200 00177300 00177405 00177505 00177700 00177805 00178001 00178101 00178204 00178300 00178405 00178501 00178601 00178701 00178801 00178901 00179009 00179109 00179209 00179309 00179409 00179509 00180305 00180405 00180501 00181401 00181505 00181701 00181801 00182701 00182801 00182905 00183001 00183101 00183201 00184105 00184201 00184301 00185205 00185301 00185401 00185501 00186401 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 */ /********************************************************************/ /* Print Control Block PGM V3PSMSV4 */ /********************************************************************/ DCL PPCB1 POINTER INIT(ADDR(SPCB1));/*Pointer to PCB */ DCL 1 SPCB1 UNALIGNED, /* Print Control Block */ 2 QSN POINTER /* Address of Page Number */ INIT(EADDR1(ADDR(SPCB1.YHL(1)),52)), 2 QDT POINTER /* Address Edit-Date */ INIT(EADDR1(ADDR(SPCB1.YHL(2)),49)), 2 QPL POINTER /* Address of Print Area */ INIT(ADDR(SPCB1.YPL)), 2 MLCNT BIN FIXED(15) /* Number of max. Lines per Page */ INIT(60), 2 MLNO BIN FIXED(15) /* Residuary printable No. of Lines*/ INIT(0), 2 MPNO BIN FIXED(15) /* Current Page Number */ INIT(0), 2 MHNO BIN FIXED(15) /* Number of Header Lines */ INIT(4), 2 YPL CHAR(133) /* PrintLine -Communication Area---*/ INIT((133)' '), 2 YHL(4) CHAR(133) INIT /* Header Lines */ ('1--- Stores Movement Summary Page: NNNNN ', ' Report: SMS XYZ FACTORY Date: DD.MM.YY ', ' Part_Number Receipts Issues Net_Summary ', ' _______________________________________________________ ');

00010001 00020000 00030001 00040000 00050000 00060000 00070000 00080000 00081000 00082000 00090000 00091000 00100000 00110000 00120000 00130000 00140000 00150000 00160000 00170000 00180000 00190000 00200000 00210000 00220000 00221000 00222000 00222100 00222200 00223000 00224000 00230000

File: V3DMSG01.txt /*PPL-TITLE: MSG Control Block V01 */ /********************************************************************/ /* Message Control Block PGM V3PSMSV3 */ /********************************************************************/ DCL PMSG1 POINTER INIT(ADDR(SMSG1));/*Pointer to MSG CB */ DCL 1 SMSG1 UNALIGNED, /* Message Control Block */ 2 QSN POINTER /* Address of Page Number */ INIT(EADDR1(ADDR(SMSG1.YHL(1)),112)), 2 QDT POINTER /* Address Edit-Date */ INIT(EADDR1(ADDR(SMSG1.YHL(2)),109)), 2 QPL POINTER /* Address of Message Print Area */ INIT(ADDR(SMSG1.YPL)), 2 MLCNT BIN FIXED(15) /* Number of max. lines per page */ INIT(60), 2 MLNO BIN FIXED(15) /* Residuary printable No. of lines*/ INIT(0), Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00010008 00020002 00030008 00040002 00050008 00060008 00070008 00080009 00081008 00082010 00083008 00084002 00085008 00086002 00087008 00088002 Page: 6

Software Engineering -

2

Task 2: Stores Movement Summary - Maintenance

Date: 10/25/2009

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: [email protected]

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; *PROCESS AGGREGATE, OFFSET, CMPAT(V1); *PROCESS OPT(2) TEST(ALL,SYM) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: Print Routine */ /********************************************************************/ /* */ /* ENTRY POINT: EPRINT */ /* AUTHOR: DIPL.ING. WERNER HOFFMANN */ /* PUBLICATIONS: SC33-0009 PL/I LANGUAGE REFERENCE MANUAL */ /* SC33-0006 PL/I PROGRAMMER'S GUIDE */ /* DATE WRITTEN: 1972/03/05 */ /* DATE CHANGED: 2009/08/28 */ /* */ /* DEFINITION: -THE PROCEDURE EPRINT WRITES A PRINT LINE DEFINED */ /* IN THE PCB (PRINT CONTROL BLOCK) TO THE DEFINED */ /* PRINT DATA SET. */ /* -IF NECESSARY HEADER LINES ARE PRINTED BEFORE THE */ /* PRINT LINE IS WRITTEN. */ /* -FOLLOWING ASA CONTROL CHARACTER ARE ACCEPTED: */ /* '1' - NEW PAGE */ /* ' ' - (BLANK) NEW LINE */ /* '0' - ONE SPACE LINE */ /* '-' - TWO SPACE LINES */ /* -METHOD USED: RECORD I/O, MOVE MODUS */ /* */ /* PROCEDURE CALL: */ /* CALL EPRINT(DDFILE,PPCB); */ /* | +--- POINTER TO PRINT CB */ /* +---------- FILE NAME */ /* */ /* DEFINITION IN CALLING PROCEDURE: */ /* DCL EPRINT ENTRY(FILE,POINTER); */ /* DCL DDFILE FILE RECORD OUTPUT ENV(CONSECUTIVE RECSIZE(133)); */ /* PRINT CONTROL BLOCK, EXAMPLE SEE V3DPCM00 */ /* CODING IN CALLING PROCEDURE: */ /* INITIAL ROUTINE: */ /* OPEN FILE(DDFILE) OUTPUT; */ /* TERMINATION ROUTINE: */ /* CLOSE FILE(DDFILE); */ /* */ /* CALLING ROUTINES/FUNCTIONS: */ /* EDATE */ /* */ /* NOTES: - AFTER PRINTING OF THE LINE: */ /* - THE LINE WILL BE INITIALIZED BY ' ' (BLANK) */ /* CHARACTERS. */ /* */ /********************************************************************/ EPRINT: PROC(DDFILE,PPCB); /* */ DCL PPCB POINTER; /* POINTS TO PCB */ DCL NHNO BIN FIXED(15) STATIC;/* NUMBER HEADER LINES */ DCL 1 SPCBA BASED(PPCB), /*DSECT PCB */ 2 QSN POINTER, /*ADDRESS OF PAGE NUMBER */ 2 QDT POINTER, /*ADDRESS EDIT.DATE */ 2 QPL POINTER, /*ADDRESS PRINT LINE */ Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00001003 00002004 00003003 00010020 00020000 00030000 00040000 00041000 00050000 00060000 00070000 00080000 00090000 00100000 00110000 00120000 00130000 00140000 00150000 00160000 00170000 00180000 00190000 00200000 00210000 00220000 00230000 00240000 00241000 00243000 00250000 00260000 00261019 00261219 00261319 00261419 00261519 00261619 00261719 00261819 00261920 00262020 00262120 00262220 00262320 00263000 00264000 00270000 00280000 00290000 00300008 00301007 00310008 00320000 00330000 00340011 Page: 8

Software Engineering -

2 2 2 2 2 2 DCL DCL DCL 1 2 2 DCL DCL DCL DCL DCL DCL DCL DCL /*H1

Task 2: Stores Movement Summary - Maintenance

Date: 10/25/2009

MLCNT BIN FIXED(15), /*MAX. NUMBER LINES/PAGE */ MLNO BIN FIXED(15), /*NUMBER OF REMAINING PRINTABLE L. */ MPNO BIN FIXED(15), /*PAGE NUMBER */ MHNO BIN FIXED(15), /*NUMBER HEADER LINES */ YPZ CHAR(133), /*PRINT LINE */ YHL(1:NHNO REFER(SPCBA.MHNO)) CHAR(133); /*HEADER LINES */ DSNR PIC'ZZZZ9' BASED(SPCBA.QSN);/*PAGE NUMBER */ PL POINTER STATIC;/*POINTER TO BASED LINE */ SL BASED(PL), /*PRINT LINE */ XASA CHAR(1), /*ASA CONTROL CHARACTER */ XLINE CHAR(132); /*PRINT AREA */ JHDR BIN FIXED(15) STATIC;/*CURRENT HEADER LINE */ XCASA CHAR(3) STATIC INIT(' 0-');/*ACCEPTED ASA C.CHAR. */ XCASASL CHAR(2) DEF(XCASA) POS(2); /*ASA C.CHR.WITH SKIPL.*/ DDFILE FILE; /* RECORD I/O DEFINITION */ (ADDR,INDEX) BUILTIN; /* */ EDATE ENTRY(POINTER);/*EDIT DATE ROUTINE */ PDDMY POINTER STATIC;/*POINTER TO DATE FIELD */ YDATE CHAR(8) BASED(PDDMY);/*DATE,FORMAT TT.MM.YY */ -CHECK FOR EARLY PAGE CHANGE --------------------------------*/ PL = ADDR(SPCBA.YPZ); IF SL.XASA = '1' THEN DO; SPCBA.MLNO = 0; /*PREPARE FOR NEW PAGE */ SL.XASA = ' '; /*CHANGE ASA C.CHAR. TO DEFAULT */ END;

/*H2

-CHECK FOR PRINTING HEADER LINES ----------------------------*/ IF SPCBA.MLNO-INDEX(XCASASL,SL.XASA)<=0 /*NEED FOR NEW PAGE?*/ THEN DO; /*H2.1 -CHECK FOR SETTING DATE INTO HEADER LINE --------------------*/ PDDMY = SPCBA.QDT; /*POINT TO DATE FIELD */ IF YDATE = 'DD.MM.YY' /*NOT ESTABLISHED? */ THEN DO; CALL EDATE(PDDMY); /*GET AND EDIT DATE */ END; /*H2.2 -PRINT HEADER LINES -----------------------------------------*/ SPCBA.MLNO=SPCBA.MLCNT;/*INIT LINE COUNTER */ SPCBA.MPNO=SPCBA.MPNO 1; /*COUNT PAGE NUMBER */ DSNR = SPCBA.MPNO; /*EDIT PAGE NUMBER */ DO JHDR = 1 TO SPCBA.MHNO;/*STEP THROUGH HEADER AREA */ PL = ADDR(SPCBA.YHL(JHDR));/*POINT TO HEADER LINE */ WRITE FILE(DDFILE) FROM(SL);/*WRITE HEADER LINE */ IF SL.XASA = '1' /* NEW PAGE , COUNT 1ST LINE AS 1 */ THEN SPCBA.MLNO = SPCBA.MLNO - 1; ELSE SPCBA.MLNO = SPCBA.MLNO INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES*/ END; END; /*H3

-WRITE PRINT LINE -------------------------------------------*/ WRITE FILE(DDFILE) FROM(SPCBA.YPZ);/*WRITE PRINT LINE */ PL = SPCBA.QPL; /*POINT TO PRINT LINE */ SPCBA.MLNO = SPCBA.MLNO INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES */ SPCBA.YPZ = (133)' '; /*INITIATE PRINT LINE */ END EPRINT;

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00350000 00351000 00352000 00353000 00360006 00370011 00380000 00390010 00400010 00410000 00420000 00430000 00440000 00441009 00450000 00460000 00461001 00462011 00463001 00470000 00482007 00483015 00490000 00500000 00510000 00520000 00530000 00540000 00541000 00542000 00550009 00560000 00570000 00571001 00572001 00573002 00574001 00575001 00576004 00577001 00579101 00580000 00590000 00600000 00610004 00620011 00630000 00631018 00632023 00633022 00650000 00660000 00670000 00671000 00672000 00680000 00690011 00700000 00701000 00710006 00720000 00730000 Page: 9

Software Engineering -

Task 2: Stores Movement Summary - Maintenance

Date: 10/25/2009

File: V3PEMSG.txt *PROCESS OPTIONS INSOURCE SOURCE NEST MACRO STORAGE; *PROCESS AGGREGATE, OFFSET, CMPAT(V1); *PROCESS OPT(2) TEST(ALL,SYM) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: Message Print Routine */ /********************************************************************/ /* */ /* ENTRY POINT: EMSG */ /* AUTHOR: DIPL.ING. WERNER HOFFMANN */ /* PUBLICATIONS: SC33-0009 PL/I LANGUAGE REFERENCE MANUAL */ /* SC33-0006 PL/I PROGRAMMER'S GUIDE */ /* DATE WRITTEN: 1972/03/05 */ /* DATE CHANGED: 2009/08/28 */ /* */ /* DEFINITION: -THE PROCEDURE EMSG WRITES A PRINT LINE DEFINED */ /* IN THE PCB (PRINT CONTROL BLOCK) TO THE DEFINED */ /* PRINT DATA SET. */ /* -IF NECESSARY HEADER LINES ARE PRINTED BEFORE THE */ /* PRINT LINE IS WRITTEN. */ /* -FOLLOWING ASA CONTROL CHARACTER ARE ACCEPTED: */ /* '1' - NEW PAGE */ /* ' ' - (BLANK) NEW LINE */ /* '0' - ONE SPACE LINE */ /* '-' - TWO SPACE LINES */ /* -METHOD USED: RECORD I/O, MOVE MODUS */ /* */ /* PROCEDURE CALL: */ /* CALL EMSG(DDFILE,PMCB); */ /* | +---- POINTER TO PRINT CB */ /* +----------- FILE NAME */ /* */ /* DEFINITION IN CALLING PROCEDURE: */ /* DCL EMSG ENTRY(FILE,POINTER); */ /* PRINT FILE: */ /* DCL DDFILE FILE RECORD OUTPUT ENV(CONSECUTIVE RECSIZE(121)); */ /* MESSAGE CONTROL BLOCK, EXAMPLE SEE V3DMCB00 */ /* CODING IN CALLING PROCEDURE: */ /* INITIAL ROUTINE: */ /* OPEN FILE(DDFILE) OUTPUT; */ /* TERMINATION ROUTINE: */ /* CLOSE FILE(DDFILE); */ /* */ /* CALLING ROUTINES/FUNCTIONS: */ /* EDATE */ /* */ /* NOTES: - AFTER PRINTING OF THE LINE: */ /* - THE LINE WILL BE INITIALIZED BY ' ' (BLANK) */ /* CHARACTERS. */ /* - THE HIGHEST REURN CODE IS SAVED INTO FIELD */ /* NRETC. */ /* MSG-TYPE/RETURNCODE: */ /* W => 4, F => 8, E => 12, T => 16 */ /* I -> Informational message */ /* W -> Warning message */ /* F -> Failure message */ /* E -> Emergency message */ /* T -> Terminational message */ /* */ /********************************************************************/ EMSG: Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected] 10

00001000 00002000 00003000 00010008 00020000 00030000 00040001 00041000 00050000 00060000 00070000 00080000 00090000 00100001 00110000 00120000 00130000 00140000 00150000 00160000 00170000 00180000 00190000 00200000 00210000 00220000 00230005 00240000 00241000 00243000 00250000 00260001 00261001 00261307 00261407 00261507 00261607 00261707 00261807 00261907 00262407 00262508 00262608 00262708 00262808 00262908 00263000 00263101 00263201 00263301 00263401 00264011 00264111 00264211 00264311 00264411 00265011 00270000 00280001 Page:

Software Engineering -

DCL DCL DCL 1 2 2 2 2 2 2 2 2 2 2 DCL DCL DCL 1 2 2 2 2 2 DCL DCL DCL DCL DCL DCL DCL DCL /*H1

Task 2: Stores Movement Summary - Maintenance

Date: 10/25/2009

PROC(DDFILE,PMCB); /* */ PMCB POINTER; /* POINTS TO MCB */ NHNO BIN FIXED(15) STATIC;/* NUMBER HEADER LINES */ SMCBA BASED(PMCB), /*DSECT MCB */ QSN POINTER, /*ADDRESS OF PAGE NUMBER */ QDT POINTER, /*ADDRESS EDIT.DATE */ QPL POINTER, /*ADDRESS PRINT LINE */ MLCNT BIN FIXED(15), /*MAX. NUMBER LINES/PAGE */ MLNO BIN FIXED(15), /*NUMBER OF REMAINING PRINTABLE L. */ MPNO BIN FIXED(15), /*PAGE NUMBER */ MHNO BIN FIXED(15), /*NUMBER HEADER LINES */ NRETC BIN FIXED(31), /*HIGHEST RETURN CODE */ YPZ CHAR(121), /*PRINT LINE */ YHL(1:NHNO REFER(SMCBA.MHNO)) CHAR(121); /*HEADER LINES */ DSNR PIC'ZZZZ9' BASED(SMCBA.QSN);/*PAGE NUMBER */ PL POINTER STATIC;/*POINTER TO BASED LINE */ SL BASED(PL), /*DSECT MESSAGE LINE */ XASA CHAR(1), /*ASA CONTROL CHARACTERR */ XMSGTYPE CHAR(1), /*MESSAGE TYPE */ XENO CHAR(5), /*ERROR NUMBER */ XSPACE CHAR(1), /* */ XMSGTXT CHAR(113); /*MESSAGE TEXT */ JHDR BIN FIXED(15) STATIC;/*CURRENT HEADER LINE */ XCASA CHAR(3) STATIC INIT(' 0-');/*ACCEPTED ASA C.CHAR. */ XCASASL CHAR(2) DEF(XCASA) POS(2); /*ASA C.CHR.WITH SKIPL.*/ DDFILE FILE; /* RECORD I/O DEFINITION */ (ADDR,INDEX,MAX) BUILTIN;/* */ EDATE ENTRY(POINTER);/*EDIT DATE ROUTINE */ PDDMY POINTER STATIC;/*POINTER TO DATE FIELD */ YDATE CHAR(8) BASED(PDDMY);/*DATE,FORMAT TT.MM.YY */ -CHECK FOR EARLY PAGE CHANGE --------------------------------*/ PL = ADDR(SMCBA.YPZ); IF SL.XASA = '1' THEN DO; SMCBA.MLNO = 0; /*PREPARE FOR NEW PAGE */ SL.XASA = ' '; /*CHANGE ASA C.CHAR. TO DEFAULT */ END;

/*H2

-CHECK FOR PRINTING HEADER LINES ----------------------------*/ IF SMCBA.MLNO-INDEX(XCASASL,SL.XASA)<=0 /*NEED FOR NEW PAGE?*/ THEN DO; /*H2.1 -CHECK FOR SETTING DATE INTO HEADER LINE --------------------*/ PDDMY = SMCBA.QDT; /*POINT TO DATE FIELD */ IF YDATE = 'DD.MM.YY' /*NOT ESTABLISHED? */ THEN DO; CALL EDATE(PDDMY); /*GET AND EDIT DATE */ END; /*H2.2 -PRINT HEADER LINES -----------------------------------------*/ SMCBA.MLNO=SMCBA.MLCNT;/*INIT LINE COUNTER */ SMCBA.MPNO=SMCBA.MPNO + 1; /*COUNT PAGE NUMBER */ DSNR = SMCBA.MPNO; /*EDIT PAGE NUMBER */ DO JHDR = 1 TO SMCBA.MHNO;/*STEP THROUGH HEADER AREA */ PL = ADDR(SMCBA.YHL(JHDR));/*POINT TO HEADER LINE */ WRITE FILE(DDFILE) FROM(SL);/*WRITE HEADER LINE */ IF SL.XASA = '1' /* NEW PAGE , COUNT 1ST LINE AS 1 */ THEN SMCBA.MLNO = SMCBA.MLNO - 1; ELSE SMCBA.MLNO = SMCBA.MLNO INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES*/ Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected] 11

00290005 00300005 00301000 00310005 00320000 00330000 00340000 00350000 00351000 00352000 00353000 00354001 00360001 00370005 00380005 00390000 00400011 00410010 00420010 00421010 00422010 00423010 00430000 00440000 00441010 00450000 00460004 00461000 00462000 00463000 00470000 00482000 00483005 00490011 00500000 00510000 00520005 00530011 00540000 00541000 00542000 00550005 00560000 00570000 00571000 00572005 00573000 00574000 00575000 00576000 00577000 00579100 00580005 00590005 00600005 00610005 00620005 00630011 00631011 00632011 00633011 00650000 Page:

Software Engineering -

Task 2: Stores Movement Summary - Maintenance

Date: 10/25/2009

END; END; /*H3

-WRITE PRINT LINE -------------------------------------------*/ WRITE FILE(DDFILE) FROM(SMCBA.YPZ);/*WRITE PRINT LINE */ PL = SMCBA.QPL; /*POINT TO PRINT LINE */ SMCBA.MLNO = SMCBA.MLNO INDEX(XCASA,SL.XASA);/*CALC.REMAINING LINES */ /*SAVE HIGEST RETURN CODE */ SMCBA.NRETC = MAX(SMCBA.NRETC,INDEX(' W F E T', SL.XMSGTYPE)); SMCBA.YPZ = (121)' '; /*INITIATE PRINT LINE */ END EMSG;

00660000 00670000 00671000 00672000 00680005 00690005 00700005 00701011 00701101 00702005 00703011 00710005 00720000 00730001

File: V3PSERDA.TXT *PROCESS OPTIONS SOURCE NEST MACRO STORAGE; *PROCESS AGGREGATE, OFFSET; *PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: GET AND EDIT SYSTEM DATE */ /********************************************************************/ /* FUNCTION TO GET ACTUAL SYSTEM DATE */ /* PUBLICATIONS: */ /* - C28-8201-2 */ /* */ /* AUTHOR: DIPL.ING. WERNER HOFFMANN */ /* DATE WRITTEN: 1972/03/05 */ /* DATE CHANGED: 2009/08/28 */ /* */ /* PROCEDURE CALL: CALL EDATE (PPOS); */ /* +---- ADDRESS OF DATE FIELD */ /* DECLARATION: */ /* DCL EDATE ENTRY(POINTER); */ /* */ /* NOTES: - THE RESULTING FORMAT WILL BE: */ /* DD.MM.YY */ /* | | + YEAR */ /* | +--- MONTH */ /* +------ DAY */ /********************************************************************/ EDATE: PROC(PPOS) REORDER; DCL XDATE CHAR(6) STATIC;/*SYSTEM DATE */ DCL 1 S1DATE DEF XDATE, /* DATE */ 2 XYY CHAR(2), /* YEAR */ 2 XMM CHAR(2), /* MONTH */ 2 XDD CHAR(2); /* DAY */ DCL PE POINTER STATIC;/*POINTER TO ADDRESS OF DATE */ DCL PPOS POINTER; /* ADDRESS OF PRINTED DATE */ DCL XPRDATE CHAR(8) BASED(PE);/*PRINTED DATE */ DCL DATE BUILTIN; /* */ /*H1 /*

GET SYSTEM DATE AND REFORMAT DATE, RETURN REFORMATED DATE TO THE CALLING ROUTINE PE=PPOS; /*POINT TO PRINT AREA XDATE = DATE; /*PICK UP SYSTEM DATE & EDIT DATE XPRDATE=S1DATE.XDD||'.'||S1DATE.XMM||'.'||S1DATE.XYY; END EDATE;

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected] 12

*/ */ */ */

00001003 00002002 00003003 00010001 00020000 00030000 00031000 00032000 00033000 00033101 00034001 00035001 00036001 00040000 00050000 00070000 00080000 00090000 00091000 00092000 00093000 00094000 00095000 00100000 00110000 00120000 00130000 00140000 00141000 00142000 00143000 00144000 00150000 00151001 00160000 00161000 00161103 00161203 00162000 00163000 00163100 00164000 00165000 Page:

Software Engineering -

Task 2: Stores Movement Summary - Maintenance

Date: 10/25/2009

File: V3PSERA1.TXT *PROCESS OPTIONS SOURCE NEST MACRO STORAGE; *PROCESS AGGREGATE, OFFSET; *PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: CALCULATE NEW ADDRESS BY ADDING A GIVEN DISPLACEMENT */ /********************************************************************/ /* FUNCTION TO GET A NEW ADDRESS BY ADDING A GIVEN DISPLACEMENT */ /* FUNCTION-CALL: P=EADDR1(PCHAR,NPOS); */ /* | +--- DISPLACEMENT +0...max. F(31) */ /* | MAX.VALUE: 32767 */ /* +--------- POINTER */ /* DECLARATION: */ /* DCL EADDR1 ENTRY(POINTER,BIN FIXED(31)) RETURNS(POINTER); */ /* */ /********************************************************************/ EADDR1: PROC(PCHAR,NPOS) RETURNS(POINTER); DCL PE POINTER STATIC;/*POINTER TO ADDRESS AREA */ DCL PCHAR POINTER; /*STARTING ADDRESS */ DCL NPOS BIN FIXED(31); /*DISPLACEMENT */ DCL XC(32767) CHAR(1) BASED(PE);/* BYTE AREA */ DCL ADDR BUILTIN; /* ADDRESS BUILTIN FUNCTION */ /*H1 /*

CALCULATE NEW ADDRESS BY USING THE GIVEN DISPLACEMENT, RETURN NEW ADDRESS TO THE CALLING ROUTINE PE=PCHAR; /*INITIATE BYTE AREA ADDRESS RETURN(ADDR(XC(NPOS))); /*GET NEW ADDRESS & RETURN POINTER END EADDR1;

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected] 13

*/ */ */ */

00001003 00002001 00003003 00010003 00020000 00030003 00040000 00050000 00051003 00060000 00070000 00080000 00090000 00100000 00110000 00120000 00130000 00140000 00141002 00150000 00160000 00161000 00161103 00161203 00162000 00163003 00164000 00165000

Page:

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: [email protected] 14

Page:

Software Engineering -

Task 2: Stores Movement Summary - Maintenance

Date: 10/25/2009

Test Data: File: SMT201.txt SMIA5/13672 SMIA5/13672 SMIA5/13672 SMRA5/13672 SMRA5/17924 SMIA5/17924 SMIA5/820 SMIA6/13672 SMIA6/13672 SMIA6/13672 SMRA6/13672 SMRA6/17924 SMIA6/17924 SMIA61/821 SMIA7/13672 SMIA7/13672 SMIA7/13672 SMRA7/13672 SMRA7/17924 SMIA7/17924 SMIA71/821 SMIB7/13672 SMIB7/13672 SMIB7/13672 SMRB7/13672 SMRB7/17924 SMIB7/17924 SMIB71/823 SMIC7/13672 SMIC7/13672 SMIC7/13672 SMRC7/13672 SMRC7/17924 SMIC7/17924 SMIC71/823 SMID7/13672 SMID7/13672 SMID7/13672 SMRD7/13672 SMRD7/17924 SMID7/17924 SMID71/823 SMID8/13672 SMID8/13672 SMID8/13672 SMRD8/13672 SMRD8/17924 SMID8/17924 SMID81/8211 SMID9/13672 SMID9/13672 SMID9/13672 SMRD9/13672 SMRD9/17924 SMID9/17924 SMID91/821

200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150

120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected] 15

Page:

Software Engineering -

SMIE0/13672 SMIE0/13672 SMIE0/13672 SMRE0/13672 SMRD0/17924 SMID0/17924 SMID01/821 SMIE1/13672 SMIE1/13672 SMIE1/13672 SMRE1/13672 SMRD1/17924 SMRD1/17924 SMID11/821 SMIE2/13672 SMIE2/13672 SMIE2/13672 SMRE2/13672 SMIE2/17924 SMIE2/17924 SMIE21/821 SMIE3/13672 SMIE3/13672 SMIE3/13672 SMRE3/13672 SMID3/17924 SMID3/17924 SMID31/821 SMIE4/13672 SMIE4/13672 SMIE4/13672 SMRE4/13672 SMID4/17924 SMID4/17924 SMID41/821 SMIE4/13673 SMIE4/13673 SMIE4/13673 SMRE4/13673 SMIE4/17924 SMRE4/17924 SMIE41/821 SMIE4/13673 SMIF4/13673 SMIF4/13673 SMRF4/13673 SMIF4/17924 SMRF4/17924 SMIF41/821 SMIG4/13673 SMIG4/13673 SMRG4/13673 SMIG4/17924 SMRG4/17924 SMIG41/82 SMIH4/13673 SMIH4/13673 SMRH4/13673 SMIH4/17924 SMRH4/17924 SMIH41/82111 SMRI4/13673

Task 2: Stores Movement Summary - Maintenance

200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200802101430 200803121500 200803121610 200802030915 200802051030 200802021150 200803121610

Date: 10/25/2009

120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 120 310 50 100 10000 333 55 310 50 100 10000 333 55 310 50 100 10000 333 55 100

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected] 16

Page:

Software Engineering -

Task 2: Stores Movement Summary - Maintenance

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

Date: 10/25/2009

10000 333 55 100 10000 333 55 100 1OO 10000 --333 55 100 10000 333 55 100 10000 333 55 100 10000 10000 10000 333 55

Report Output: File: TASK0242.TXT 1 0

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

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: [email protected] 17

Page:

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 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: [email protected] 18

100K SYS

Page:

252K

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: [email protected] 19

Page:

Software Engineering 0I6/13673 I6/17924 I6 0I66/821 I66 0I7/13673 I7/17924 I7 0I76/821111 I76 0I8/13673 I8/17924 I8 0I86/82111 I86 0I9/13673 I9/17924 I9 0I96/821111 I96

100 0 100 0 0 100 333 433 0 0 100 333 433 0 0 100 333 433 0 0

Task 2: Stores Movement Summary - Maintenance 0 10000 10000 55 55 0 10000 10000 55 55 0 10000 10000 55 55 0 10000 10000 55 55

Date: 10/25/2009

+100 -10000 -9900 -55 -55 +100 -9667 -9567 -55 -55 +100 -9667 -9567 -55 -55 +100 -9667 -9567 -55 -55

1--- Store Movements Report --- Messages --MSG_No 1***5****10***5****20***5****30***5****40***5****50***5****60**5****70***5****80 ISMS01 V3PSMSV4 Started. 0ISMS02 SMIG41/82 200802021150 55 FSMS03 PART NUMBER G41/82 has an erroneous specification. See PGM description. 0ISMS02 SMRI6-13673 200802311010 1OO 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 FSMS05 Quantity --333 has not a positive numeric value. 0ISMS02 MBII9/17924 200802030915 10000 FSMS01 Record_ID MB is not SM as inspected. 0ISMS02 SMBI9/17924 200802030915 10000 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: [email protected] 20

PAGE: Date:

1 06.10.09

**in error,see below. **in error,see below.

**in error,see below. **in error,see below. **in error,see below.

Page:

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; *PROCESS AGGREGATE, OFFSET, CMPAT(V1); *PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: Task 03: Merge File FIA, FIB to File FOUT */ /********************************************************************/ /* Merge two datasets V01 */ /* Publications: see PGM Design Task 03,Example 1 */ /* */ /* Author: Dipl.Ing. Werner Hoffmann */ /* Date Written: 1907/03/05 */ /* Date Changed: 2008/08/28 */ /* */ /* PROCEDURE: MAIN */ /* TASK: This program merge two files to one output file. */ /* */ /* Files: */ /* Input: FIA - Input File */ /* FIB - Input File */ /* Output: FOUT- Output File */ /* Notes: */ /* */ /********************************************************************/ EPMERG1: PROC OPTIONS(MAIN) REORDER; /*** DCL DCL DCL 1 2 2 /*** DCL DCL DCL 1 2 2

File FIA ---------------------------------------------------*/ FIA FILE RECORD INPUT /* File IA */ ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); PIA POINTER STATIC; /*Pointer to IA Record */ SIA BASED(PIA), /*IA Record Layout */ XKEY CHAR(10), /*Key */ XTEXT CHAR(70); /*Text */ File FIB ---------------------------------------------------*/ FIB FILE RECORD INPUT /* File IB */ ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); PIB POINTER STATIC; /*Pointer to IA Record */ SIB BASED(PIB), /*IA Record Layout */ XKEY CHAR(10), /*Key */ XTEXT CHAR(70); /*Text */

/*** DCL

FILE FOUT --------------------------------------------------*/ FOUT FILE RECORD OUTPUT /* */ ENV(CONSECUTIVE RECSIZE(80));

DCL DCL 1 2 2

XCB SCB XKEYIA XKEYIB

/*** DCL

Builtin Functions ------------------------------------------*/ HIGH BUILTIN; /* */

CHAR(20) STATIC; DEF XCB, CHAR(10), CHAR(10);

/*Group Control Block /*Group Control Block /*Current key record IA /*Current key record IB

*/ */ */ */

/*H1.1 Initate Routine --------------------------------------------*/ OPEN FILE(FIA) INPUT; /*Open File IA */ OPEN FILE(FIB) INPUT; /*Open File IB */ OPEN FILE(FOUT) OUTPUT; /*Open File OUT */ Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00001000 00002000 00003000 00004000 00005000 00006000 00007000 00008000 00009000 00010000 00020000 00030000 00031000 00032000 00033000 00034000 00034100 00034200 00034300 00034400 00034500 00034600 00034700 00034800 00034900 00035000 00036000 00037000 00038000 00039000 00040000 00050000 00060000 00070000 00080000 00090000 00100000 00101000 00102000 00103000 00104000 00105000 00106000 00107000 00108000 00109000 00110000 00120000 00130000 00140000 00141000 00142000 00142100 00142200 00142300 00142400 00142500 Page: 1

Software Engineering -

Task 3: Merge 2 Data Sets V01

Date: 10/25/2009

/*H2 Merge File IA, IB to file OUT ==============================*/ /*H3 Process Group O --------------------------------------------*/ CALL EGETIA; /*Get first record file IA */ CALL EGETIB; /*Get first record file IB */ DO WHILE(XCB¬=HIGH(20)); /*More to do? */ /*H4.1 Process one Group IA-----------------------------------------*/ DO WHILE((XCB¬=HIGH(20)) & SCB.XKEYIA<=SCB.XKEYIB); /*H4.1.1 Process record IA -----------------------------------------*/ WRITE FILE(FOUT) FROM(SIA); CALL EGETIA; END; /*H4.2 Process one Group IB ----------------------------------------*/ DO WHILE((XCB¬=HIGH(20)) & SCB.XKEYIB<SCB.XKEYIA); /*H4.2.1 Process IB record -----------------------------------------*/ WRITE FILE(FOUT) FROM(SIB); CALL EGETIB; END; END; /*H1.2 Termination Routine ----------------------------------------*/ CLOSE FILE(*); /*Close all Open Files */ EGETIA: PROC REORDER; /********************************************************************/ /* FIA Record Processing */ /* Task:-Get and return one IA record. */ /********************************************************************/ DCL HIGH BUILTIN; /* */ /*HG1.0 Initiation routine -----------------------------------------*/ ON ENDFILE(FIA) /*Set EOF Condition */ BEGIN; SCB.XKEYIA = HIGH(10); /*signal EOF Condition */ GOTO LRETURN; /*nothing to do anymore */ END; /*HG2 Read and prepare record for processing. READ FILE(FIA) SET(PIA); /*GET NEXT FIA RECORD SCB.XKEYIA = SIA.XKEY; /*Save key into SCB LRETURN: RETURN; END EGETIA;

*/ */ */

EGETIB: PROC REORDER; /********************************************************************/ /* FIB Record Processing */ /* Task:-Get and return one IB record. */ /********************************************************************/ DCL HIGH BUILTIN; /* */ /*HG1.0 Initiation routine -----------------------------------------*/ ON ENDFILE(FIB) /*Set EOF Condition */ BEGIN; SCB.XKEYIB = HIGH(10); /*signal EOF Condition */ GOTO LRETURN; /*nothing to do anymore */ END; /*HG2 Read and prepare record for processing. READ FILE(FIB) SET(PIB); /*GET NEXT FIB RECORD SCB.XKEYIB = SIB.XKEY; /*Save key into SCB LRETURN: RETURN; END EGETIB; Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

*/ */ */

00142700 00142800 00143000 00144000 00145000 00147000 00148000 00150000 00160000 00161000 00161100 00161200 00161300 00161500 00161600 00161700 00161800 00161900 00162000 00164000 00165000 00166000 00167000 00167100 00167200 00167300 00167400 00167500 00167600 00167700 00167800 00167900 00169000 00169100 00169105 00169200 00169300 00169400 00169600 00169700 00169800 00169900 00170000 00171000 00172000 00173000 00174000 00175000 00176000 00177000 00178000 00179000 00180000 00190100 00190200 00190205 00190300 00190400 00190500 00190700 00190800 00190900 00191000 Page: 2

Software Engineering -

Task 3: Merge 2 Data Sets V01

END EPMERG1;

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

Date: 10/25/2009

00192000

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 0000000005File 0000000006File 0000000007File 0000000009File

IA IA IA IA IA

File FIB: T03IB.txt 0000000001File 0000000002File 0000000003File 0000000004File 0000000007File 0000000008File

IB IB IB IB IB IB

Test 2: File FIA: T03IA2.txt Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

Page: 4

Software Engineering -

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

Task 3: Merge 2 Data Sets V01

Date: 10/25/2009

IA IA IA IA IA IA

File FIB: T03IB2.txt 0000000004File 0000000005File 0000000006File 0000000007File 0000000009File

IB IB IB IB IB

Report Output: File: TASK03G1.TXT similar for both tests… 1 0

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

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: [email protected]

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 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: [email protected]

104K SYS

260K

Page: 6

Software Engineering -

Task 3: Merge 2 Data Sets V01

IEF285I VOL SER NOS= Z5RES2. IEF285I P390A.P390AC.JOB01934.D0000105.? IEF285I P390A.P390AC.JOB01934.D0000106.? IEF285I P390A.P390AC.JOB01934.D0000107.? IEF285I P390A.P390AC.JOB01934.D0000108.? IEF285I P390A.RUN.DATA IEF285I VOL SER NOS= USR001. IEF285I P390A.RUN.DATA IEF285I VOL SER NOS= USR001. IEF285I P390A.RUN.DATA IEF285I VOL SER NOS= USR001. IEF373I STEP/GO /START 2009286.0934 IEF374I STEP/GO /STOP 2009286.0934 CPU EXT 7036K SYS 9216K IEF375I JOB/P390AC /START 2009286.0934 IEF376I JOB/P390AC /STOP 2009286.0934 CPU

Date: 10/25/2009

SYSOUT SYSOUT SYSOUT SYSOUT KEPT KEPT KEPT

0MIN 00.51SEC SRB

0MIN 00.72SEC VIRT

0MIN 00.85SEC SRB

0MIN 01.45SEC

104K SYS

260K

Output Data: Test 1 V01: File FOUT: T03OUT11.txt 0000000001File 0000000002File 0000000003File 0000000004File 0000000004File 0000000005File 0000000006File 0000000007File 0000000007File 0000000008File 0000000009File

IB IB IB IA IB IA IA IA IB IB IA

Test 2 V01: File FOUT: T03OUT12.txt 0000000001File 0000000002File 0000000003File 0000000004File 0000000004File 0000000005File 0000000006File 0000000007File 0000000007File 0000000008File 0000000009File

IA IA IA IA IB IB IB IA IB IA IB

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

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; *PROCESS AGGREGATE, OFFSET, CMPAT(V1); *PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: Task 03: Merge File FIA, FIB to File FOUT */ /********************************************************************/ /* Merge two datasets V02 */ /* Publications: see PGM Design Task 03,Example 1 */ /* */ /* Author: Dipl.Ing. Werner Hoffmann */ /* Date Written: 1907/03/05 */ /* Date Changed: 2008/08/28 */ /* */ /* PROCEDURE: MAIN */ /* TASK: This program merge two files to one output file. */ /* */ /* Files: */ /* Input: FIA - Input File */ /* FIB - Input File */ /* Output: FOUT- Output File */ /* Notes: */ /* */ /********************************************************************/ EPMERG2: PROC OPTIONS(MAIN) REORDER; /*** DCL DCL DCL 1 2 2 /*** DCL DCL DCL 1 2 2

File FIA ---------------------------------------------------*/ FIA FILE RECORD INPUT /* File IA */ ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); PIA POINTER STATIC; /*Pointer to IA Record */ SIA BASED(PIA), /*IA Record Layout */ XKEY CHAR(10), /*Key */ XTEXT CHAR(70); /*Text */ File FIB ---------------------------------------------------*/ FIB FILE RECORD INPUT /* File IB */ ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); PIB POINTER STATIC; /*Pointer to IA Record */ SIB BASED(PIB), /*IA Record Layout */ XKEY CHAR(10), /*Key */ XTEXT CHAR(70); /*Text */

/*** DCL

FILE FOUT --------------------------------------------------*/ FOUT FILE RECORD OUTPUT /* */ ENV(CONSECUTIVE RECSIZE(80));

DCL DCL 1 2 2

XCB SCB XKEYIA XKEYIB

/*** DCL

Builtin Functions ------------------------------------------*/ HIGH BUILTIN; /* */

CHAR(20) STATIC; DEF XCB, CHAR(10), CHAR(10);

/*Group Control Block /*Group Control Block /*Current key record IA /*Current key record IB

*/ */ */ */

/*H1.1 Initate Routine --------------------------------------------*/ OPEN FILE(FIA) INPUT; /*Open File IA */ OPEN FILE(FIB) INPUT; /*Open File IB */ OPEN FILE(FOUT) OUTPUT; /*Open File OUT */ /*H2 Merge File IA, IB to file OUT ==============================*/ /*H3 Process Group O --------------------------------------------*/ CALL EGETIA; /*Get first record file IA */ CALL EGETIB; /*Get first record file IB */ DO WHILE(XCB¬=HIGH(20)); /*More to do? */ /*H4.1 Process one input record IA or IB ---------------------------*/ Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00001000 00002000 00003000 00004000 00005000 00006000 00007000 00008000 00009000 00010000 00020000 00030000 00031000 00032000 00033000 00034000 00034100 00034200 00034300 00034400 00034500 00034600 00034700 00034800 00034900 00035000 00036000 00037000 00038000 00039000 00040000 00050000 00060000 00070000 00080000 00090000 00100000 00101000 00102000 00103000 00104000 00105000 00106000 00107000 00108000 00109000 00110000 00120000 00130000 00140000 00141000 00142000 00142100 00142200 00142300 00142400 00142500 00142700 00142800 00143000 00144000 00145000 00147000 Page: 1

Software Engineering -

Task 3: Merge 2 Data Sets V02

Date: 10/25/2009

IF SCB.XKEYIA<=SCB.XKEYIB THEN DO; /*H4.1.1 Process record IA -----------------------------------------*/ WRITE FILE(FOUT) FROM(SIA); CALL EGETIA; END; /*H4.2 Process one Group IB ----------------------------------------*/ ELSE DO; /*H4.2.1 Process IB record -----------------------------------------*/ WRITE FILE(FOUT) FROM(SIB); CALL EGETIB; END; END; /*H1.2 Termination Routine ----------------------------------------*/ CLOSE FILE(*); /*Close all Open Files */ EGETIA: PROC REORDER; /********************************************************************/ /* FIA Record Processing */ /* Task:-Get and return one IA record. */ /********************************************************************/ DCL HIGH BUILTIN; /* */ /*HG1.0 Initiation routine -----------------------------------------*/ ON ENDFILE(FIA) /*Set EOF Condition */ BEGIN; SCB.XKEYIA = HIGH(10); /*signal EOF Condition */ GOTO LRETURN; /*nothing to do anymore */ END; /*HG2 Read and prepare record for processing. READ FILE(FIA) SET(PIA); /*GET NEXT FIA RECORD SCB.XKEYIA = SIA.XKEY; /*SAve key into SCB LRETURN: RETURN; END EGETIA;

*/ */ */

EGETIB: PROC REORDER; /********************************************************************/ /* FIB Record Processing */ /* Task:-Get and return one IB record. */ /********************************************************************/ DCL HIGH BUILTIN; /* */ /*HG1.0 Initiation routine -----------------------------------------*/ ON ENDFILE(FIB) /*Set EOF Condition */ BEGIN; SCB.XKEYIB = HIGH(10); /*signal EOF Condition */ GOTO LRETURN; /*nothing to do anymore */ END; /*HG2 Read and prepare record for processing. READ FILE(FIB) SET(PIB); /*GET NEXT FIB RECORD SCB.XKEYIB = SIB.XKEY; /*Save key into SCB LRETURN: RETURN; END EGETIB; END EPMERG2;

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

*/ */ */

00148000 00149000 00149100 00150000 00160000 00161000 00161100 00161200 00161300 00161400 00161500 00161600 00161700 00161800 00161900 00162000 00164000 00165000 00166000 00167000 00167100 00167200 00167300 00167400 00167500 00167600 00167700 00167800 00167900 00169000 00169100 00169200 00169205 00169300 00169400 00169600 00169700 00169800 00169900 00170000 00171000 00172000 00173000 00174000 00175000 00176000 00177000 00178000 00179000 00180000 00190100 00190200 00190300 00169200 00190400 00190500 00190700 00190800 00190900 00191000 00192000

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 0000000005File 0000000006File 0000000007File 0000000009File

IA IA IA IA IA

File FIB: T03IB.txt 0000000001File 0000000002File 0000000003File 0000000004File 0000000007File 0000000008File

IB IB IB IB IB IB

Test 2: File FIA: T03IA2.txt Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

Page: 3

Software Engineering -

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

Task 3: Merge 2 Data Sets V02

Date: 10/25/2009

IA IA IA IA IA IA

File FIB: T03IB2.txt 0000000004File 0000000005File 0000000006File 0000000007File 0000000009File

IB IB IB IB IB

Report Output: File: TASK03G2.TXT 1 0

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

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: [email protected]

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 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: [email protected]

104K SYS

260K

Page: 5

Software Engineering -

Task 3: Merge 2 Data Sets V02

IEF285I VOL SER NOS= Z5RES2. IEF285I P390A.P390AC.JOB01935.D0000105.? IEF285I P390A.P390AC.JOB01935.D0000106.? IEF285I P390A.P390AC.JOB01935.D0000107.? IEF285I P390A.P390AC.JOB01935.D0000108.? IEF285I P390A.RUN.DATA IEF285I VOL SER NOS= USR001. IEF285I P390A.RUN.DATA IEF285I VOL SER NOS= USR001. IEF285I P390A.RUN.DATA IEF285I VOL SER NOS= USR001. IEF373I STEP/GO /START 2009286.0936 IEF374I STEP/GO /STOP 2009286.0936 CPU EXT 7036K SYS 9216K IEF375I JOB/P390AC /START 2009286.0936 IEF376I JOB/P390AC /STOP 2009286.0936 CPU

Date: 10/25/2009

SYSOUT SYSOUT SYSOUT SYSOUT KEPT KEPT KEPT

0MIN 01.33SEC SRB

0MIN 00.86SEC VIRT

0MIN 01.72SEC SRB

0MIN 01.64SEC

104K SYS

260K

Output Data: Test 1 V02: File FOUT: T03OUT21.txt 0000000001File 0000000002File 0000000003File 0000000004File 0000000004File 0000000005File 0000000006File 0000000007File 0000000007File 0000000008File 0000000009File

IB IB IB IA IB IA IA IA IB IB IA

Test 2 V02: File FOUT: T03OUT22.txt 0000000001File 0000000002File 0000000003File 0000000004File 0000000004File 0000000005File 0000000006File 0000000007File 0000000007File 0000000008File 0000000009File

IA IA IA IA IB IB IB IA IB IA IB

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

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; *PROCESS AGGREGATE, OFFSET, CMPAT(V1); *PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: Inventory Update V01 */ /********************************************************************/ /* Inventory Update - Task 4 */ /* Publications: see PGM Design V01 */ /* */ /* Author: Dipl.Ing. Werner Hoffmann */ /* Date Written: 1907/03/05 */ /* Date Changed: 2009/08/28 */ /* */ /* PROCEDURE: MAIN */ /* TASK: This program updates the Inventory File. */ /* Standard subroutines used: */ /* EMSG - Message Print Routine */ /* using Message Control Block V3DMSG01 */ /* EADDR1 - Get new Address by a given displacement */ /* */ /* Files: */ /* Input: FIV - Inventory File, Record Layout see: SIV */ /* Input: FSM - Stores Movements, Record Layout see: SSM */ /* Output: FOIV- New Inventory File. */ /* FMSG- Messages - standard layout used. */ /* Notes: */ /* */ /********************************************************************/ EPINVV1: PROC OPTIONS(MAIN) REORDER; /*** DCL DCL DCL 1 2 2 2 2 2 2 2 /*** DCL DCL DCL 1 2 2 2 2 2 2 2 2

File FIV ---------------------------------------------------*/ FIV FILE RECORD INPUT /* Inventory File */ ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); PIV POINTER STATIC; /*Pointer to IV Record */ SIV BASED(PIV), /*IV Record Layout */ XRID CHAR(2), /*Record ID */ XUSD1 CHAR(1), /* unused */ XPARTNO CHAR(10), /*Part Number */ XDESC CHAR(21), /*Description */ XUSD2 CHAR(1), /* unused */ NQTY PIC'SSSSSSS9', /*Quantity */ XUSD3 CHAR(37); /* unused */ File FSM ---------------------------------------------------*/ FSM FILE RECORD INPUT /* Stores Movements */ ENV(CONSECUTIVE FB RECSIZE(80) TOTAL); PSM POINTER STATIC; /*Pointer to SM Record */ SSM BASED(PSM), /*SM Record Layout */ XRID CHAR(2), /*Record ID */ XRTYPE CHAR(1), /*Record Type, I OR R */ XPARTNO CHAR(10), /*Part Number */ NDATE PIC'99999999', /*Date YYYYMMDD */ NTIME PIC'9999', /*Time HHMM */ XUSD1 CHAR(1), /* unused */ NQTY PIC'99999999', /*Quantity */ XUSD2 CHAR(46); /* unused */

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00001000 00002000 00003000 00004000 00005000 00006000 00007000 00008000 00009000 00010000 00020000 00030000 00031000 00032000 00034000 00034300 00034400 00034500 00034700 00034800 00034900 00035000 00035100 00035300 00035400 00035500 00035600 00035700 00035800 00035900 00036000 00036100 00037000 00038000 00039000 00040000 00050000 00060000 00070000 00080000 00100011 00101008 00101100 00101200 00101300 00101400 00101500 00101600 00101700 00101800 00101900 00102000 00102100 00102202 00102300 00102402 00137000 Page: 1

Software Engineering -

Task 4: Inventory Update

Date: 10/25/2009

/*** DCL

FILE FOIV --------------------------------------------------*/ 00137108 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: [email protected]

Page: 2

Software Engineering -

Task 4: Inventory Update

Date: 10/25/2009

/*H3.2 Matched IV,SM records ---------------------------------------*/ /*H4.0 Process SM Records for one SM Group =========================*/ SCB.YPARTNOSM = SCB.XPARTNOSM; /*SM PartNo f. Grp.Control */ DO WHILE(SCB.YPARTNOSM = SCB.XPARTNOSM); /*H4.1 Process one SM Record ---------------------------------------*/ SELECT(SSM.XRTYPE); /*H4.1.1 ISSUE Record ----------------------------------------------*/ WHEN('I') /* */ SIV.NQTY = SIV.NQTY - SSM.NQTY; /*H4.1.2 RECEIPT Record --------------------------------------------*/ WHEN('R') /* */ SIV.NQTY = SIV.NQTY + SSM.NQTY; /*H4.1.3 not used --------------------------------------------------*/ OTHERWISE; END; CALL EGETSM; /*Get next FSM Record */ END; /*H4.2 Process and terminate SM Group ------------------------------*/ IF SIV.NQTY < 0 /*Check for neg. quantity */ THEN DO; SLINE.XASA = ' '; /*Print warning msg */ SLINE.XMSGTYPE = 'W'; SLINE.XENO = 'SMS02'; SLINE.XMSGTXT = 'PartNo: '||SIV.XPARTNO|| ' has neg. value: '||SIV.NQTY; CALL EMSG(FMSG,PMSG1); END; STAT.NFOIV = STAT.NFOIV + 1; /*count FOIV record */ STAT.NFIVUPD = STAT.NFIVUPD + 1; /*cnt FOIV record updated*/ WRITE FILE (FOIV) FROM(SIV); /*Write Inventory record */ CALL EGETIV; /*Get next FIV record */ END; OTHERWISE DO; /*H3.3 unmatched SM group record -----------------------------------*/ /*H5 Process SM records for one SM group---------------------------*/ SCB.YPARTNOSM = SCB.XPARTNOSM; /*SM PartNo f.Grp.Control*/ SLINE.XASA = ' '; /*Print error msg */ SLINE.XMSGTYPE = 'F'; SLINE.XENO = 'SMS03'; SLINE.XMSGTXT = 'PartNo: '||SCB.YPARTNOSM|| ' from FSM file has no associated Inventory record:'; CALL EMSG(FMSG,PMSG1); DO WHILE(SCB.YPARTNOSM = SCB.XPARTNOSM); /*H5.1 Process one SM Record ---------------------------------------*/ SLINE.XASA = ' '; /*Print SM rec. in error */ SLINE.XMSGTYPE = 'I'; SLINE.XENO = 'SMS03'; SLINE.XMSGTXT = STRING(SSM); CALL EMSG(FMSG,PMSG1); STAT.NFSMNOTP = STAT.NFSMNOTP + 1; /*count not processed rec*/ CALL EGETSM; /*Get next FSM Record */ END; END; END; END; /*H1.2 Termination Routine ----------------------------------------*/ SLINE.XASA = '0'; /*Print Statistics */ SLINE.XMSGTYPE = 'I'; SLINE.XENO = 'SMS02'; SLINE.XMSGTXT = 'Statistics: '; CALL EMSG(FMSG,PMSG1); Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00164017 00164117 00164217 00164315 00164417 00164515 00164617 00164715 00164815 00164917 00165015 00165115 00165217 00165315 00165415 00165515 00165615 00165715 00166317 00166415 00166515 00166615 00166715 00166815 00166916 00167015 00167115 00167215 00167415 00167515 00167715 00167815 00167915 00168015 00168215 00168317 00168417 00168515 00168715 00168815 00168915 00169016 00169115 00169215 00169415 00169517 00169615 00169715 00169815 00169915 00170015 00170115 00170215 00170315 00170415 00170515 00170615 00170715 00170817 00170915 00171015 00171117 00171315 Page: 3

Software Engineering -

Task 4: Inventory Update

Date: 10/25/2009

SLINE.XASA = ' SLINE.XMSGTYPE SLINE.XENO SLINE.XMSGTXT

'; /*Print Statistics IV */ = 'I'; = 'SMS02'; = 'No. IV records read: '|| CHARACTER(STAT.NFIV); CALL EMSG(FMSG,PMSG1); SLINE.XASA = ' '; /*Print Statistics SM */ SLINE.XMSGTYPE = 'I'; SLINE.XENO = 'SMS02'; SLINE.XMSGTXT = 'No. SM records read: '|| CHARACTER(STAT.NFSM); CALL EMSG(FMSG,PMSG1); SLINE.XASA = ' '; /*Statistics SM not processed*/ SLINE.XMSGTYPE = 'I'; SLINE.XENO = 'SMS02'; SLINE.XMSGTXT = 'No. SM records not processed:'|| CHARACTER(STAT.NFSMNOTP); CALL EMSG(FMSG,PMSG1); SLINE.XASA = ' '; /*Print Statistics FOIV */ SLINE.XMSGTYPE = 'I'; SLINE.XENO = 'SMS02'; SLINE.XMSGTXT = 'No. IV records written: '|| CHARACTER(STAT.NFOIV); CALL EMSG(FMSG,PMSG1); SLINE.XASA = ' '; /*Print Statistics IV updated */ SLINE.XMSGTYPE = 'I'; SLINE.XENO = 'SMS02'; SLINE.XMSGTXT = 'No. IV records updated: '|| CHARACTER(STAT.NFIVUPD); CALL EMSG(FMSG,PMSG1); SLINE.XASA = ' '; /*Print Termination Message */ SLINE.XMSGTYPE = 'I'; SLINE.XENO = 'SMS01'; SLINE.XMSGTXT = 'V3PINVV1 ended.'; CALL EMSG(FMSG,PMSG1); CLOSE FILE(*); /*Close all Open Files */ CALL PLIRETC(NRETC); /*Set Return Code */ EGETIV: PROC REORDER; /********************************************************************/ /* FIV Record Processing */ /* Task:-Get and return a IV record. */ /********************************************************************/ /*HG1 Initiation routine -----------------------------------------*/ ON ENDFILE(FIV) /*EOF Condition */ BEGIN; SCB.XPARTNOIV = HIGH(10); /*Set EOF Condition */ GOTO LRETURN; /*nothing to do anymore */ END; /*HG2 Read and prepare next IV record for processing ---------------*/ READ FILE(FIV) SET(PIV); /*GET NEXT FSM RECORD */ SCB.XPARTNOIV = SIV.XPARTNO; /*Save PartNumber */ STAT.NFIV = STAT.NFIV + 1; /*count FIV record */ LRETURN: RETURN; END EGETIV; EGETSM: PROC REORDER; /********************************************************************/ /* FSM Record Processing */ /* Task:-Get and return a SM record. */ /********************************************************************/ Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00171417 00171517 00171617 00171719 00171817 00171917 00172017 00172117 00172217 00172319 00172417 00172517 00172617 00172717 00172817 00172919 00173017 00173117 00173217 00173317 00173417 00173519 00173617 00173717 00173817 00173917 00174017 00174119 00174217 00174317 00174417 00174517 00174617 00174717 00174817 00174917 00175017 00175117 00175217 00175317 00175417 00175517 00175617 00175717 00175817 00175917 00176017 00176117 00176217 00176317 00176417 00176517 00176617 00177015 00177700 00177800 00187000 00187100 00187200 00187300 00187400 00187500 00187600 Page: 4

Software Engineering -

Task 4: Inventory Update

Date: 10/25/2009

/*HG1 Initiation routine -----------------------------------------*/ ON ENDFILE(FSM) /*EOF Condition */ BEGIN; SCB.XPARTNOSM = HIGH(10); /*Set EOF Condition */ GOTO LRETURN; /*nothing to do anymore */ END; /*HG2 Read and prepare next SM record for processing ---------------*/ READ FILE(FSM) SET(PSM); /*GET NEXT FSM RECORD */ SCB.XPARTNOSM = SSM.XPARTNO; /*Save PartNumber */ STAT.NFSM = STAT.NFSM + 1; /*count FSM record */ LRETURN: RETURN; END EGETSM; END EPINVV1;

00187700 00187800 00187900 00188000 00188102 00188300 00188400 00188500 00188600 00188702 00188813 00189000 00189100 00189200 00189300 00190000

File: V3DMSG04.TXT /*PPL-TITLE: Print Control Block V04 */ /********************************************************************/ /* Print Control Block PGM V3PSMSV4 */ /********************************************************************/ DCL PPCB1 POINTER INIT(ADDR(SPCB1));/*Pointer to PCB */ DCL 1 SPCB1 UNALIGNED, /* Print Control Block */ 2 QSN POINTER /* Address of Page Number */ INIT(EADDR1(ADDR(SPCB1.YHL(1)),52)), 2 QDT POINTER /* Address Edit-Date */ INIT(EADDR1(ADDR(SPCB1.YHL(2)),49)), 2 QPL POINTER /* Address of Print Area */ INIT(ADDR(SPCB1.YPL)), 2 MLCNT BIN FIXED(15) /* Number of max. Lines per Page */ INIT(60), 2 MLNO BIN FIXED(15) /* Residuary printable No. of Lines*/ INIT(0), 2 MPNO BIN FIXED(15) /* Current Page Number */ INIT(0), 2 MHNO BIN FIXED(15) /* Number of Header Lines */ INIT(4), 2 YPL CHAR(133) /* PrintLine -Communication Area---*/ INIT((133)' '), 2 YHL(4) CHAR(133) INIT /* Header Lines */ ('1--- Stores Movement Summary Page: NNNNN ', ' Report: SMS XYZ FACTORY Date: DD.MM.YY ', ' Part_Number Receipts Issues Net_Summary ', ' _______________________________________________________ ');

00010001 00020000 00030001 00040000 00050000 00060000 00070000 00080000 00081000 00082000 00090000 00091000 00100000 00110000 00120000 00130000 00140000 00150000 00160000 00170000 00180000 00190000 00200000 00210000 00220000 00221000 00222000 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: [email protected]

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 IV IV IV IV IV IV IV IV

A5/13571 Bolt x1/2 A5/13572 Bolt x20/3d A5/13672 Gear c1 A5/13673 Gear c2 A5/17924 Generator T51 A6/17925 Generator T651 B31/823 Wheel x2/3 B31/950 Motor T6 CA522/2005Nut x2

555 1200 30700 224 55 123 10005 5555 99500

File FIB: TSMV01.txt SMIA5/13672 SMIA5/13672 SMIA5/13672 SMRA5/13672 SMRA5/17924 SMIA5/17924 SMIA6/17952 SMIA6/17952 SMIB31/82 SMIB31/823 SMIB31/823

200802020822 200802101430 200803121500 200803121610 200802030915 200802051030 200802051035 200802051040 200802021150 200802021155 200802021410

120 310 50 100 10 66 2 3 55 10 15

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

Page: 6

Software Engineering -

Task 4: Inventory Update

Date: 10/25/2009

Report Output: File: TASK04R.TXT 1 0

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

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: [email protected]

Page: 7

Software Engineering -

Task 4: Inventory Update

IEF285I P390A.P390AC.JOB01994.D0000103.? IEF285I P390A.P390AC.JOB01994.D0000104.? IEF285I P390A.RUN.DATA IEF285I VOL SER NOS= USR001. IEF285I P390A.RUN.DATA IEF285I VOL SER NOS= USR001. IEF285I P390A.RUN.DATA IEF285I VOL SER NOS= USR001. IEF285I P390A.P390AC.JOB01994.D0000105.? IEF373I STEP/GO /START 2009288.1331 IEF374I STEP/GO /STOP 2009288.1331 CPU EXT 7048K SYS 9216K IEF375I JOB/P390AC /START 2009288.1331 IEF376I JOB/P390AC /STOP 2009288.1331 CPU

Date: 10/25/2009 SYSOUT SYSOUT KEPT KEPT KEPT SYSOUT

0MIN 00.45SEC SRB

0MIN 00.72SEC VIRT

0MIN 00.45SEC SRB

0MIN 00.72SEC

1--- Inventory Update --- Messages --… MSG_No 1***5****10***5****20***5****30***5****40***5****50***5****60**5****70***5****80… 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.

108K SYS

260K

Page: 1 Date:15.10.09

Output Data: File FOUT: TOIV01.txt IV IV IV IV IV IV IV IV IV

A5/13571 Bolt x1/2 A5/13572 Bolt x20/3d A5/13672 Gear c1 A5/13673 Gear c2 A5/17924 Generator T51 A6/17925 Generator T651 B31/823 Wheel x2/3 B31/950 Motor T6 CA522/2005Nut x2

555 1200 +30320 224 -1 123 +9980 5555 99500

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

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 */ /********************************************************************/ /* PGM_ENTRY: EPTELE */ /* AUTHOR: DIPL.ING. WERNER HOFFMANN */ /* Date written: 1978/09/17 */ /* */ /* Tasks: */ /* EP1 - INPUT PROCESSING FILE: FTELE */ /* EP2 - REPORT PROCESSING FILE: FREPORT */ /********************************************************************/ /* TELEGRAM ANALYSIS: PROGRAM CONTROLLER */ EPTELE: PROC OPTIONS(MAIN,TASK) REORDER; /* COMMUNICATION AREA ----------------------------------------------*/ DCL 1 SCA STATIC, 2 EWORD EVENT, 2 EREPORT EVENT, 2 XWORD CHAR(80) VARYING; /* DEFAULTS, ENTRIES, BUILTINS -------------------------------------*/ DCL BTRUE BIT(1) STATIC INIT('1'B); DCL BFALSE BIT(1) STATIC INIT('0'B); DCL (EP1,EP2) ENTRY; /*H1**** CONTROL PROCESSING ----------------------------------- *****/ COMPLETION(SCA.EWORD) = BFALSE; COMPLETION(SCA.EREPORT) = BFALSE; CALL EP2 TASK(T1) EVENT(E1); CALL EP1 TASK(T2) EVENT(E2); WAIT(E1,E2);

/* FREPORT PROCESSING /* FTELE PROCESSING /* WAIT FOR COMPLETION

*/ */ */

/********************************************************************/ /* PGM_ENTRY: EP1 - INPUT PROCESSING - FILE: FTELE */ /* Tasks: EP1 */ /********************************************************************/ /* TELEGRAM PROCESSING */ EP1: PROC REORDER; /* FILE FTELE ------------------------------------------------------*/ DCL FTELE FILE STREAM INPUT; DCL BEOF BIT(1) STATIC; /*EOF CONDITION */ /* VALUES, DEFAULTS ------------------------------------------------*/ DCL XCHAR CHAR(1) STATIC; /*ONE CHARACTER OF FTELE */ DCL BTRUE BIT(1) STATIC INIT('1'B); DCL BFALSE BIT(1) STATIC INIT('0'B); /*H1.1** Initialization Routine ------------------------------- *****/ ON ENDFILE(FTELE) BEOF = BTRUE; /*H2**** TELEGRAM PROCESSING - INPUT--------------------------- *****/ BEOF = BFALSE; OPEN FILE(FTELE) INPUT; GET FILE(FTELE) EDIT(XCHAR)(A(1)); /* GET FIRST CHARACTER */ DO WHILE(¬BEOF); /* MORE CHARACTER GROUPS IN */ /*H3 PROCESS A BLOCK ------------------------------------------ */ IF XCHAR = ' ' THEN Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00004001 00005000 00006000 00007000 00008000 00009000 00010000 00020001 00030001 00060000 00070000 00080000 00090005 00091000 00100041 00110000 00120000 00130000 00131000 00140000 00150000 00160000 00170000 00180005 00190042 00200041 00210000 00220004 00230021 00240000 00241000 00242014 00242214 00242342 00242742 00243014 00243142 00243214 00243315 00243442 00243542 00243642 00243714 00243814 00243914 00244014 00244214 00244314 00244437 00244642 00245014 00245114 00245342 00245414 00245541 00245614 00245714 Page: 1

Software Engineering -

Task 5: Telegram Analysis V01

Date: 10/25/2009

/*H3.1 SPACE PROCESSING ------------------------------------- */ DO WHILE(¬BEOF & XCHAR = ' '); GET FILE(FTELE) EDIT(XCHAR)(A(1));/*SKIP OVER SPACES */ END; ELSE /*H3.2 WORD PROCESSING -------------------------------------- */ DO; SCA.XWORD = ''; DO WHILE(¬BEOF & XCHAR ¬= ' '); SCA.XWORD = SCA.XWORD || XCHAR; GET FILE(FTELE) EDIT(XCHAR)(A(1));/*GET NEXT CHARACTER */ END; /*TEST*PUT FILE(SYSPRINT) LIST('EP1-1 ',SCA.XWORD) SKIP; */ COMPLETION(SCA.EWORD) = BTRUE; /*THERE IS A COMPLETE WORD */ WAIT(SCA.EREPORT); /*WAIT FOR COMPL. IN REPORT */ COMPLETION(SCA.EREPORT)= BFALSE;/*RESET STATUS */ END; END; /*H1.2 Termination Routine ------------------------------------- */ CLOSE FILE(FTELE); /* NOTE: EVENT E1 IS COMPLETED ON RETURN */ END EP1; /********************************************************************/ /* PGM_ENTRY: EP2 - TELEGRAM ANALYSIS - REPORT PROCESSING */ /* TASKS: EP2 */ /********************************************************************/ /* TELEGRAM REPORT PROCESSING */ EP2: PROC REORDER; /* FILE FREPORT ----------------------------------------------------*/ DCL FREPORT FILE PRINT OUTPUT; /* TELEGRAM INFORMATIONS -------------------------------------------*/ DCL 1 STELE STATIC, 2 NO PIC'ZZZ9', /*TELEGRAM NUMBER */ 2 NWORD_COUNT PIC'ZZZZ9', /*WORDS IN TELEGRAM */ 2 NOSIZE_COUNT PIC'ZZZZ9'; /*WORDS OVERSIZE */ /* DEFAULTS, BUILTINS ----------------------------------------------*/ DCL BTRUE BIT(1) STATIC INIT('1'B); DCL BFALSE BIT(1) STATIC INIT('0'B); /*H1.1* Initialization Routine -------------------------------- *****/ OPEN FILE(FREPORT) OUTPUT; STELE.NO = 0; /*H1.2* REPORT PROCESSING ------------------------------------- *****/ /*H1.2.1 PROCESS REPORT HEADING -------------------------------- */ PUT FILE(FREPORT) LIST('TELEGRAM ANALYSIS') SKIP; WAIT(SCA.EWORD); /*WAIT FOR A WORD */ COMPLETION(SCA.EWORD) = BFALSE; /*RESET STATUS */ /*TST*PUT FILE(SYSPRINT) LIST('EP2-1 ',SCA.XWORD) SKIP;*/ /*H2 PROCESS TELEGRAMS ------------------------------------------*/ DO WHILE(SCA.XWORD ¬= 'ZZZZ'); /*H3.1 REAL TELEGRAM PROCESSING -INITIALIZATION --------------- */ STELE.NWORD_COUNT, STELE.NOSIZE_COUNT = 0; DO WHILE(SCA.XWORD ¬= 'ZZZZ'); IF SCA.XWORD = 'STOP' /*H4.1 STOP WORD --------------------------------------------- */ THEN; /*IGNORE STOP WORD */ /*H4.2 COUNT A TELEGRAM WORD --------------------------------- */ ELSE DO; IF LENGTH(SCA.XWORD) > 12 THEN STELE.NOSIZE_COUNT = STELE.NOSIZE_COUNT + 1; Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00245841 00245941 00246042 00246114 00246214 00246341 00246441 00246541 00246614 00246741 00246842 00246914 00247041 00247141 00247241 00247341 00247414 00247514 00247614 00247714 00247842 00247914 00248014 00248214 00248342 00248742 00249014 00249114 00249214 00249315 00249442 00249514 00249642 00249742 00249842 00249942 00250042 00250114 00250242 00250314 00250542 00250642 00250742 00250842 00250942 00251042 00251142 00251242 00251342 00251442 00251542 00251642 00251742 00251842 00251942 00252041 00252141 00252214 00252342 00252414 00252514 00252641 00252714 Page: 2

Software Engineering -

Task 5: Telegram Analysis V01

Date: 10/25/2009

STELE.NWORD_COUNT = STELE.NWORD_COUNT + 1; END; /*H4.3 TELEGRAM WORD -TERMINATION ---------------------------- */ COMPLETION(SCA.EREPORT) = BTRUE; /* WORD CONTROL BLOCK IS NOT */ /* LONGER NEEDED */ WAIT(SCA.EWORD); /* WAIT FOR NEXT WORD */ COMPLETION(EWORD) = BFALSE; /* RESET STATUS */ /*TST*PUT FILE(SYSPRINT) LIST('EP2-2 ',SCA.XWORD) SKIP;*/ END; /*H3.2 REAL TELEGRAM PROCESSING -PRINT A TELEGRAM ------------- */ STELE.NO = STELE.NO + 1; PUT FILE(FREPORT) LIST ('TELEGRAM '||STELE.NO) SKIP; PUT FILE(FREPORT) LIST (' '||STELE.NWORD_COUNT|| ' WORDS OF WHICH '||STELE.NOSIZE_COUNT|| ' OVERSIZE') SKIP; /*H3.3 REAL TELEGRAM PROCESSING -TERMINATION ------------------ */ COMPLETION(SCA.EREPORT) = BTRUE; /* WORD CONTROL BLOCK IS NOT */ /* LONGER NEEDED */ WAIT(SCA.EWORD); /* WAIT FOR NEXT WORD */ COMPLETION(EWORD) = BFALSE; /* RESET STATUS */ /*TST*PUT FILE(SYSPRINT) LIST('EP2-3 ',SCA.XWORD) SKIP;*/ END; /*H1.2 PROCESS REPORT TERMINATION ------------------------------ */ COMPLETION(SCA.EREPORT) = BTRUE; /* WORD CONTROL BLOCK IS NOT */ /* LONGER NEEDED */ PUT FILE(FREPORT) LIST('END TELEGRAM ANALYSIS') SKIP; CLOSE FILE(FREPORT); /*NOTE: EVENT E2 IS COMPLETED ON RETURN */ END EP2; END EPTELE;

00252814 00252914 00253041 00253141 00253241 00253341 00253441 00253541 00253614 00253741 00253814 00253918 00254018 00254120 00254216 00254341 00254441 00254541 00254641 00254741 00254841 00254914 00255041 00255142 00255242 00255316 00255414 00255542 00255614 00256011 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: [email protected]

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 0

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

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: [email protected]

Page: 4

Software Engineering -

Task 5: Telegram Analysis V01

IEF285I P390A.PGM.LOAD IEF285I VOL SER NOS= USR001. IEF285I SYS1.SIBMTASK IEF285I VOL SER NOS= Z5RES1. IEF285I SYS1.PL1LIB IEF285I VOL SER NOS= PGM001. IEF285I P390A.P390AC.JOB02322.D0000101.? IEF285I P390A.RUN.DATA IEF285I VOL SER NOS= USR001. IEF285I P390A.P390AC.JOB02322.D0000102.? IEF373I STEP/GO /START 2009292.1559 IEF374I STEP/GO /STOP 2009292.1559 CPU EXT 0K SYS 9308K IEF375I JOB/P390AC /START 2009292.1559 IEF376I JOB/P390AC /STOP 2009292.1559 CPU

1 TELEGRAM ANALYSIS TELEGRAM 1 32 WORDS OF WHICH TELEGRAM 2 33 WORDS OF WHICH TELEGRAM 3 46 WORDS OF WHICH END TELEGRAM ANALYSIS

Date: 10/25/2009

KEPT KEPT KEPT SYSOUT KEPT SYSOUT 0MIN 00.86SEC SRB

0MIN 00.02SEC VIRT

0MIN 00.86SEC SRB

0MIN 00.02SEC

200K SYS

268K

5 OVERSIZE 6 OVERSIZE 4 OVERSIZE

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

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; *PROCESS AGGREGATE, OFFSET, CMPAT(V1); *PROCESS OPT(2) ATTRIBUTES(FULL) XREF(SHORT); /*PPL-TITLE: EPTELE2- TELEGRAM ANALYSIS V02 */ /********************************************************************/ /* PGM_ENTRY: EPTELE2 */ /* Author: DIPL.ING. WERNER HOFFMANN */ /* Date written: 1978/09/17 */ /* */ /* Files: */ /* FTELE - Input Telegrams. */ /* FREPORT - Telegram Report. */ /* Subroutines: */ /* EGETWRD - Get a Telegram Word */ /********************************************************************/ EPTELE2: PROC OPTIONS(MAIN) REORDER; /* Data ------------------------------------------------------------*/ DCL XWORD CHAR(80) VARYING INIT(''); /* DEFAULTS, ENTRIES, BUILTINS -------------------------------------*/ DCL LENGTH BUILTIN; /* Files -----------------------------------------------------------*/ DCL FTELE FILE STREAM INPUT; DCL BEOF BIT(1) STATIC; /*EOF Condition */ DCL FREPORT FILE PRINT OUTPUT; /* Telegram Informations -------------------------------------------*/ DCL 1 STELE STATIC, 2 NO PIC'ZZZ9', /*Telegram Number */ 2 NWORD_COUNT PIC'ZZZZ9', /*Words in Telegram */ 2 NOSIZE_COUNT PIC'ZZZZ9'; /*Words oversized */ DCL BTRUE BIT(1) STATIC INIT('1'B); DCL BFALSE BIT(1) STATIC INIT('0'B); /*H1.1* Initialization Routine -------------------------------- *****/ ON ENDFILE(FTELE) BEOF = BTRUE; BEOF = BFALSE; OPEN FILE(FTELE) INPUT; OPEN FILE(FREPORT) OUTPUT; STELE.NO = 0; /*H1.2* Report Processing ------------------------------------- *****/ /*H1.2.1 Process Report Heading ----------------------------------- */ PUT FILE(FREPORT) LIST('TELEGRAM ANALYSIS') SKIP; CALL EGETWRD; /*Get a Telegram Word */ /*TST*PUT FILE(SYSPRINT) LIST('EP2-1 ',XWORD) SKIP;*/ /*H2 Process Telegrams ---------------------------------------------*/ DO WHILE(XWORD ¬= 'ZZZZ'); /*H3.1 Real Telegram Processing -Initialization ------------------- */ STELE.NWORD_COUNT, STELE.NOSIZE_COUNT = 0; DO WHILE(XWORD ¬= 'ZZZZ'); IF XWORD = 'STOP' /*H4.1 STOP Word -------------------------------------------------- */ THEN; /*Ignore STOP word */ /*H4.2 Count a Telegram Word -------------------------------------- */ ELSE DO; STELE.NWORD_COUNT = STELE.NWORD_COUNT + 1; Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

00001002 00002002 00003002 00029001 00029100 00029201 00029301 00029400 00029500 00029601 00029701 00029801 00029901 00030001 00060000 00080001 00090001 00091001 00130004 00131000 00160004 00170000 00249401 00249501 00249601 00249800 00249901 00250000 00250101 00250201 00250301 00250704 00250804 00250904 00251004 00251104 00251201 00251301 00251400 00251500 00251603 00251703 00251800 00251901 00252005 00252103 00252201 00252305 00252400 00252501 00252601 00252705 00252803 00252905 00253000 00253100 00253203 Page: 1

Software Engineering -

Task 5: Telegram Analysis V02

Date: 10/25/2009

IF LENGTH(XWORD) > 12 THEN STELE.NOSIZE_COUNT = STELE.NOSIZE_COUNT + 1; END; /*H4.3 Telegram Word -Termination --------------------------------- */ CALL EGETWRD; /*Get a Telegram Word */ /*TST*PUT FILE(SYSPRINT) LIST('EP2-2 ',XWORD) SKIP;*/ END; /*H3.2 Real Telegram Processing -Print a Telegram ----------------- */ STELE.NO = STELE.NO + 1; PUT FILE(FREPORT) LIST ('TELEGRAM '||STELE.NO) SKIP; PUT FILE(FREPORT) LIST (' '||STELE.NWORD_COUNT|| ' WORDS OF WHICH '||STELE.NOSIZE_COUNT|| ' OVERSIZE') SKIP; /*H3.3 Real Telegram Processing -Termination ---------------------- */ CALL EGETWRD; /*Get a Telegram Word */ /*TST*PUT FILE(SYSPRINT) LIST('EP2-3 ',XWORD) SKIP;*/ END; /*H1.2 Process Report Termination --------------------------------- */ PUT FILE(FREPORT) LIST('END TELEGRAM ANALYSIS') SKIP; CLOSE FILE(FTELE); CLOSE FILE(FREPORT); /********************************************************************/ /* PGM_ENTRY: EGETWRD - Get a Telegram Word */ /* Data updated: XWORD */ /********************************************************************/ EGETWRD: PROC REORDER; /* VALUES, DEFAULTS ------------------------------------------------*/ DCL XCHAR CHAR(1) STATIC; /*ONE CHARACTER OF FTELE */ GET FILE(FTELE) EDIT(XCHAR)(A(1)); /* GET FIRST CHARACTER /*H3 Process a String --------------------------------------------IF XCHAR = ' ' THEN /*H3.1 Space processing - -----------------------------------DO WHILE(¬BEOF & XCHAR = ' '); GET FILE(FTELE) EDIT(XCHAR)(A(1));/*SKIP OVER SPACES END; /*H3.2 Word processing -------------------------------------------XWORD = ''; DO WHILE(¬BEOF & XCHAR ¬= ' '); XWORD = XWORD || XCHAR; GET FILE(FTELE) EDIT(XCHAR)(A(1)); /*GET NEXT CHARACTER END; /*TST*PUT FILE(SYSPRINT) LIST('EGETWRD-1 ',XWORD) SKIP;*/ RETURN; END EGETWRD; END EPTELE2;

*/ */

*/ */ */

*/

00253301 00253400 00253600 00253705 00253801 00253905 00254000 00254105 00254200 00254300 00254400 00254500 00254600 00254705 00254801 00255005 00255100 00255203 00255500 00255601 00255700 00256000 00257001 00258001 00258002 00259101 00259301 00259401 00259801 00259901 00262001 00268001 00269103 00269201 00269301 00269401 00269501 00269601 00269701 00269901 00271001 00272001 00273001 00274001 00275001 00276005 00277001 00279601 00279701 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: [email protected]

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 0

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

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: [email protected]

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 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 TELEGRAM 2 33 WORDS OF WHICH TELEGRAM 3 46 WORDS OF WHICH END TELEGRAM ANALYSIS

108K SYS

252K

5 OVERSIZE 6 OVERSIZE 4 OVERSIZE

Altstädter Straße 12 b 87527 Sonthofen  Telefon: (08321) 65438  e-Mail: [email protected]

Page: 4

Related Documents

Software Engineering
December 2019 49
Software Engineering
June 2020 10
Software Engineering
June 2020 9
Software Engineering
November 2019 34
Software Engineering
November 2019 32
Software Engineering
June 2020 11