USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA...

35
1986-09 Spring 1986 SOUTHERN METHODIST UNF Using Pert at SMU on the IBM Mainframe Jonna Schreiber USING PERT AT 5MIJ ON THE IBM MAINFRAME M . JONNA SCHREIBER DEPARTMENT OF OPERATIONS RESEARCH AND ENGINEERING MANAGEMENT SCHOOL OF ENGINEERING AND APPLIED SCIENCE DALLAS, TEXAS 75275

Transcript of USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA...

Page 1: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

1986-09 Spring 1986

SOUTHERN METHODIST UNF Using Pert at SMU on the IBM

Mainframe

Jonna Schreiber

USING PERT AT 5MIJ

ON THE IBM

MAINFRAME

M.

JONNA SCHREIBER

DEPARTMENT OF OPERATIONS RESEARCH AND ENGINEERING MANAGEMENT

SCHOOL OF ENGINEERING AND APPLIED SCIENCE

DALLAS, TEXAS 75275

Page 2: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

USING PERT AT SMU

ON THE IBM

MAINFRAME

BY

JONNA 5CHREIBER

MAY 10 1986

OPERATIONS RESEARCH DEPARTMENT

SOUTHERN METHODIST UNIVERSITY

Page 3: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

TABLE OF CONTENTS

Summary

Background and Description of Problem Situation 4

Analysis of the Situation 5

Manual Solving of a PERT Network 6

Sample Run of the Program B

Conclusion and Critique 17

APPENDICES

A Final PERT Program for IBM Mainframe 18

B Output File of PERT Program 24

C TRS-80 PERT Program 25

D IBM PC PERT Program 29

Page 4: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

SUMMARY

Solving a PERT network is time consuming and tedious. Once a person learns the basic method of solving a PERT problem, there is no need for him to solve long problems manually. At this time, there is no software for the IBM mainframe to solve a PERT network. The objective of this project is to create a program, that is as easy and as foolproof as possible, to solve a PERT network

Page 5: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

IBACKGROUND AND DESCRIPTION OF PROBLEM SITUATION

The manual solving of a many-activity PERT problem is both time consuming and unnecessary. The mathematics involved to find the critical path--average activity time, earliest start time, earliest completion, latest start time, latest completion time, and slack time, all that must be computed for every activity--are time consuming and prone to error. This is a task better calculated by computer since there is software either currently available or able to developed for almost any need. PERT is being used in the business world, so students studying Operations Research at SMU should know how to solve a PERT problem manually, as they do now On the other hand, most of the businesses that use PERT have software available to solve a problem more quickly and accurately than solving it manually. Because of this, students should also be comfortable working with computers to solve OR problems. At this time, students at SMU have access to computer programs to optimize networks, solve linear programming models, and solve various statistical problems This many may be adequate, but with increasing computerization in business, the more practice and diversity that students have using computers to solve OR problems, the better prepared they will be when they graduate

4

Page 6: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

ANALYSIS OF THE SITUATION

At the beginning of this project., Dr. Barr provided me with the article "Programming PERT in BASIC" from the May 1982 issue of BYTE. This article included a program written by Steven Zimmerman and Leo M. Conrad in TRS-80 Level II Basic (see Appendix C) He also gave me with a disk containing a revised form of the TRS-80 program written by Thomas V. Bonoma for an IBM PC (see Appendix D).

Both of these programs had commands that were unique to the particular system or to microcomputers in general. For example, data can be inputted by a tape recorder on the IRS-80 and, on the IBM, colors, intensities, and cursor position can be changed. These aspects, along with some microcomputer BASIC commands, are not available in the BASIC on the IBM mainframe. These programs also made available the option of reading the input data from data statements at the end of the program. This would not be a valid option once the program is on the mainframe since the students would not have access to the data statements of the program. Also, in my opinion, these programs did not give the user enough other options. He could add or change an existing activity, but he could not delete one. Also, once he committed himself to an option, he could not get himself out of it except by completing the option. The final problem was that the programs, when running, were not easily understood by the beginning user. It took a couple of runs by trial and error to fully understand how to use the program.

After reviewing these programs, I decided that the problems to be corrected were the +o1low±ng

1) revise the program to get rid of all the code that is unable to be used in the BASIC on the IBM mainframe,

2) write a code to delete an activity and ones to get out of any option prematurely, and incorporate them into the program,

3) get the program working on the mainframe, and 4) make the program as foolproof as possible.

5

Page 7: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

LETTER ACTIVITY BEGIN END EVENT EVENT

assemble accounting data 1 2 look for bank 1 3 look for real-estate agent 1 4 seek permits 2 7 make market study of area 2 3 look for contractor 2 5 seek insurance for 2 6

construction get basic architectural 3 5

plans make cost study 3 4 buy land 4 5 list materials 5 6 get more detailed 5 7

architectural plans have survey made 5 8 bu y first batch of 6 8

materials buy second batch of 6 9

materials complete detailed internal 7 B

layout of foundation hire crew 7 9 build foundation 8 9

OFT. LIKE. PEGS. TIME TIME TIME

1 2 3 S

2 13 17 4 5 8 2 4 1.4 2.2 6.7 .4 1.3 1.5

4..

3 4 5 8 11 13 2 4 4. -

1 2 4 2 3 4

1 2

9 11 12

1 3 6

A B C z D 6 F

H

E I J K.

L M

0

N

0 F

MANUAL SOLVING OF A PERT NETWORK

This section is included in this report only for comparative purposes. The problem described and solved manually here will be the same one that will be solved with the sample running of the program. The following data is given:

This data corresponds to the network drawing in Figure 1. The earliest start time and the latest finish time are then calculated by the forward and backward pass through the network. See Figure 2. All this determines is the critical path. To figure the probability that a project will be completed requires tedious calculations using statistics.

6

Page 8: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

FIGURE 1

FIGURE 2

241 5.83J7.83 2.a33 28,33 mm

I --

7

Page 9: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

SAMPLE RUN OF THE PROGRAM

To give you an idea of how the final program works, this section will show you a sample run. An explanations of the different steps will be included.

First, an introductory message and the input menu will be presented to the user.

PERT/CRITICAL PATH SCHEDULING ORIGINAL BY S.M. ZIMMERMAN AND L.M. CONRAD

REVISED BY JONNA SCHREIBER

NOTE: BEGINNING EVENTS WILL BE SORTED NUMERICALLY AND ALL INFUTED TIMES WILL BE ROUNDED TO 2 DECIMAL PLACES

MENU FOR INPUT CHOICES

K - Keyboard D - Disk File E - END

If the user has a file with the input data in his account, he types a D, and he will be asked for the file name.

MENU FOR INPUT CHOICES

K - Keyboard D - Disk File E - END

What is your selection ? D

FILE INPUT ROUTINE

Name of File ? TESTDATA

B 4

Page 10: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

Alternate: If the user wishes to exit the program at this time, he types an E.

Alternate; If the user wants to enter his own data, he types a F.

MENU FOR INPUT CHOICES

K - Keyboard D - Disk File E - END

What is your selection ' K

Title of Project ? EXAMPLE

How many different activities do you have ? 18

Enter the 18 activities one at a time.

For each, you'll need: an activity code or name • description • beginning event number an ending event number an optimistic completion time estimate a most likely completion time estimate a pessimistic completion time estimate

DATA ENTRY ROUTINE: ACTIVITY * 1 Activity Code or Name ? A Description ' ACCT. PAPERS Beginning Event ? 1 Ending Event '7 2 Optimistic Time 2 1 Likely Time • 2 Pessimistic Time 7 3

DATA ENTRY ROUTINE: ACTIVITY * 2 Activity Code or Name '7 Z Description 9 PERMITS Beginning Event 7 2 Ending Event 7 7 Optimistic Time 7 4 Likely Time 7 5 Pessimistic Time 7 8

This is continued until all of the activities are entered.

9

Page 11: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

Once all the data has been keyed in or the file containing the data has been found, the user then verifies this data.

PROJECT EXAMPLE

VERIFICATION OF INPUT

NO. CODE DESCRIPTION BEGIN END OPTIMIST LIKELY PESSIMIST EVENT EVENT TIME TIME TIME

1 B SHOP BANKERS 1 3 2.00 4.00 6.00 1 C SHOP REAL EST. 1 4 2.00 13.00 17.00 3 A ACCT. PAPERS 1 2 1.00 2.00 3.00 4 Z PERMITS 2 7 4.00 5.00 8.00 5 D MARKET STUDY 2 3 2.00 4.00 5.00 6 6 CONTRACTOR 2 5 1.40 2.20 7 F INSURANCE 2 6 0.40 1.30 1.50 8 E COST STUDY 3 4 3.00 4.00 5.00 9 H ART PLANS 3 5 2.00 4.00 6.00 10 I LAND 4 5 8.00 11.00 13.00 11 K PLANS 5 7 2.00 5.00 12.00 12 L SURVEY 5 8 1.00 2.00 4.00 13 J MATERIAL 5 6 2.00 3.00 4.00 14 0 BUY MAT *2 6 9 1.00 2.00 5.00 15 M BUY MAT *1 6 8 2.00 3.00 4.00 16 0 HIRE CREW 2 7 9 1.00 2.00 3.00 17 N LAYOUT 7 8 9.00 11.00 12.00 18 P FOUNDATION 8 9 1.00 3.00 6.00

Input: -3 to Delete, -2 to Add -1 to Continue, or Activity Number to Change

The user then can revise the data if necessary.

10

Page 12: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

To delete an activity, the user types a -3.

Input: 3 to Delete, -2 to Add -1 to Continue, or Activity Number to Change

Which Activity do you want deleted (0 to END) ? 6

5 D MARKET STUDY 2 3 2.00 6 F INSURANCE 2 6 0.40 7 E COST STUDY 3 4 3.00

4.00 5.00

1.30 1.50

4.00 5.00

The user then is asked to verify his data again. Activity *6 - Contractor) has been deleted. The date items after

activity B have been moved so that the activity numbers are continuous.

11

Page 13: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

To add an activity, the user types a -2.

Input: -3 to Delete, -2 to Add -1 to Continue, or Activity Number to Change

-2

New Activity Code or Name or END to Quit ? NEW New Description 2 LOSE INFORMATION New Beginning Event Number ? 6 New Ending Event Number 7 7 New Optimistic End 7 25 New Likely End 2 4.25 New Pessimistic End 2 10

15 M BUY MAT *1 6 8 2.00 3.00 4.00

16 NEW LOSE INFORMATION 6 7 2.50 4.25 10.00

17 D HIRE CREW 7 9 4.00 5.00 6.00

He is then asked for the information about the activity. The activity is then put into the verification table by the beginning event number. The activity NEW has been added.

1' £4.

Page 14: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

To change an activity, the user types the activity number from the verification table that he wishes to change. The information about that activity is shown, and the user is asked to input the new information The user is again asked to verify the data. (Note: If the beginning event number was changed, the activity may be located at a different activity number.)

Input: - to Delete, -2 to Add -1 to Continue, or Activity Number to Change

? 16

Activity Code or Name: Q Description: HIRE CREW 2 Beginning Event: 7 Ending Event: 9 Optimistic Time: 1 Likely Time: 2 Pessimistic Time: 3

New Activity Code or Name or END to Quit ? 0 New Description ? HIRE CREW New Beginning Event Number 7 New Ending Event Number ? 9 New Optimistic End 4 New Likely End ? 5 New Pessimistic End 2. 6

15 M BUY MAT *1 6 8 2.00 3.00 4.00 16 Q HIRE CREW 7 9 4.00 5.00 6.00 17 N LAYOUT 7 8 9.00 11.00 12.00

13

Page 15: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

IIf all the information is correct, the user types a --1. A table of all the computed values is shown, and the user- is asked if he would like to create a file for the results of the project he is running. If so, a file is created and is giventhe name that the user indicates. (Note: these results are for the original data.)

Input: - to Delete, -2 to Add -1 to Continue, or Activity Number to Change

? -1

RESULTS

CODE DESCRIPTION EXPECTED EARLY EARLY LAST LAST SLACK TIME START FINISH START FINISH TIME

B SHOP BANKERS 4.00 0.00 4.00 3.83 7.83 3.83 C SHOP REAL EST. 11.83 0.00 11.83 0.00 11.83 0.00 A ACCT. PAPERS 2.00 0.00 2.00 2.00 4.00 2.00 Z PERMITS 5.37 2.00 7.33 23.00 28.33 21.00 D MARKET STUDY 3. 87 2.00 5.83 4.00 7.83 2.00 0 CONTRACTOR 2.82 2.00 4.82 19.84 22.66 17.84 F INSURANCE . 1.18 5.83 3.18 34.98 36.16 32.98 E COST STUDY 4.00 5.8 9.83 7.83 11.83 2.00 H ART PLANS 4.00 11.93 9. 8-.!r 18.66 22.66 12.83 I. LAND 10.83 22.66 22.66 11.83 22.66 0.00 K PLANS 5.67 22.66 28.33 22.66 29.33 0.00 L SURVEY 2.17 22.66 24.83 36.99 39.16 14.33 J MATERIAL 3.00 25.66 25.66 33.16 36.16 10.50 0 BUY MAT #2 2.3: 25.66 27.99 40.00 42.33 14.34 M BUY MAT *1 3.00 25.66 28.66 36.16 39.16 10.50 0 HIRE CREW 2 2.00 28.33 30.33 40.33 42.33 12.00 N LAYOUT 10.8.L. 28. 9.16 28. 9.16 0.00 P FOUNDATION 3.17 39.16 42.33 39.16 42.33 0.00

Do you want to create a file for the results of project EXAMPLE (Y/N) ? Y Name of File ' GEORGE

OUTPUT MENU

C - Critical Path and Time Calculations F - Save Data in File E - END

Choice •'

14

Page 16: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

Most of the time, the user will want to compute the critical path and the probability that a project will be completed by some specific time. To do this, he types a C.

OUTPUT MENU

C - Critical Path and Time Calculations F - Save Data in File E - END

Choice 7 C

'Critical Path: C I K N F

Time of Critical Path 42.33

Input a Scheduled Project Time (Use same time units as data) ? 45.9

Z = 1.9

Probability of being completed on time =

OUTPUT MENU

C - Critical Path and Time Calculations F - Save Data in File £ - END

Choice 7

This can be done as many times as the user wants just by repeatedly typing a C in response to the output menu.

15

Page 17: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

If the user wants to save the data he inputted in a file for future use, he types an F. A file is then created and is given the name that the user indicates.

OUTPUT MENU

C - Critical Path and Time Calculations F - Save Data in File E - END

Choice ? F

Name of File ? EXDATr

Once an E is entered in response to the output menu, the following message will appear if a file of the results was requested.

If you ever want a hard copy of your results, QUIT out of BASIC and type PRINT GEORGE BASDATA

Appendix B shows the contents of the file GEORGE.

16

Page 18: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

CONCLUSION AND CRITIQUE

To aid future Operations Research students, I would urge the Operations Research Department to ask that this PERT program (see Appendix A) , or a version of this program, be put on the IBM mainframe in Bradfield. This program, even when it is necessary to input all of the data, is -faster and more accurate at salving a large PERT problem than anyone solving the same problem manually. Because businesses do use PERT model software, it would be advantageous for students to know that PERT software does exist. It would also be advantageous for students to be able to use some form of this software, as well as being able to solve a problem manually.

'

This program is very good as long as the user properly sets up the PERT network. There must be only one initial event and one terminal event. The optimistic, likely, and pessimistic times must be in ascendin g order--this is checked

1

by the program. The last thing the user must remember is that there can only be one activity between a beginning event and ending event pair.

The limitations to this program have to do with the rules of PERT listed in the previous paragraph. If the user has inputted data in such a way that there is more than one initial event or more than one terminating event, the program will give invalid answers. This situation can also be accomplished when adding or deleting activities. Also, the program will give invalid answers i-f the user tries to have two or more activities between a beginning event and ending event pair. All of these situations result in the computing of negative start, -finish, and slack times.

Although the program is useful in its present -form, it

1 can be improved. The major improvement that can be made is to incorporate Crashing with its associated costs into the H

program. Other possible improvements include checks for multiple initial events, multiple terminating events, and I

multiple activities between a beginning event and ending event pair.

17

Page 19: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

1000 PROGRAM: ENHANCED PERT SnIU\CE: BYTE, MAY, 1982, P. 469FF 1010 FUNCTION: PER F-CH4FTIN(; DATE: MAY I t 1986 1020 ORIGINAL BY: S.M. ZIMI4EPMAN/L.M. Lflt•JRA 1030 REVISED BY: JI1NNA SCfIREIBFR 1,040 1050 DATA VARIABLES 1060 A$(?,1) = ACTIVITY CODE Ills NAME 1070 A$(?,2) = ACTIVITY DESCP!PTIIiN 1080 (?,I) = BEGINNING EVENT NIIMF3tR OF ACTIVITY 1090 Afl?92) = ENDING EVENT NUMBER OF ACTIVITY 1100 AU,1) = OPTIMISTIC COMPLETION TIME OF ACTIVITY m

z 1110 4(?,2) = LIKELY COMPLETION TIME OF ACTIVITY 1120 A(?,3) = PESSIMISTIC COMPLETION TIME OF ACTIVITY 1130 A(?,4) = EXPECTED VALUF OF ACTIVITY '( 1140 A(?,5) = EARLIEST START TIME IF ACTIVITY 1150 A(?,6) = EARLIEST FINISH TIME OF ACTIVITY 1160 A(?,fl = LATEST START TIME OF ACTIVITY 1170 A(?,8) = LATEST FINISH TIME OF ACTIVITY m 1180 A(?99) = SL,.CK TIME OF ACTIVITY '-4 1190 Z 1200 INTRODUCTION 1210 1220 PRINT NEWPAGE ii 1230 PRINT TAB(25); "PERT/CRITICAL PATH SCHEDULING" P1 1240 PRINT TAB(19); "ORIGINAL BY S.M. ZIMMERMAN AND L.M. CONRAD" 1250 PRINT TAB(27); "REVISED BY JONNA SCHREIBER" 1260 PRINT: PRINT "NOTE: BEGINNING EVENTS WILL BE SORTED NUMERICALLY AND ALL INPUTED TIMES WILL BE" m 1270 PRINT " ROUNDED TO 2 DECIMAL PLACES." 1280 DIM 45(500,2), 4(500 9 5), A(500,2), SV(1l) 1290 DIM BB545, PATHS48O 1300 1310 DATA INPUT ROUTINE 1320 1330 PRINT: PRINT 148(29); "MENU FOR INPUT CHOICES" m 1340 PRINT: PRINT TAB(29); "K - KEYBOARD" o 1350 PRINT TAB(29); "0 - DISK FILE" 1360 PRINT TAB(29); "F - END" 1370 PRINT: PRINT "WHAT IS YOUR SELECTION ";: INPUT 10$ 1380 IF IO$="F" OR IfJ$="E" THEN 4120 rn 1390 IF IO$<>"D" AND IOt<>"I)" AND lO$<>"K" AND IO$<)"K" THEN 1330 1400 IF I0$(>"K" AND IO$<>"K" THEN 1680 1410 1420 KEYBOARD INPUT ROUTINE 1430 1440PRINT NEWPAGE: PRINT "TITLE OF PROJECT";: INPUT TITLES

ii 1450 PRINT: PRINT "HOW MANY DIFFERENT ACTIVITIES DO YOU HAVE ";: INPUT M 1460 IF M<1 THEN 1450 3 1470 EE=0 P1 1480 PRINT NEWPACE: PRINT "ENTER THE"; M; "ACTIVITIES ONE AT A TIME.": PRINT 1490 PRINT "FOR EACH, YOU I LL NEED: AN ACTIVITY CODE OR NAME" 1500 PRINT " A DESCRIPTION" 1510 PRINT " A BEGINNING EVENT NUMBER" 1520 PRINT " AN ENDING EVENT NUMBER" 1530 PRINT " AN OPTIMISTIC COMPLETION TIME ESTIMATE" 1540 PRINT " A MUST LIKELY COMPLETION TIME ESTIMATE"

Page 20: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

1550 PRINT 11 I PESSIMISTIC COMPLETION TIME ESTIMATE" 1560 FOR 1 = 1 TO M 1570 PRINT: PRINT 148(24); "DATA ENTRY ROUTINE: ACTIVITY ";I 1580 PRINT "ACTIVITY CODE [JR NAME ";: INPUT 4$( 1,1) 1590 PRINT "DESCRIPTION ";: INPUT 4t(1,21 1600 PRINT "BEGINNING EVENT ";: INPUT 4( 1,1) 1610 PRINT "ENDING EVENT ";: INPUT AflL 21 1620 PRINT "OPTIMISTIC TIME "; : INPUT 1,1): R=A( 1,11*100: 4(1 ,1)=8/100 130 PRINT "LIKELY TIME ";: INPUT 4(1 9 2): B=4(I,2)•4I00: A(192)=8f100 1640 PRINT "PESSIMISIIC tIME ";: INPUT A(L,3): 8=M(I,3)*l0O: Al 1,3)=B%/100 1650 IF .( 1, 1)>A( 1,2) OR A( I,2)>A( 1,3) THEN PRINT "INVALID DATA": GOTU 1620 1660 NEXT I 1670 6010 1800 1680 1690 FILE INPUT ROUTINE 1700 1710 PRINT NEWPAGE: PRINT TAB(31); "FILE INPUT ROUTINE" 1720 PRINT: PRINT "NAME OF FILE ";: INPUT 8$ 1730 OPEN #1.: NAME 8$ 9 INPUT, INTERNAL, SEQUENTIAL, BEGIN 1740 INPUT #1: M, EE 1750 INPUT MI: TITLES 1760 FOR 1 = 1 TO M 1770 INPUT Mi: At (1,1), A 5(1,2), A (I, 1), A( 1,2) , 4(1,1) , 4(1,2) 9 A(1,3) 1780 NEXT I 1790 CLOSE MI j800

,- 1810 SORT DATA .o 1620

1830 M=M: TP=0 1840 FOR I1 TO M 1850 IF 4(1 9 2)>TP THEN TP=A(t,2I 1860 NEXT I • 1870 EE=TP • 1880 FOR 1=1 TO M-1 1890 FOR J=1+1 TO M 1900 IF A(I,1)<=A(J,I) THEN 1940 1910 FOR K=I TO 2: SV(K)=4((,K): A'(I,K)=A(J,K): A(J,K)=SV(K):NEXT K 1920 FOR K=1 Tu!9: SV(K).4(I,K): A(L,K)=A(J,K): A(J,K)=SV(K): NEXT K 1930 FOR K1 TO 2: SVt(K)=A$(1,K): A$U,Kl=At(J,K): 4$(J,Kl=SVS(K): NEXT K 1940 NEXT J 1950 NEXT I 1960 1970 VERIFICATION OF DATA 1980 1990 PRINT NEWPAGF: PRINT "PROJECT "; TITLES: PRINT 1995 PRINT 148(25); "VERIFICATION OF INPUT": PRINT 2000 PRINT " Nil. CODE DESCRIPTION BEGIN END OPTIMIST LIKELY 2010 PRINT " EVENT EVENT TIME TIME 2020 FORM C

C N3, C CPOS 7, dO, C C PUS 15, C18, C C PUS 36, N3, C C P05 44, N3, C C PUS 52, PIC(ZZZ#.#ff), C

PESSIMIST" TI ME"

Page 21: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

CPLIS6L, PIC(ZZZ..#lfl, C C PUS 71, PICIZZ?#./I#), C SKIP I

2030 FOR 1 = 1 in t•i 2040 PRINT USING 2O2O: I,AS(I,1),A1(I,2),4(I,1),4(192),4((11),A(1,2)9&(193) 2050 NEXT I 2060 PRINT 2070 PRINT: PRINT "INPUT: -3 III DEl ETE," 2080 PRINT " -2 TO ADD," 2090 PRINT " -1 10 CONTINUE, (R" 2100 PRINT " ACTIVITY NUMBER TO CHANGE." 2110 INPUT I 2120 IF 1=-I THEN 2540 2130 IF L=-3 IIIEN 2410 2140 IF. L=-2 THEN I=M+1: M=1: PRINT NEWPAGE: GOTO 2290 2150 IF L>MT OR 1=0 OR L<-3 THEN 2010 2160 2170 PRINT OUT DETAILS OF ACTIVITY TO CHANGE 2180 2190 PRINT NEWPAGE: PRINT "ACTIVITY CODE OR NAIIE: ";A$(L,[) 2200 PRINT "DESCRIPTION: ";A$(1,2) 2210 PRINT "BEGINNING EVENT: ";A(L,1) 2220 PRINT "ENDING EVENT: ";A(L 21 2230 PRINT "OPTIMISTIC TIME: 2240 PRINT "LIKELY TIME: ";A(L,2) 2250 PRINT "PESSIMISTIC TIME: ";A(L,3) 2260 2270 ROUTINE TO AOL) OR CHANGE TASK 2280 2290 PRINT: PRINT "NEW ACTIVITY CODE OR NAME OR END TO QUIT ";: INPUT E 2300 IF (E$="END" OR E$ = "FND") AND M=L AND A(1,1)=" " THEN M=M-1 2310 IF E="END" UP E$="END" THEN 1990 2320 At(L,1)=E$ 2330 PRINT "NEW DESCRIPTION ";: INPUT AS(L,2) 2340 PRINT "NEW BEGINNING EVENT NUMBER ";: INPUT A(L,1) 2350 PRINT "NEW ENDING EVENT NUMBER ";: INPUT A(L,2) 2360 PRINT "NEW OPTIMISTIC END ";: INPUT A(L,1): 8=A(1,l)*100: A(L,1)=B1100 2370 PRINT "NEW LIKELY END ";: INPUT 4(1,2): B=4(1,2)*l0O: A(L,2)=B./1O0 2380 PRINT "NEW PESSIMISTIC END 11;: INPUT A(L,): B=A(L,3)*100: A(L,3)=B/l0O 2390 IF A(L,1)>A(L,2) DR A(1,2)>4(L,3) THEN PRINT "INVALID DATA": G6T02360 2400 GOTO 1830 2410 2420 ROUTINE TO DELETE ACTIVITY 2430 2440 PRINT "WHICH ACTIVITY DI) YOU WANT DELETED 10 TO END) ";: INPUT D 2450 IF D=0 THEN 1990 2460 IF O>M OR D<0 THEN 2440 2465 IF D%=MZ THEN 2510 2470 FOR I=D TO M-1 2480 FOR 3=1 102: At(I,J)=A$(J+I,j): A(t,J)=A(f+I,J): NEXT 3 2490 FOR 3 = 1 TO 3: A(I,J)=4(I+1,J): NEXT J 2500 NEXT I 2510 A$(M,t)=" 2520 M=M-1 2530 GOTO 1830

Page 22: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

• 2540

2550 CALCULATIONS 2560 2570 FOR 1=1 TO M

2580 4(1,4) = (i(I,1) +4*4(1,2)' 4(193)1/6

2590 B=4(l,4)4I00: A(I,4).8'/100

200 IF AT( t,1)=1 THEN A(I,5P=0: 44I,6)=A(I,41: GOTJ 2700

2610 MAXI=O

2620 FOR J=1 TO M

2630 IF 4(J,2)<>A(1,I) THEN 2660

2640 IF A(J,6)>MAXI THEN MAXI=A(J,6)

2650 A(I,5)=MAXI

2660 NEXT J

2670 B=A(1,5)*tOO: 4(1,5=8/100

2680 4(1,6) = 4(1,5) + 4(1,1,)

2690 B=A(I,6)+lO0: A(I,6)=B/100 2700 NEXT I 2710

2720 BACKWARD PASS 2730 2740 XM=0 2750 FOR I=M TO I STEP -1

2760 IF A(I,2)<>EE THEN 2780

2770 IF XM(A(I,6) THEN XM=A(1,6) 2780 NEXT I 2790 FOR I=M TO I STEP -1

2800 IF A(I,2)=EE THEN A(1,8)=XM: GOTO 2880

j 2810 MIM=999999

2820 FOR J=MT TO 1 STEP -1

2830 IF A9(T,2)<>A(J,I) THEN 2860

2840 IF A(J,7)<MIM THEN t4IM=A(J,7)

2850 A(I,8)=MIM

2860 NEXT J

• 2870 B=A(h8)*100: A(I,8)=B/1OO

2880 A(I 7) = 4(1,8) - 4(1,4)

2890 B= 0. A(1 9 71=B%/100 2900 NEXT I 2910

2920 SLACK VARIABLE CALCULATIONS 2930 2940 FOR 1=1 TO M

2950 4(199)= 4(1,8) - A(196)

2960 8=A(1,9)100: A(1,9)=B/100 2970 NEXT I

• 2980

2990 PRINT OUTPUT • 3000

3010 PRINT NEWPAGE 3020 PRINI TAB(35); "RESULTS": PRINT

3030 PRINT "CODE DESCRIPTION EXPECTED EARLY EARLY LAST LAST SLACK"

3040 PRINT " TIME START FINISH START FINISH TIME" 3050 FORM £

C CIO, C

C PUS 12, C18, C C PUS 33, P!C(ZL.), &

Page 23: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

C PUS 42, P1C(Z7#.H), 1 C PUS 50 9 PIC(ZZH.#4), C

C PUS 58, PIC(ZlH.H#) C C PUS 65, PIC(ZZ#.##), C C PUS 72 9 P!C(Z7#.'il1), C C SKIP 1

3060 FOR f = i TO M 3070 PRINTUSING 3050: L,I),Af(I,2),A(I,,),4(I,5),A(1,6),4(L,7),4(I,8),A(1,q) 3080 NEXT I 3090 PRINT: PRINT 1100 YOU WANT Tfl CREATE A F ILE FR THE RESULTS Of PROJECT "; TITLE 1; " (YIN) "; 5100 INPUT (.tJt'Y

3110 IF COPY$= 1 N" OR COPVS="N" TI-IFN 3350 3120 IF COPYS<)"Y" AND COPY$<"Y" THEN PRINT: WTO 3090 3130 COPY$="Y" 3140 PRINT "NAME OF FILE II ;: INPUT FILS 3150 OPEN Hi: NAME FILS, (IJTPUT, DISPLAY, SEQUENTIAL, 6EGIN 3160 L=1EN(TITLES): Lt=(72-1T)/2 3170 PRINT #1: TAB(IU; "PROJECT "; TITLES 3180 PRINT Hi: " ": P1INT HI: I'll 3190 PRINT #1: 148(35); "INPUT OATA": PRINT HI: " " 3200 PRINT Hi: "ACTIVITY ACTIVITY BEGIN END 3210 PRINT #1: "NO. CODE DESCRIPTION EVENT EVENT 3220 PRINT Ni: " " 3230 FOR 1=1 TO M 3240 PRINT HI, USING 2020: I, 45(1,1), 45(1,2), A(I,I),A(I,2), 3250 NEXT I 3260 PRINT-H1: " ": PRINT Ni:

t5

A( 1,1), 4(1,2), 4(1,3)

3270 PRINT Hi: TAB(37); "RESULTS": PRINT HI: -0 PRINT "LUIft !)E5CP (PT ION EXPECTED EARLY EARLY LAST LAST SLACK"

3290 PRINT #1: " lIME START FINISH START FINISH TIME" 3300 PRINT HI: 3310 FOR 1=1 TO M 3320 PRINT Hi, USING 3050cAS(I,1), A$(1 9 2) 9 A(I,4), 4(1,5), 4(1,6), AC!,?), 4(1,8), 4(199) 3330 NEXT I 3340 PRINT Ni: " ": PRINT #1: 3350 PRINT 3360 PRINT 148(35); "OUTPUT MENU" 3370 PRINT: PRINT T48(35); "C - CRITICAL PATH AND TIME CALCULATION" 3380 PRINT 148(35); "F - SAVE DATA IN FILE" 3390 PRINT TAB(35); "E - END" 3400 PRINT: PRINT "CHOICE ";: INPUT UPS 3410 IF OP$<>"C" AND OP$<>"C" THEN 3950 3420 3430 IDENTIFICATION OF CRITICAL PATH AND COSTS 3440 3450 PRINT NEWPAGE 3460 CO=O: PATH$=" ": SI=0 3470 FOR 1=1 TO M 3480 IF A(1 9 9)>0 THEN 3510 3490 CO = CO 4 4(1,4): PATHS = PATHS C " " C 45(1,11 3500 SI SI + ((4(1,1) - A(I,3))/6) ** 2 3510 NEXT I 3520 SI=SQR(SI) 3530 PRINT: PRINT 3540 PRINT "CRITICAL PATH": PRINT PATHS: PRINT

OPTIMIST LIKELY PESSIMIST" TIME TIME TIME 11

Page 24: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

3550 PRINT "TIME OF CRITICAL PATH ": PRINT USING 3560: CI): PRINT 3560 FORM PIC(ZlZ,ZZZ,77N.NN) 3570 PRINT "INPUT A SCHEIJULEI) PROJECT TIME (USE SAME TIME UNITS AS DATAP 3580 INPUT ST 3590 IF COPYS<>"Y" THEN 3650 3600 PRINT #1: " ": PRIN1 Ni: It 3610 PRINT #1: " ": PRINT Ni: "CRITICAL PATH": PRINT NI: PATHS: PRINT Ni: 3620 PRINT 01: "TIME OF CRITICAL PATH 11 ;: PRINT i, USING 35c0: CO: PRINT #1: 3630 PRINT #1: "SCHEDULED PROJECT TINE =11; 3640 PRINT NI: ST 3650 Z = (ST - COP/ST: XX=0 3660 88S="PROBABILITY OF BEING COMPLETEt) ON huE = 3670 IF 7(0 THEN XX=99:7=-Z 3680 41=.4361836: B-.1201676: C=.937298 36900 = (2.7182818'.'(-742/2)) " (2i3.14I5926).P(-.5) 3700 E = ( 1#.3326*7)*.*(-I) 3710 P = I - 0 * (A1E i BsEi.2 + C.PEs*31 3720 IF XX>0 THEN 3860 3730 FORM "2 = ",PIC(ZZlN.N#N) 3740 PRINT 3750 PRINT USING 3730: 2 3760 PRINT 3770 PRINT BBS; 3780 FORM PIC(ZL#.#N#) 3790 PRINT USING 3780:P 3800 IF COPY$<>"Y" THEN 3350 3810 PRINT I: " " 3820 PRINT #19 USING 3130: 2 3830 PRINT NI: " " 3840 PRINT #1: BBS; 3850 PRINT NI, USING 3780:P: GOTO 3350 3855 PRINT 3860 PRINT USING 3730: -z 3870 PRINT 3880 PRINT BBS; 3890 PRINT USING 3780:1-P 3900 IF COPY$<>"V" THEN 3350 3905 PRINT Ni: " " 3910 PRINT #1, USING 3730: -Z 3920 PRINT NI: It " 3930 PRINT Ni: BBS; 3940 PRINT Ni, IjSINC, 3780:L-P: GOTO 3350 3950 IF OPS="E" OR OP$ = "E" THEN 4070 3960 IF OP$<>"F" AND OPS(>"F" THEN PRINT: GOTO 3350 3970 PRINT NEWPAGE 3980 PRINT "NAME OF FILE ";: INPUT X$ 3990 OPEN #2: NAME X$, 4000 WRITE #2: M

EE OUTPUT, INTERNAL, SEQUENTIAL, BEGIN ,

4010 WRITE #2: TITLES 4020 FOR 1=1 TO M 4030 WRITE #2: 45( I,1),AS(I,2),A(I,L),4( I,2),A(I,1),A(I,2),A(I,3) 4040 NEXT I 4050 CLOSE.02 4060 SOlO 3350 4070 IF COPV$="Y" THEN CLOSE #1

4080 PRINT NEWPAGE 4090 IF COPYS="Y'l

I?S PRINT:'R!T T :: ASD4TA" 1W YOUR RESULTS, QUIT OUT OF BASIC AN') TYPE"

4120 STOP 4130 END

Page 25: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

APPENDIX B: OUTPUT FILE OF PERT PROGRAM

PROJFCT TEST

INPUT DATA

ACTIVITY ACT[ VITY BEGIN END UPTItIIST LIKELY PESSIMIST NO. CODE OESCRIPIJON EVENT LVEUT lIME TIME TIME

B SUIiP RANKERS 1 3 2.00 4.00 6.00 2

I

IC SHOP REAL ES!. 1 4 2.00 13.00 17.00

3 A ACCT. PAPERS 1 2 1.00 2.00 3.00 4 Z PERMITS 2 7 4.00 5.00 8.00 5 1) MARKET STUDY 2 3 2.00 4.00 5.00 6 0 CONTRACTOR 2 5 1.40 2.20 6.70 7 I F INSURANCE 2 6 0.40 1.30 1.50 8 E COST STUDY 3 4 3.00 4.00 5.00 9 H ART. PLANS 3 5 2.00 4.00 6.00

10 1 LAND 4 5 8.00 11.00 13.00 K PLANS 5 7 2.00 5.00 12.00

Iii 12 1 SURVEY 5 8 1.00 2.00 4.00 13 J MATERIAL 5 6 2.00 3.00 4.00 14 0 11JY MAT #2 6 9 1.00 2.00 5.00 15 M BUY MAT 11 6 8 2.00 3.00 16 0 HIRE CREW 2 7 9 1.00 2.00 3.00 I 17 N LAYOUT 7 B 9.00 11.00 12.00 18 P FOUNDATION 8 9 1.00 3.0(1 6.00

I RESULTS

CODE DESCRIPTION EXPECTED EARLY EARLY LAST LAST SLACK TIME START FINISH START FINISH TIME I B SHOP BANKERS 4.00 0.00 4.00 3.83 7.83 3.83

C SHOP REAL EST. 11.83 0.00 11.83 0.00 11.83 0.00 A ACCT. PAPERS 2.00 0.00 2.00 2.00 4.00 2.00

PERMITS 5.33 2.00 7.33 23.00 28.33 21.00 MARKET STUDY 3.83 2.00 5.83 4.00 7.83 2.00

ID 0 CONTRACTOR 2.82 2.00 4.82 19.84 22.66 17.84 F INSURANCE 1.18 2.00 3.18 34.98 36.16 32.98 E COST STUDY 4.00 5.83 9.83 7.83 11.83 2.00 H ART. PLANS 4.00 5.83 9.83 18.66 22.66 12.83 I

ILAND 10.83 11.83 22.66 11.83 22.66 0.00

K PLANS 5.67 22.66 28.33 22.66 28.33 0.00 L SURVEY 2.17 22.66 24.83 36.99 39.16 14.33 J MATERIAL 3.00 22.66 25.66 33.16 36.16 10.50 0 BUY MAT 42 2.33 25.66 27.99 40.00 42.33 14.34 M I BUY MAT #1 3.00 25.66 28.66 36.16 39.16 10.50 Q I-lIRE CREW 2 2.00 28.33 30.33 40.33 42.33 12.00 N LAYOUT 10.83 28.33 39.16 28.33 39.16 0.00 P I FOUNDATION 3.17 39.16 42.33 39.16 42.33 0.00

CRITICAL PATH I CIKNP

TIME OF CRITICAL PATH 42.33

SCHEDULED PROJECT TIME 45.9 I Z 1.093

PROBABILITY OF BEING COMPLETED ON TIME = 0.863

ICRITICAL PATH

C I K N P

I TIME OF CRITICAL PATH 42.33

SCHEDULED PROJECT TIME = 40.2

I= -0.652

PROBABILITY OF BEING COMPLETED ON TIME = 0.257

24

Page 26: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

APPENDIX C: TRS-80 PERT PROGRAM

10 CLEAR 1000:CLS:REM TMPERt" 20 PRINTPERT/CRITICAL PATH SCHEDULING PROGRAM" 30 PRINT"DEVELOPED BY STEVEN N. ZIMMERMAN,PH.D. & LEO N. CONRAD 1980" 40 INPUT"DISK SYSTEM OR LEVEL II BASIC (D/B)";S$ 50 PRINT: PRINT"*** NOTE BEGINNING EVENTS WILL BE SORTED INTO NUMBERICAL ORDER *' :INPUT"DINENSION FOR ACTIVITIES";D7.:PRINT 60 DIM A*(D,2),A(DV.,11),SV(11) 70 PRINTINPUT MENU 80 PRINT" K KEYBOARD" 90 PRINT" D DISK FILE" 100 PRINT" R READ STATEMENT" 110 PRINT" Ti TAPE RECORDER *-i" 120 PRINT" T2 TAPE RECORDER *-2" 130 INPUT"SELECTION"; 10$ 140 IFIO$<>KTHEN 220 150 INPUT"NUMBER OF ACTIVITIES";M7.:EEO 160 PRINT"THIS IS GOING TO BE WORK YOU MUST NOW INPUT UP TO ";M%" AC TIVITIES" 170 FOR 1=1 TO M7. 180 INPUT"ACTIVITY CODE ";A$(I,.1) 190 INPUT"DESCRIPTION, BEGINING EVENT NUMBER. END EVENT NUMBER, MOST OPTIMISTIC TIME, MOST LIKELY TIME AND MOST PESSIMISTIC TIME";AS(I,2),A(I.1),A(I.2).A(I.3).A (I,4),A(I,5) 200 NEXTI 210 60T0480 220 IFIOS=T1"ORIO$="T2"THEN230 ELSE330 230 PRINTSETUP TAPE *-";IO&;" TO PLAY":REM TAPE INPUT 240 IF SS=D"CMDT" 250 IFIO$="TI"INPUT*-1.M%,EE 260 IFIO$="T2"INPUT*-2.M7..EE 270 FORI=1TOMY. 280 IFIO$=T1 " INPUT*-1 ,A$ (I. 1) • A$ (I • 2) : INPUT*-1 .A( 1, 1) • A (I • 2) A (I • 3) .A (I • 4) • A (I. 5) 290 IFIO$="T2"INPUT*-2.A$(I,1).A$(I.2):INPUT*-2.A(I.1).A(I.2),A(I.3).A(I.4).A(I. 5) 300 NEXT! 310 IFS$="D"CMD"R" 320 G0T0480 330 IFIO$<>"D"THEN420 340 LINEINPUT"NAME OF FILE: DISK ; B$: REM DISK INPUT 350 OPEN "I",1B$ 360 INPUT*1,M.EE 370 FORI=lTOrr/. 380 INPUT*1 ,AS (I • 1) • AS (I • 2) ,A( I • 1) ,A (I • 2) • A (I • 3) • A (I • 4) • A U • 390 NEXT! 400 CLOSE I 410 (30T0480 420 IFIO$<>"R"THEN70 430 READM), EE 440 FORI r iTOP17.:REM READ INPUT 450 READA$(1,1),A$(I.2),A(I.1),A(I.2).A(I.3).A(I.4).A(I,5) 460 IFAS (I, 1) ="END"THEN4BO 470 NEXTI 480 REM PRINTS INPUT DATA FOR VERIFICATION 490 MMh:TP=0:FORI=1TOM:IFA(I,2)>TPTHENTPA(I,2) 495 NEXT:EETP 500 FORI=ITOM-1 510 FORJ=I+1TOM 520 IFA(I, 1)<=A(3, 1)THEN55O

25

Page 27: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

I 530 FORK1TO1l:SV(K)A(I,K):A(I,K)A(J,K) :A(J,K)=Sv(K):NEXTK 540 FDRK1T02:SV$(K)A5(I,K) sA$(IK)=A*(J,K) :AS(J,K)=SV$(K) :NEXTK •550NEXTJ,I I 560 XXS:PRINT"VERIFICATION OF INPUT" 570 Z1S="CODE DESCRIPTION EXPECTED EARLY EARLY LAST LAST 580 Z2$=" TIME START FIN START FIN 590 Z3*=CODE DESCRIPTION BEGIN END OPTIMIST LIKELY PESSI"

I 600 Z4$= EVENT EVENT TIME TIME TIME" 610 PRINT"N0 ";Z3$ 620 PRINT" ";Z4S 630 K=0 I 640 C4$="*** 650 FORI=1TOMV.

H

660 PRINTUSINGC4$;J; 670 C1$=" **ft*

I 680 C2$= X h 7.":C3*=" ****.** 690 PRINTUSINGC2$;A$(I, 1) ,AS(I.2); 700 FORJ=1TO2 710 PRINTUSINGC1S;A(I,J);:NEXTJ 1 720 FORJ=3T05

1 730 PRINTUSINGC3$;A(I.J);:NEXTJ 740 K=K+1:IFK>=13 THENPRINT:INPUT"ENTER TO PAGE;DU$:K=0

As750 PRINT:NEXTI

SLACK" TIME"

IU INPUT"-2 TO ADD, — 1 TO CONTINUE OR NUMBER TO CHANGE";L:IFL=-1THEN810 770 IFL< >-2THEN79O 780 LMV.+1 : M7.L: N7.=N7.+1 790 INPUT" INPUT CODE. DESCRIPTION, BEGINNING EVENT NUMBER, END EVENT NUMBER MOST OPTIMISTIC TIME, MOST LIKELY TIME AND THE MOST PESSIMISTIC TIME;AS(L

• . 1) ,A$ (L, 2) .A (L, 1) , A(L. 2) .A (L. 3), A (L. 4) • A (L, 5) 800 G0T0480 810 INPUT"HARD COPY OF INPUT DATA (Y/N)"-.P$ I 820 IFP$<>"YTHEN960 830 INPUT"TITLE";T$:LPRINT"TITLE: ";T$ 840 INPUT"DATE";TS:LPRINTDATE: ";T$ 850 LPRINT"NO ";Z3$ I 860 LPRINT" ";Z4$ 870 FORI=1TOMY. 880 LPRINTUSINGC4$;I; I 890 LPRINTUSINGC2S;AS(I,1),A$(I,2); 900 FORJ=1T02 910 LPRINTUSINGCIS;A(I,J);:NEXTJ 920 FORJ=3T05 930 LPRINTUSINGC3S;A(I,J) ; :NEXTJ I 940 LPRINT" 950 NEXTI 960 REM NOW THE WORK BEGINS BEGINNING EVENT IS 1 EARLY START =0 FOWARD PASS 970 FORI=ITOMV. I 980 A(I,6)=(A(I,3)+4*A(I.4)+AU,5 ) /6 990 -IFA(I,1)=1THENACI,70A(I,B)-ACI,6 :GOTO107Q 1000 MAX=0.0

' 1010 FORJ=1TOMY. 1020 IFA(J,2)<>A(I,1)THEN1050 1030 IFA(J,8))MAXTHENMAX=A(J,8) 1040 A(I,7)=MAX

I 1050 NEXT.] 1060 A(I,8)=A(I,7)-..A(I,6) 1070 NEXTI 1080 REM BACKWARD PASS I 1090 XM=0..0 1100 F0RI=M7.TO1STEP-1 1110 IFA(I,2)<>EETHEN1I30 1120 IFXM<A(I,8THENXM=A(I.8) 1130 NEXT! I 1140 FORI=MTO1STEP-1 1150 IFA( 1,2) EETHENA (1 ;-10) -XM: 6OTOi22O

26

Page 28: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

1160 PiIM=99999 1170 FORJ=Pr/.T01STEP-1 1180 IFA(1,2)<>A(J, 1)THENI2IC 1190 IFA(J,9)<MIMTHENMIM=A(J.9) 1200 A(I.10)MIM 1210 NEXTJ 1220 A(I.9)=A(I. 10)-A(I.6) 1230 NEXTI 1240 REM SLACK VARIABLE CALCULATIONS 1250 FORI=1TOP1 1260 A(I.11)=A(I.10)-A(I.8) 1270 NEXTI 1280 K0:REM PRINT OUTPUT 1290 PRINT"CODE DESCRIPTION EXPECTED EARLY EARLY LAST LAST SLACK" 1300 PRINT" TIME START FIN START FIN TIME" 1310 C5$=" ***.**'• 1320 FORI=1TOM 1330 PRINTUSIN6C2S; AS (I • 1) ,A$ (I • 2); 1340 FORJ=6T011 1350 PRINTUSINGC5S;A(I,3);:NEXTJ 1360 PRINT:K=K+1:IFK=13INPUTENTER TO PAGE";DUS:K=0 1370 NEXTI 1380 INPUT"HARD COPY OF RESULTS (V/N) ";P$: IFps<:>"Y"THENI4S') 1390 LPRINT" ":LPRINTZ1$:LPRINTZ2% 1400 FORI=ITOM7. 141 0 LPRINTUSINGC2S;AS(I. 1) ,AS(I.2); 1420 FORJ=6TO11 1430 LPRINTUSINGC3S;A(1,J);:NEXTJ 1440 LPRINT ":NEXTI 1450 PRINT"OUTPUT MENU" 1460 PRINT" C CRITICAL PATH AND TIME 1470 PRINT" D DISK 1480 PRINT" E END" 1490 PRINT" R RECYCLE" 1500 PRINT" Ti TAPE-1" 1510 INPUT" 12 TAPES-2 SELECTION ";OF3: IF0P$="R"THEN4BO 1520 IFOPS< :>"C"THEN169O 1530 REM IDENTIFICATION OF CRITICAL PATH AND COSTS 1540 CO=0:PATHS= " ":S10 1550 FORI1TOM7.:IFA(i.11)>0.C)0C)O1THEN157O :REM NOTE >0 SHOULD WORE BUT .00001 U SED 1560 CO=CO+A(I.6):PATH$PATH$+" "+A$(I.1):51S1+( (A(I,3)A(15))/6)[2 1570 NEXTI:C6S"S**.***.ftl*.**:SISQR(SI) 1580 CLS:PRINT"CRITICAL PATH":PRINTPATH$:PRINT 1590 PRINT"TIME OF CRITICAL PATH":PRINTUSINGC6$;CO:INPUT"SCHEDULED PROJECT TIME (USE SAME TIME UNITS AS DATA)";ST:Z(ST-CO)/SI:XXC) 1600 BBS="PROBABILITV OF BEING COMPLETED ON TIME: IFZ<OTHENIÔ4O 1610 A.4361836:B_.1201676:C.937298:D(2.71S2818[(ZE2/2))*(2*3.I4i5926)(.5) :E(1+.3326*Z)E(-1):P = 1.-D*(A*E+B*E12+C*EE3) :IFXX >OTHEN1630 :REM TAYLOR SERIES 1620 PRINT"Z= ";Z.BB$;P:GOT0165C 1630 PRINT"Z= ";-Z,BB$; 1-P:G0T01650 1640 XX99: Z-Z:GOTOI61O 1650 INPUT"HARD COPY (YIN) ";P$: IFP$<>"Y"THEN145O 1660 LPRINT" ":LPRINT"CRITICAL PATH":LPRINT PATHS:LPRINT" ":LPRINT"SCHEDULED PRO JECT TIME IS ";ST 1670 LPRINT"TIME OF CRITICAL PATH":LPRINTUSINGC6$;CO:IFXXOLPRINT"Z ";Z.BBS;P:G OTO 1450 1680 LPRINT"Z ";-Z.BB$;1-P:60T01450 1690 IFOP$="E"THENEND 1700 IFOP$<>"D"THEN1750 1710 LINEINPUT°NAME OF FILE:DISK ";X$:OPEN"O"1.X$ 1720 PRINT*1p$7.,EE 1730 FORI=1TOM):PRINT*1.CHR$(34);AS(I.1);CHR$(34);",";CHR$(34)AS(I,2);HR$(34) A (I, 1); A (I • 2); A (1,3) ;A (1, 4) A (1,5) NEXTI 1740 CLOSE1:60T01450

Page 29: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

1750 IFS$="D"THENCMDT" 1760 IFOP*="T1 "PR INTO- 1,M, EE: FORI1TOMV.:PRINT$-1,A$(1, 1) ,AS(I,2) :PRINT*-1.A(I, I

A (1,2) , A (1,3) ,A( 1,4) ,A( 1,5) z NEXTI 1770 IFOP$"T2"PRINT*-2,M%,EE:FORI=1TOMV.:PRINT*-2,A$(I,1),A$(I,2):pRINT*_,(,j ) ,A ( I, 2) .A(1, 3) , AC I, 4) ,A( I, 5) NEXTI 1780 IFS$="D"THENCMD"R" 1790 60T01450 1800 REM PUT DATA HERE FIRST * ACTIVITIES THEN ENDING EVENT NUMBER THEN CODE, DESCRIPTIONBEGINNING EVENT, ENDING EVENT, OPT. TIME, LIKELY TIME, PESS. TIME FO R EACH ACTIVITY. 1810 DATA18,9 1820 DATA A,ACCT. PAPERS,1,2,1,2,3 1830 DATA Z,PERMITS,2.7,4,5,8 1840 DATA 8,SHOP BANKERS,1,3,2,4,6 1850 DATA C,SHOP REAL EST.,1,4,2, 13, 17 1860 DATA D,MARKET STUDY,2,3.12,4,5 1870 DATA G,C0NTRACTOR,2,5, 1.4,2.2,6.7 1880 DATA F INSURANCE,2,6, .4,1.3,1.5 1890 DATA H,ART. PLANS,3,5,2,4,6 1900 DATA E.COST STUDY.3,4,34,5 1910 DATA I,LAND,4,5,8,11,13 1920 DATA J,MATERIAL,5,6,2,3,4 1930 DATA K,PLANS,5,7,2,5,12 1940 DATA L,SURVEY,5,8,1,2,4 950 DATA M,BUY MAT *1,6,8,2,3,4 1960 DATA O,BUY MAT *2,6,9,1,2,5 1970 DATA N,LAYOUT,7,8,9,11,12 1980 DATA P,FOUNDATIDN.18,9,1,3,6 1990 DATA Q,HIRE CREW 2,7,9,1,2,3

28

Page 30: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

APPENDIX D: IBM PC PERT PROGRAM

10 F'ROGRAM:.ENHANCED PERT SOURCE: BYTE, MAY, 1982, PG. 469ff. 20 ' FUNCTION: PERT-CHARTING DATE: 5/1/82 30 ' VERSION: 1.1 AUTHOR: T. V. BONOMA 40 42 SCREEN 0,1,,0:WIDTH 80 45 DEFDBL M,X,F' 47KEY OFF

CLEAR 5000: CLS 60 WIDTH 80: COLOR 5,0,5:LOCATE 1,23:FRINT "PERT/CRITICAL PATH SCHEDULING" 70 LOCATE 3,23: COLOR 7: PRINT "ORIGINAL BY G.M. ZIMMERMAN/L.M. CONRAD"

U 80 LOCATE 5,23: COLOR 9: PRINT "MODIFIED/ADAPTED FOR IBM-PC BY" 90 LOCATE 7,23: COLOR 15: PRINT "THOMAS V. BONOMA MAY, 1982" 100 COLOR 7,0,0:F'RINT:PRINT"Note: Beginning Events will be sorted numerically" 105 LOCATE 12,1 110 FOR I 1 TO 16: FOR J1 TO 15:03:IF Q >15 THEN 0 =0 115 COLOR 0:FRINT CHR$(i);:NEXT J:NEXT I 120 DIM A$ (500,2) ,A (500, 11) ,SV(1i) 130CLS: LOCATE 5,25: COLOR 15,0,0: PRINT "MENU FOR INPUT CHOICES" 135 FOR HOLDIT 1 TO 700:NEXT HOLDIT 140 COLOR 7,0,8: LOCATE 7,20: PRINT "K - Keyboard" 150 COLOR 3:LOCATE 8,20: PRINT "D - Disk File" 160 COLOR il:LOCATE 9,20: PRINT "R - Read Statements already in program" 170 LOCATE 14,40:COLOR 15,0,0: INPUT "What is your selection ";IO$ 175 IF IO$< :::"D" AND IO$ •"R" AND IO$< >"K" AND IO$< >"d" AND IO$< >"r" AND I0$<.,.

THEN 170 180 COLOR 7,0,0: IF IO$::::"K" AND IO$:::>"k" THEN 360 190 CLS: LOCATE 5,5: INPUT "How many different tasks do you have ";MX:EE=0

1

200 COLOR 4,0,9: PRINT: PRINT "OK.. .let's enter them one at a time. For each, well want" .10 PRINT "an activity code, a description, a beginning and ending 'event' 220 PRINT " numberS, and optimistic and pessimistic completion estimates." 230 COLOR S:FR'INT: PRINT "Hit any key to enter data":COLOR 7,0,0 240 TR$=INF'UT$(l) 250 CLS: COLOR 3,00: LOCATE 1,35: PRINT "DATA ENTRY ROUTINE" 260 COLOR 15.00: LOCATE 3,5: PRINT "Code":LOCATE 3,10:PRINT"Descript.": LOCATE

25:PRINT"Beqin?":LOCATE 3,3 2 5:FRINT "End?":LOCATE 3,4:PRINT"Optimistic": LOCATE 3,55:FRINT 'Lkely";:LOCATE 3,64:PRINT "Pessimistic"

270 X4:COLOR 7,0.0 280 FOR 1=1 TO MX 290 LOCATE X,7:INFUT",A$(I,1):LOCATE X,11:INPUT ",A$(I,2):LOCATE X,27:INPUT

A(l,l):LOCATE X,36:INPUT "",A(I,2):LOCATEX,47:INPUT "",A(I,3):LOCATE

1

X,57: INPUT 111 ",A(I,4) :LOCPiTE X,69: INPUT "",A(I,Z) 300 X=X+l 3.40 NEXT I 350 GOTO 460 360 IF IO$< ::: . "D" AND IO< ::•"d" THEN 470 370 CLS:LOCATE 5,30:COLOR 14,0,8:F'RINT "DISK INPUT ROUTINE" 375 ON ERROR GOTO 15000 380 COLOR 7,0,8: PRINT:LINE INPUT "Name of disk -file, e.g., B:xxx:<xxx.yyy

B$: OPEN "118$ 400 INPUT*1, MX,EE 410 FOR 1= 1 TO MX 420 INF'UT#l, A$(I.1),A$(I,2),A(I,1), A(I,2),A(I,3),A(I,4),A(I,5) 430 IF A$(I.1)="END" THEN 540 440 NEXT I 450 CLOSE *1 460 GOTO 530

29

Page 31: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

I 470 475

J 480 490 500

I 510 1 520 - 530

IF IO$( >"R" AND IO$::.:.."r" THEN 130 CLS:FRINT "Reading Data from Program.... Please Wait .....":COLOR 7,0,0 READ M7.,EE FOR 1=1 TO NW. READ A$(I , 1) ,A$(I,2) ,A(I,1) ,A(I,2) ,A(I ,3) ,A(I,4) ,A(I,5) IF A$(I.1)="END" THEN 530 NEXT I

Verify the data which was entered.

540 M=M7.: TF0:FOR I = 1 TO ti: IF A(I,2)>TF THEN TP=A(I,2) 550 NEXT I: EE= TP 560 FOR 1=1 TO M-1 570 FOR J=I+1 TO M 580 IF A(I,1)<=A(J,1) THEN 610 590 FOR K=1 TO 11: SV(K)=A(I,K):A(I,K)=A(J,K):A(3,K)=SV(K) :NEXT K 600 FOR K1 TO 2: sv.(K)=A(I,F.:):As(I,K)=As(J,K):As(3,K)=SVs(K):NEXTK 610 NEXT 3,1 620 CL 630 XX=5: COLOR 14,0,0:PRINT TAEi(25)"VERIFICATION OF INPUT":F'RINT:COLOR 7,0,0 640 7-1$="Code Description Expected Early Early Last Last Slack"

650 22$=" Time Start Fin. Start Fin. Time"

660 Z3$="Cde Description Begin End Optimist Likely Pessin

i st'Time Tithe Ti 670 Z4" Event Event

e 680 PRINT "No. ";Z3$ 690 PRINT ";Z4 700 K=0 710 C4$="** 720 FOR 1=1 TO M 730 PRINT USING C4$I; 740 C1$=" *4t44 750 C2$"\ \":C3" *##*.*# 760 PRINT USING C2$z(I,l) A$(I2); 770FOR 3=1 TO 2 780 PRINT USING 01$(I,J):NEXT 3

790 FOR 3=3 TO 5 800 PRINT USING C3:(I,3):NEXT 3

810 K<+1: IF 1,:':: =20 THEN MSG$ ='Enter to Fage":LGTH=l:ANSWER$"":GOSUB 10000 820 PRINT: NEXT I 830 COLOR 7: MSG$= "Please input a -2 to add more,-1 to continue, or number (E. G., OZ) to change ":LGTH2:GOSUB 10000:ANSERVAL(ANSWER$):L=ANSWER:IF L-1 THEI'

9.05 840 IF L( -2 THEN 860 850 LM*1+1: ML: NXNY.+1: XCHECK=1 : GOTO 860 860 IF L::M7. THEN GOTO 830: ELSE GOSUB 20000: IF ABORT GOTO 830 965 INPUT "New Code Name/Letter or END to ABORT ";A$(L,l) 967 IF A.(L, 1)='END" THEN GOSUB 22000:GOTO 830 870 INPUT "New Description ";A$(L,2): INPUT "New Beginning Event Number

A(L.1) 880 INPUT "New Ending Event Number"; A(L,2):INPUT "New Optimistic End 11;A(L,3) 390 INPUT "New Likely End 11 ;A(L,4):INPUT "New Pess. End ";A(L,5)

900 GOTO 620 905 MSG$ ='1 Want hard copy of your data ":LGTHl:GOSUB 10000:P$=ANSWER$:

IF P$< "v' AND F< :::"y" THEN 1040 910 MSG="Tit1e ":LGTH40:GOSUB 10000:T$ANSWER$: LPRINT CHR$(14);"TITLE: ";T 920 LPRINT CHR$(14);"DATE: ";DATE$ 930 LPRINT "NO " Z3$

30

Page 32: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

940 LF'R'INT ' "; 950 FOR 1=1 TO M 960 LFRINT USING C4$;I;

970LF'RINT USING C2$ A$ (1,1) ,A$ (1,2);

980 FOR 3=1 TO 2 990 LFRINT USING C1$A(I,J);:NEXT 3

1000 FOR 3=3 TO 5

1010LPRINT USING C3;A(I,J);:NEXT 3

1020 LF'RINT 1

1030 NEXT I

1040

MSG$"HIT ANY :::EY TO COMPUTE RESULTS":LGTH=l:GOSUB 10000

1045 LOCATE 25,2 PRINT "WAIT ..... 1050 FOR 1=1 TO MX 1060 A(I,6)=(A(I,3)+4*A(I,4)-1-A(I,5) )/6

1 1080 MAX = 01. 1090 FOR 3 1 TO M/.

1092

IF AJ,2<::• A(I,1) THEN 1098 1094 IF A(J,9)> MAX THEN MAX = A (3,8) 1096 A(I,7)=MAX 1098 NEXT 3

1 1110 NEXT I 1120Backward pass?

1130XM0! 1140 FOR 1= MX TO 1 STEP -1 1150 IF A(I,2)C:.EE THEN 1170 1160 IF XM<A(IqB) THEN XM = 1170 NEXT I 1180 FOR I=M7. TO 1 STEP -1 1190 IF A(I,2)= EE THEN A(I,10) XM: GOTO 1260

1200

MIM =9999991 1210 FOR 3= MX TO 1 STEP -1 1220 IF AI2)<.::.A(3i) THEN 1250 1230 IF AJ9: ::MIM THEN MIM =A(3,9) 1240 A(I10)=MIM 1250 NEXT 3 1260 A.I,9)=A(I10-A(I,6) 1270 NEXT I 1280'Slac: Variable Calculations 1290 FOR 1=1 TO MX 1300 AI1i)=(I,10-A(I,S) 1 7 10 NEXT I 1320 CLSK=0 'PRINT OUTPUT 1325 COLOR 14,0,0:FRINT TAB(35);"RESULTS":PRINT:COLOR 7,0,0 1330 PRINT "Code Description Expected Early 'Early Last Last Slack" 1340 PRINT " Time Start Fin. Start Fin.

Time 1350 C5$=" 1360 FOR 1=1 TO MX 1365 IF A(I,11)0 THEN COLOR 4 ELSE COLOR 7 1370 PRINT USING C2$;A(I,1),A$(I,2); 1380 FOR 3=6 TO 11 1390 PRINT USING C5;A(I,J);:NEXT 3 1400 F'RINT:K=K-i-1IF K=20 THEN MSG"Enter to Page ":LGTH=l:GOSUB 10000:ANSWER$

31

Page 33: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

1410 NEXT I 1420 MSG$='Hard Copy of Results (V/N) ":LGTH=l:GOSUB 10000:P$=ANSWER$:

IF F$::.> "y" AND P$• :>" y " THEN 1490 1430 LF'RINT " ":LPRINT Z1$:LPRINT Z2$ 1440 FOR 1= 1 TO M 1450LPRINTA$(I,1);" ";:LPRINT USING C2$;A$(I,2); 1460 FOR 3=6 TO 11 1470 LFRINT USING C5$A(I,J) ; : NEXT 3 1480 LFRINT " ": NEXT I 1490 CLS: COLOR 15,0,0:LOCATE 5,30: PRINT "OUTPUT MENU" :COLOR 7,0,0 1500 COLOR 4:LOCATE 7,20:PRINT "C - Critical Path and Time":COLOR 6 1510 LOCATE 8,20: PRINT "D - Disk":COLOR 1 1520 LOCATE 9,20: PRINT "E - END ":COLOR 7 1.530 LOCATE 10,20: PRINT "R - Recycle" 1540 LOCATE 20,35: COLOR 15,0,0: INPUT "Choice, please... ";O'$:IF OP$="R"

OR OF'="r" THEN 530 1550 IF OF$( "C" AND OFs.::.:>"c" THEN 1720 1560 'Identification c-f critical path and costs 1570 CO=0:PATH$=" ":SI=O 1580 FOR 1=1 TO M%: IF A(I,11):: : .000001 THEN 1600 1590 CO=CO+A(I,6):PATH$PATH$+" "+A$(I,1):SI=SI+((A(I,3)-A(I,5))/6)2 1600 NEXT I:C6$="##,*##,###.##":SI=SOR(SI) 1610 CLS:LOCATE 5,30:COLOR 4,0,0:F'RINT "CRITICAL F'ATH":PRINT PATH$:PRINT:

COLOR 7,0,0 1620 PRINT "Time of Critical Path ":PRINT USING C6$CO:INF'UT "Scheduled Project Time (use same time units as data) ";ST:Z(ST-CO)/SI:XX=O 1630 BE="F'robability 0+ being completed on time ": IF Z(0 THEN 1670 1640 A. 4361836:B-1201676:C.937298: D=(2.71828l8*(-Z2/2))*(2*3.1415924*)'

(-.5):E(1+.3326*Z)'(-1):P=1#-D*(A*E+B*E'2+C*E3):IF XX)0 THEN 1660 1650 COLOR 12,0,4:PRINT USING "Z= #*.*##' ";Z;:PRINT BB$;:PRINT USING "*.###"; F: COLOR 7,0,3:GOTO 1680 1660 PRINT USING "Z **.** 11-2;:PRINT BB$;:PRINT USING "*.***";l-P:COLOR 7:

GOTO 1680 1670 XX99: Z=-Z:GOTO 1640 1680 1SG$="Hard Copy (V/N) ";LGTHl :GOSUB 10000:P$ANSWER:

IF F$( :"y" AND P:: "V' THEN 1490 1690 LPRINT " ":LPRINT "CRITICAL PATH":LPRINT F'ATH$:LPRINT " ":LF'RINT "Scheduled project time is ";ST 1700 LPRINT "Time o-f critical path "LPRINT USING Có$CO: IF XX=0 THEN LPRINT "Z

";BB$;P:GOTO 1490 1710 IF OF'$="E" AND OF'$"e" THEN END 1720 IF OP$< >"D" AND OP$< :::"d" THEN 1770 1730 LINE INPUT "Name of disk:file ";X$:OPEN "O",l,X$ 1740 PRINT1,M/.,EE 1750 FOR 1=1 TO MXF'RINT1 ,CHR$(34) ;A$(I , 1) CHR$(34) ; ", ";CHR$(34) ;A$(I ,2);

CHR$ (34) ; A (1,1) A (1,2); A (1,3) ; A (1,4) ; A (1,5) NEXT I 1760 CLOSE #1: GOTO 1490 1770 SCREEN 0,0,0:WIDTH 80:COLOR 9,0,0:PRINT "ENDING...";:COLOR 7,0,0:

FOR 11 TO 1000:NEXT: KEY ON:END 1775 DATA 18,9 1780 DATA "A". 'ACCT. PAFERS",1,2,1,2,3 1790 DATA "Z","PERMITS", 2,7,4,5,8 1800 DATA "B", "SHOP BANKERS", 1,3.2,4,6 1810 DATA "C","SHOP REAL EST.,", 1,4,2,13,17 1820 DATA "D",'-MARKET STUDY", 2,3,2,4,5 1830 DATA "G","CONTRACTOR", 2,5,1.4,2.2--),6.7 1850 DATA "H","ART PLANS", 3,5,2,4,6

Page 34: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

1860 DATA "E" ,"COST STUDY', 3,4,3,4,5 1870 DATA "I", "LAND", 4,5,8,11,13 1880 DATA 'J", MATERIAL", 5,6,2,3,4 1890 DATA "I:::" ,"PLANS", 5,7,2,5,12 1900 DATA "L", 'SURVEY", 5,8,1,2,4 1910 DATA "M","BUY MAT #1", 6,8,2,3,4 1920 DATA "O',"BUY MAT *2', 6,9,1,2,5 1930 DATA "N","LAYOUT", 78,9,11,12 1940 DATA "F", "FOUNDATION' , 8,9,1,--,6 1950 DATA "Q","HIRE CREW 2', 7,9, 1,2,3 1960 DATA "F ,"INSURANCE", 2,6,.4,1.--,1.5 10000 REM This subroutine saves the cursor position as ONCE (Col or Y) 10010 REM and WAS (Row or X) , locates the cursor on the 25th status line 10020 REM gets an input value (string only) , and returns the cursor to 10030 REM where it ONCE WAS. 10040 REM Input Variables = MSG$;Output = ANSWER$ 10050 REM LGTH of desired ANSWER 10060 Store cursor position 10070 ONCE = CSRLIN 10080 WAS = FOB (0) 10085 ANSWER$="" 'empty the answer string 10090 ' Make sure softkeys are off, locate cursor on 25th line 10100 KEY OFF 10110 LOCATE 25,3 10120 ' Print the message the user requests and get an input 10130 PRINT MSG$; :ANSWER$=INF'UT$(LGTH) .10150 ' Clear off the line for future use 10160 LOCATE 25,1:F'RINT SF'C(79); 10170 ' Restore the cursor to where it was 10180 LOCATE ONCE, WAS 10190 RETURN 15000 REM This subroutine does some error-checking, for instance, for the 15010 REM open statement in line 390 15020 REM It requires a ON ERROR GOTO 15000 statement at front of program 15025 MISTEAK=0: WHER'EAT=O 15030 MISTEA}:: = ERR: WHER'EAT=ERL 15040 IF MISTEAK 55 THEN CLOSE:RESUME 15050 IF MISTEAK = 57 THEN F'RINTCAN'T FIND THAT FILE - CATALOG: ':COLOR 3:FRINT

"A:":FILES "A:*.*":COLOR 9:F'RINT "B:":FILES "B:*.*":PRINT:F'RINT"WAIT..,": FOR 1= 1 TO 7000:NEXT I:RESUME 13.0

15060 IF MISTEAK = 61 THEN F'RINT"DISK IS FULL - PLEASE GET ANOTHER:FOR 1=1 TO 3000:NEXT I:RESUME 1730

15070 IF MISTEAK = 64 THEN F'RINT"THAT'S NOT A GOOD FILE NAME-USE B:XXXXXXX.YYY": FOR 1=1 TO 3000:NEXT I:RESUME 130

15075 IF MISTEAK = 68 THEN PRINT "THAT DISK DOESN'T EXIST... USE A: OR B:": FOR 1=1 TO 3000:NEXT I: RESUME 130

15080 IF MISTEAK = 70 THEN PRINT "THE DISK IS WRITE-PROTECTED - CAN'T USE IT": FOR 1=1 TO 3000:NEXT I:RESUME 130

15090 IF MISTEA:: = 71 THEN PRINT "CLOSE THE DISK DOOR":FOR 11 TO 3000:NEXT I: RESUME 130 -

15100 IF MISTEAK =72 THEN PRINT "I THINK THE DISK IS BAD":TRIES=TRIES±l: IF TRIES<3 THEN RESUME ERL: ELSE PRINT "ENDING... CHECK DISK": FOR 1=1 TO 3000:NEXT I:GOTO 1770

15105 IF MISTEAK =67 THEN PRINT "YOU HAVE TOO MANY FILES OPEN AT ONE TIME": FOR 11 TO 3000:NEXT I: RESUME 130

15110 ON ERROR GOTO 0: RESUME 20000 REM This subroutine switches the active and visual pages in SCREEN 0

Page 35: USING PERT AT 5MIJ ON THE IBM MAINFRAME M. JONNA …s2.smu.edu/emis/design/wp-content/uploads/86-06-ibm_usingpert.pdfA Final PERT Program for IBM Mainframe 18 B Output File of PERT

20010 REM mode to page 1, thus allowing the programmer to put "help" 20020 REM material, ancillary input, or other messages on a "clean slate." I 20022 ONCE CSRLIN: WAS POS(0) 20025 ABORT = 0 20030 SCREEN 0,1,1,1 color burst, apage=1,vpage=1 00 CLS I 20035 KEY 1 ON 20037 ON KEY(1) GOSUB 22000 20040 LOCATE 25,1:COLOR 4: PRINT "Hit <Fl> key BEFORE entering to abort - Ill I WAIT before going on"; 20042 LOCATE 5,35: COLOR 3:PRINT "CHANGE ROUTINE":COLOR 9 20045 COLOR 9,8,0 20050 FOR 1=1 TO 5000:NEXT I

P

20070 RETURN 22000 CLS:SCREEN 0,1,0,0 22010 ABORT=1 I 22015 IF ABORT AND XCHECF( THEN M7=M7-1:NY.=N7.-1:XCHECK=0 22020 LOCATE ONCE,WAS 22030 RETURN :.0000 GOTO 20070

P30010 RETURN

34