BACK TO 100 examples in Business, Operations and Engineering.
Click Here

           Apply  Worldwide Now         

Do it once, do it right, and do it now.

Email Lawson Computing

Back to Lawson Computing Homepage

Apply as needed, when needed.


1 Identification Division.

2 Program-id. Property Tax

3 Author. Lance Lawson.

4 Environment Division.

5 Configuration Section.

6 Source-Computer. IBM.

7 Object-Computer. IBM.

8 Input-Output Section.

9 File-Control.

10 Select Tax-Assess-File assign to ut-s-sysin.

11 Select Print-File assign to ut-s-sysout.

12 Data Division.

13 File Section.

14 FD Tax-Assess-File

15 Label record is omitted.

16 01 Tax-Assess.

17 05 Filler Pic x(6).

18 05 Prop-type-in Pic x.

19 05 Filler Pic x(6).

20 05 Name-in Pic x(20).

21 05 Filler Pic x(15).

22 05 Home-type-in Pic x.

23 05 Filler Pic x.

24 05 Comm-type-in Pic x.

25 05 Parcel-no-in.

26 10 Parcel-1-in Pic x(5).

27 10 Parcel-2-in Pic x.

28 10 Parcel-3-in Pic x(3).

29 05 Value-in Pic 9(6)v99.

30 FD Print-File

31 Label record is omitted.

32 01 print-rec Pic x(133).

33 Working-Storage Section.

34 77 EOF-FLAG Pic x(3) value 'no'.

35 77 Prop-Tax Pic 9(7)v99 value 0.

36 77 Line-Ctr Pic 99 value 40.

37 77 HPR-Total Pic 9(7)v99 value 0.

38 77 HNR-Total Pic 9(7)v99 value 0.

39 77 Bldg-Total Pic 9(7)v99 value 0.

40 77 Land-Total Pic 9(7)v99 value 0.

41 77 End-Total Pic 9(8)v99 value 0.

42 77 Tax-Rate Pic v999 value 0.

43 77 Qtr Pic x(6).

44 77 Type-code Pic 9 value 0.

45 77 Desc-out Pic x(6).

46 77 Page-no Pic 999.

47 01 Date-x.

48 05 YY Pic 9999.

49 05 MM Pic 99.

50 05 DD Pic 99.

51 01 Report-Heading-A.

52 05 Filler Pic x value space.

53 05 Date-out Pic xx/xx/xx.

54 05 Filler Pic x(26) value spaces.

55 05 Filler Pic x(8) value 'Property'.

56 05 Filler Pic x value space.

57 05 Filler Pic x(3) value 'Tax'.

58 05 Filler Pic x value space.

59 05 Filler Pic x(10) value 'Assessment'.

60 05 Filler Pic x value space.

61 05 Filler Pic x(6) value 'Report'.

62 05 Filler Pic x(28) value spaces.

63 05 Filler Pic x(4) value 'Page'.

64 05 Page-no-in Pic 999 value 0.

65 01 Report-Heading-B.

66 05 Filler Pic x value space.

67 05 Filelr Pic x(42) value spaces.

68 05 Qtr-out Pic x(6).

69 05 Filler Pic x value space.

70 05 Filler Pic x(7) value 'Quarter'.

71 01 Field-Heading-A.

72 05 Filler Pic x value space.

73 05 Filler Pic x(6) value spaces.

74 05 Filler Pic x(8) value 'Property'.

75 05 Filler Pic x(13) value spaces.

76 05 Filler Pic x(6) value 'Parcel'.

77 05 Filler Pic x(15) value spaces.

78 05 Filler Pic x(8) value 'Property'.

79 05 Filler Pic x(14) value spaces.

80 05 Filler Pic x(10) value 'Assessment'.

81 05 Filler Pic x(4) value spaces.

82 05 Filler Pic x(3) value 'Tax'.

83 05 Filler Pic x(5) value spaces.

84 05 Filler Pic x(8) value 'Property'.

85 01 Field-Heading-B.

86 05 Filler Pic x value spaces.

87 05 Filler Pic x(7) value spaces.

88 05 Filler Pic x(5) value 'Owner'.

89 05 Filler Pic x(15) value spaces.

90 05 Filler Pic x(6) value 'Number'.

91 05 Filler Pic x(13) value spaces.

92 05 Filler Pic x(11) value 'Description'.

93 05 Filler Pic x(14) value spaces.

94 05 Filler Pic x(5) value 'Value'.

95 05 Filler Pic x(6) value spaces.

96 05 Filler Pic x(4) value 'Rate'.

97 05 Filler Pic x(6) value spaces.

98 05 Filler Pic x(3) value 'Tax'.

99 01 Data-Line.

100 05 Filler Pic x value space.

101 05 Name-out Pic x(20).

102 05 Filler Pic x(5) value spaces.

103 05 Parcel-1-out Pic x(5).

104 05 Filler Pic x value '-'.

105 05 Parcel-2-out Pic x.

106 05 Filler Pic x value '-'.

107 05 Parcel-3-out Pic x(3).

108 05 Filler Pic x(4) value spaces.

109 05 Prop-type-out Pic x(24).

110 05 Filler Pic x(4) value spaces.

111 05 Value-out Pic $$,$$$,$$$.99.

112 05 Filler Pic x(4) value spaces.

113 05 Tax-rate-out Pic 9.9.

114 05 Filler Pic x value '%'.

115 05 Filler Pic x(3) value spaces.

116 05 Prop-tax-out Pic $$,$$$,$$$.99.

117 01 Final-Total-Line-A.

118 05 Filler Pic x value spaces.

119 05 Filler Pic x(5) value 'Total'.

120 05 Filler Pic x value space.

121 05 Filler Pic x(8) value 'Property'.

122 05 Filler Pic x value space.

123 05 Filler Pic x(3) value 'Tax'.

124 05 Filler Pic x value space.

125 05 Filler Pic x(11) value 'Assessment'.

126 01 Final-Total-Line-B.

127 05 Filler Pic x value space.

128 05 Filler Pic x(4) value 'Home'.

129 05 Filler Pic x value space.

130 05 Filler Pic x value '-'.

131 05 Filler Pic x value space.

132 05 Filler Pic x(7) value 'Primary'.

133 05 Filler Pic x value space.

134 05 Filler Pic x(9) value 'Residence'.

135 05 Filler Pic x value space.

136 05 HPR-Total-out Pic zz,zzz,zzz.99.

137 01 Final-Total-Line-C.

138 05 Filler Pic x value space.

139 05 Filler Pic x(4) value 'Home'.

140 05 Filler Pic x value space.

141 05 Filler Pic x value '-'.

142 05 Filler Pic x value space.

143 05 Filler Pic x(13) value 'Non-Residence'.

144 05 Filler Pic x(5) value spaces.

145 05 HNR-Total-out Pic zz,zzz,zzz.99.

146 01 Final-Total-Line-D.

147 05 Filler Pic x value space.

148 05 Filler Pic x(10) value 'Commercial'.

149 05 Filler Pic x value space.

150 05 Filler Pic x(8) value 'Building'.

151 05 Filler Pic x(6) value spaces.

152 05 Bldg-Total-out Pic zz,zzz,zzz.99.

153 01 Final-Total-Line-E.

154 05 Filler Pic x value space.

155 05 Filler Pic x(10) value 'Commercial'.

156 05 Filler Pic x value space.

157 05 Filler Pic x(4) value 'Land'.

158 05 Filler Pic x(10) value spaces.

159 05 Land-Total-out Pic zz,zzz,zzz.99.

160 01 End-Total-Line.

161 05 Filler Pic x value space.

162 05 Filler Pic x(5) value 'Total'.

163 05 Filler Pic x value space.

164 05 Filler Pic x(3) value 'Tax'.

165 05 Filler Pic x value space.

166 05 Filler Pic x(10) value 'Assessment'.

167 05 Filler Pic x(4) value space.

168 05 End-Total-out Pic $$$,$$$,$$$.99.

169 Procedure Division.

170 Module-Initialize.

171 Open input Tax-Assess-File output Print-File.

172 Accept Date-x from Date.

173 Move Date-x to Date-out.

174 If MM < 4

175 Move 'First' to Qtr-out

176 Else

177 If MM < 7

178 Move 'Second' to Qtr-out

179 Else

180 If MM < 10

181 Move 'Third' to Qtr-out

182 Else

183 Move 'Fourth' to Qtr-out.

184 Move Report-Heading-A to print-rec.

185 Write print-rec.

186 Move Report-Heading-B to print-rec.

187 Write print-rec.

188 Move spaces to print-rec.

189 Write print-rec.

190 Move Field-Heading-A to print-rec.

191 Write print-rec.

192 Move Field-Heading-B to print-rec.

193 Write print-rec.

194 Move spaces to print-rec.

195 Write print-rec.

196 Move 1 to Page-no.

197 Move 40 to Line-ctr.

198 Read Tax-Assess-File at end move 'yes' to EOF-FLAG.

199 If EOF-FLAG = 'no'

200 Perform Process-Data until EOF-FLAG = 'yes'.

201 Module-Terminate.

202 Move Prop-type-in to Prop-type-out.

203 Move Name-in to Name-out.

204 Move Parcel-1-in to Parcel-1-out.

205 Move Parcel-2-in to Parcel-2-out.

206 Move Parcel-3-in to Parcel-3-out.

207 Move Value-in to Value-out.

208 Move Prop-tax to Prop-tax-out.

209 Move HPR-Total to HPR-Total-out.

210 Move HNR-Total to HNR-Total-out.

211 Move Bldg-Total to Bldg-Total-out.

212 Move Land-Total to Land-Total-out.

213 Move End-Total to End-Total-out.

214 Move Tax-Rate to Tax-Rate-out.

215 Move Final-Total-Line-A to print-rec.

216 Write print-rec.

217 Move spaces to print-rec.

218 Write print-rec.

219 Move Final-Total-Line-B to print-rec.

220 Write print-rec.

221 Move Final-Total-Line-C to print-rec.

222 Write print-rec.

223 Move Final-Total-Line-D to print-rec.

224 Write print-rec.

225 Move Final-Total-Line-E to print-rec.

226 Write print-rec.

227 Move spaces to print-rec.

228 Write print-rec.

229 Move End-Total-Line to print-rec.

230 Write print-rec.

231 Process-Data.

232 If Line-ctr = 40

233 Perform Heading-Routine.

234 If Prop-type-in = 1

235 If Home-Type-in = 1

236 Move 1 to Type-code

237 If Value-in > 150000

238 Move .02 to Tax-rate

239 Else

240 Move .014 to Tax-rate

241 Else

242 Move 2 to Type-Code

243 If Value-in > 95000

244 Move .02 to Tax-rate

245 Else

246 Move .014 to Tax-rate.

247 If Prop-type-in = 2

248 If Comm-Type-in = 1

249 Move 3 to Type-code

250 If Value-in > 200000

251 Move .025 to Tax-rate

252 Else

253 Move .02 to Tax-rate

254 Else

255 Move 4 to Type-code

256 If Value-in > 60000

257 Move .025 to Tax-rate

258 Else

259 Move .02 to Tax-rate.

260 Compute Tax-rate = Value-in * Tax-rate.

261 Multiply Tax-rate by 100 giving Tax-rate-out.

262 If Type-code = 1

263 Add Tax-rate to HPR-Total.

264 If Type-code = 2

265 Add Tax-rate to HNR-Total.

266 If Type-code = 3

267 Add Tax-rate to Bldg-Total.

268 If Type-code = 4

269 Add Tax-rate to Land-Total.

270 Add Tax-rate to End-Total.

271 Add 1 to Line-ctr.

272 If Type-code = 1

273 Move 'Home-Primary Residence' to Desc-out.

274 If Type-code = 2

275 Move 'Home Non-Residence' to Desc-out.

276 If Type-code = 3

277 Move 'Commercial Building' to Desc-out.

278 If Type-code = 4

279 Move 'Commercial Land' to Desc-out.

280 Heading-Routine.

281 Move Report-Heading-A to print-rec.

282 Write print-rec after advancing page.

283 Move Report-Heading-B to print-rec.

284 Write print-rec.

285 Move Field-Heading-A to print-rec.

286 Write print-rec after advancing 2 lines.

287 Move Field-Heading-B to print-rec.

288 Write print-rec.

289 Move spaces to print-rec.

290 Write print-rec.

291 Add 1 to Page-no.

292 Move 0 to Line-ctr.

293 Read Tax-Assess-File at end move 'yes' to EOF-FLAG.

Segment Table

Segment Number Length Name

C00 05 08AB LAB5$C00

D00 06 0643 LAB5$D00

Realia COBOL Compiler Version Information

Pass 1 Version 4.012

Pass 1a Version 4.002

Pass 2 Version 4.009

Pass 2a Version 4.004

Pass 3 Version 4.066

Pass 4 Version 4.019



Compilation Directives in Effect
























 Source lines compiled: 293

Compilation time (mm:ss.hh): 0:00.44

Compilation date (yy/mm/dd): 96/11/10

Compilation speed (lines/minute): 39954


Source length in LST file:000015064


COBOL Lance Lawson

True- False

1. COBOL program will run correctly without syntax errors.

According to the computer. Logic errors are still possible. T

Must COBOL programs be compiled ?

To execute, yes. Y

Can COBOL be used in scientific problems.

In a limited degree, more likely another program will be used. F

Correct sequence of divisions are…

Identification, Environment, Data, Procedure. Book is F

Division that specifies the "computer devices to be used" is the Environment division. Book is F

The division that requires the least programming seems to be the Identification division. T

Instructions are coded in the Procedure division. True

If 1370 is read into field, with a picture clause of 99V99 it will be stored as 13^70. F

If above was moved to output area, it would be printed as 13.70. T

Fields defined in "working-storage" can be given initial values. T


General Questions.

Define following.

1. Program Set of instructions for the computer to follow to process data.

Compiler Symbolic language translated to Machine Language. Compiler does that.

Source program Programmer writes this in symbolic language.

Object program Computer compiles this into an "object program".

2. Difference between symbolic and machine language.

The computer needs machine language to operate, but this is to "complicated" to use to write programs.

The symbolic language makes these commands more "human responsive" and lets different programs specialize toward different areas of specialization. Biz, Engineering etc…….

Why is COBOL so popular.

Business oriented, English commands, Standard language, machine-independent, user friendly.

What is Structured programming ?

Top-Down approach, = main modules first.GOTO-less, Programming is easier to do, follow, debug, modify.

ANS COBOL means what?

ANSI is an organization which sets standards so consistency follows in fabrication of processes.

Difference in operating system software and application software.

Operating software is used by the computer to operate and application software is a specific application. ~ Lotus 1-2-3, excel etc…….

A syntax error is a typing error or actually any error which the computer cannot operate on.

The picture clause states the size and type of data to be entered into a field.

The Select statement is in the File-Control paragraph of the environment division that is used to assign an input or output file to a specific device.

The working storage section is a section of the data division that contains the required data for processing, that is not part of the input or output.


Chapter 2

T-F questions.

Best to code one statement per line., Yes , easier to debug and follow. T

Author is not required in program. F

File 12 is not a valid file name because there is a blank which is not allowed. F

Division name must appear as an independent item on a separate line. T

Information supplied in the identification division does not state the nature of the program by much. F

Date compiled is a paragraph name which does not require an entry. T

Every period in a COBOL program Must be followed by at least one space. T

The installation paragraph is (really not) restricted to one line. F

The input output section of the environment division assigns file names. T

File control is a required entry in the Environment division. T

A file name is an example of a user defined word. T

A maximum of three files may be defined in the Input-Output Section. F

General Questions.

The lines need a period at the end of first line and after program I-D in the second line.

The configuration section should start at the beginning and not be indented.

Program ID should be first. The sequence is out of the correct order.

Should not all be on one line. Data division should be on line by itself.

Should be a period at end on fine 1.

Should be a period at end of the final line.

Select file A should be select file-A. a hyphen should be used.

2nd line should be indented with a period at end of line.

Following entries are coded in area A. Divisions, Sections, Paragraphs. a, b,c,d,f,g,h,i.

Why will author though security not be included in next ANS version. Other methods will be available.

Chap 3 True-False

A file is a collection of records , and records are a collection of fields. T

Picture clauses are not specified on the group level, used only for elementary fields. T

Numerical literals may contain 30 characters. F, 18 max F

Numeric literals may contain +,- but not a comma or $. T

Data name or identifier may not exceed 30 characters. T

6. MOVE SPACES TO CODE-OUT is valid regardless of the size of CODE-OUT, if non-numeric field. T

7. Order of fields not important in a record description. F

8. Levels 3, 8, 75 may be used to define fields within records. 75,not F

9. Fields not part of input-output are coded in working storage which follows file section in data division. T

Record names are defined in the Environment Division. DATA Div. F

State the contents of FIELDA after the following moves.

MOVE ‘ABC’. Literal

MOVE ABC. Data name

MOVE ‘SPACES’. Reserved Word

MOVE SPACES Blanks being placed in the CODE-OUT area.

Which following entries should be placed in coded area A.




Chap 4


Files must be opened first to read. T

A simple PERFORM 300-CHECK-RTN will execute. T

COBOL paragraphs end with a period. T

Each module has a paragraph name. T

PERFORM…UNTIL will go continuously until condition. T

The DATA name ARE-THERE-MORE-RECORDS must be defined in the FILE SECTION F


200-CALC-RTN usually in a WRITE statement. F

STOP RUN is the last instruction. T

Paragraph name can be all numbers, but best to be descriptive. T

General questions.

Indicate DIVISION each is coded.

DATE-COMPILED Identification Division. State Date.

WORKING-STORAGE DATA Division. To set value..

Paragraph-name Procedure Division. For purpose of module.

Configuration Section Environment Division Set up hardware.

FD DATA division File name.

Level numbers Procedure Division To describe fields in record.

LABEL records Procedure Division. Optional, read & write of records.

FILE SECTION. DATA division Defines all files.

Select Environment Division Assigning files to devices.

Author ID section State name of programmer.

STOP-RUN Procedure Division Tells computer to terminate.

AT END clause Procedure Division Any more input?

VALUE DATA division To give values to entities.

PICTURE DATA division Elementary fields/items not subdivided.

FILE-CONTROL Environment Division For input-output section.

OPEN Procedure Division Open files.

When READ is used, how does computer know which unit to use. File name is specified.

Why OPEN and CLOSE files. To deactivate the devices and release the space (memory).

When do we use VALUE clauses. To set values for otherwise a blank or default valued area.

Invalid paragraph names. INPUT-RTN,system usage. / MOVE, system./ %-RTN , system usage also.

If read is used in a sequential file, what clause is used. To ensure integrity of the program by checking.


Ch 5.


Does the flowchart and pseudocode do the same thing.

The two are switched or reversed.

The two are in agreement.

The two are in agreement.

Is the flowchart drawn correctly. No, the branching should go to a "connector"

Draw flowcharts


Meaning of each of the following.

[ ] The clause or paragraph is optional.

{ } One of the enclosed items ie Required.

upper case words. COBOL reserved words, special meaning to compiler.

lower case words. These are user defined entries.

underline words These are required in a paragraph.

f. ellipses Additional entries of the same type may be included if desired.































COBOL Lance Lawson

 Name the four divisions of a COBOL program and briefly explain the purpose of each. ~ 2 sentences.


Name the six language elements and give an example of each.


Given a COBOL entry line, identify each of the language elements. Given in class.


Given an identification division with errors, rewrite making all corrections.


List the rules for forming data names.


List the rules for forming procedure names.


List the rules for forming numeric literals.


List the rules for forming non-numeric literals.


9. What is the purpose of the COBOL compiler.


 What is the purpose of the linker.


11.Fill in the major divisions and sections of the COBOL program (OUTLINE FORMAT)

EX..___________ DIVISION ________________ SECTION


what entries are coded in the A margin.


Given a lab spec sheet, write the COBOL (describe w/ level #, data names, pic ) record description.


What is the purpose of the pseudo code narrative.


Given a picture, fill in the result column.

Sending item. Pic of recieving item. Result.


What is the purpose of the working storage section.


List the 6 different steps involved in programming.


List the items in a documentation package.


List one advantage of the COBOL programming language.


Given specs like lab 3, do the IPO chart, hierarchy charts, and pseudo code narrative.




Name four COBOL divisions and list purpose.

Identification Division

Documentation purposes

Environment Division

Information on equipment used with program

Data Division

Defines data to be used in program

Procedure Division

instructions to be executed


Name 6 language elements and give example

Reserved words used by COBOL

Programmer supplied names. Employee-File

Literals. Numeric and non-numeric

Level # 1, 5, 10

Pictures shows size and type of data pic x(11)

symbols . (period) non-reserved words.


Identify each language element in a given COBOL entry.





Given Identification Division w/ errors write correction.

Given Corrected

Identification Division Identification Division.

Author John Smith Program-ID. LAB0.

Program ID lab0 Author. John Smith.


Rules for Data Names.

1-30 characters

Letters, digits, hypens ok (not 1st or last however)

May not be a COBOL reserved word.

No embedded blanks

At least one letter.


Rules for Procedure Names.

1-30 characters

Letters, digits, hypens ok (not 1st or last however)

May not be a COBOL reserved word.

No embedded blanks SAME as Data Names except

does not require at least one letter.


Rules for Numeric Literals

1-18 digits

+ or - must be left most, digits ok.






Rules for non-Numeric literals

1-160 characters spaces ok

Any characters except quotes.

Must be in Quotes


Purpose of COBOL compiler

Converts Source program to Object program.


Purpose of the Linker

Link object language to executable language. Make data available for operation.


Complete an outline of a COBOL program.

Identification Division

Environment Division



Data Division

File Section

Working Storage

Procedure Division


List COBOL entries coded in A margin.



Paragraph names

Zero-one level ?


Given Input-Output specification write COBOL Record decription.

FD Accounts-File

Label Record is omitted.

01 Accounts-Rec

05 filler pic x (10)

05 cust-no-in pic 999

05 cust-name-in pic x(20)

05 filler pic x(20)

05 sales-amt-in pic 9(4)v99.

05 filler pic x(21)


List the three design tools and describe them.

Hierarchy Chart. Used to show top-down logic. Diagram

IPO chart. Further Describes modules by describing input, processing and output. IN class)

pseudocode. Uses English like expressions (instead of diagrams) to show logic.









Given sending item, pic of receiving item, fill in the result.

Sending Item Pic of receiving Result

0001 V9999 1.000

0001 ZZZZ +bbb1

0000 $$$$$.99 $.00

0001 X 0

George 9(6)

275 9.99 275.00

275 -999 275


List steps involved in programming.

define problem

design solution

code program

compile-debug program

Test and execute program

Document program


Purpose of Working Storage section.

Contains data necessary for processing. (not I/O)


Name 5 categories of DATA.





alpha-numeric edited.


Purpose of the label record clause.

Create header and trailer labels which ID the file and verifies the correct file.


Rewrite ( X=(a+b)^2/C)



Given set of math statements w/initial values, show results.

05 ctr-1 pic 9V9 value 1.5

05 ctr-1 pic 99 value 0

add .4 to ctr-1 rounded

add ctr-1 to ctr-2


ctr-1 = 1.9

ctr-2 = 01


Given set of COBOL specification write


Hierarchy Chart

Initialize Process data Terminate

open files, read 1st, print heading Perform, fill data line, write data line, read next close, stop



Total sales, Monthy sales average

 IPO chart

 Input Process Output

Sales file 1. Initialize Sales List

datset file 2. Process data




1st Record 1. Open files Field headings

of sales file 2. Read 1st record

Print field headings


Process Data

Sales File 1. Calculate total sales Sales Line

Calculate average sales

Fill Data line

Write data line

Read Next Record



No input 1. Close files No Output




Pesudocode narrative



Open files

Read record at end move "yes" to eof-flag

Print field headings

If eof-flag = "no"

Perform process-data until EOF-Flag = "yes"


Close files


Process Data

Add previous sales current sales giving total pay

Divide months emp into total sales giving sales average

move slsman-no-in, name-in, previous-sles-in

curnt-sles-in, total-sales, mnths-emp into dataline

write data-line

read record at end move "yes" to eof-flag.