Directory UMM :wiley:Public:college:cobol:

��#ࡱ#�################>###��
#####################################����############������������������������������
����������������������������������������������������������������������������������
����������������������������������������������������������������������������������
����������������������������������������������������������������������������������
����������������������������������������������������������������������������������
�����������������������������������������������������������������������###�###�###
�###�###�###�###�###�###�###�###�###�###�###�###�###�###�###�###�###�###�###�###�##
#�###�###�###�###�###�����###�###�###�###�###�###�###�###�###�###�###�###�###�###�#
##�###�###������������������������������������������������������������������������
����������������������������������������������������������������������������������
����������������������������������������������������������������������������������
����������������������������������������������������������������������������������
�������
�#####E###�#1#�/##f#�#(###(###y###[###########�#########################�##�
###��#�###�#�#��##���#���###�##�###��#�###�#�#��##���#`````````````````````````````
````````````````````````````````###################################################
#############.h#`````````````````````````````````````````````````````````````#

############################################################


```�````````````````````````````````````````````````````````l

###f#####################################################"##R#o#o#t#
#E#n#t#r#y#################################################��������################
################�۸/0�#####�#######O#b#j#e#c#t#1####################################
###############################&#######�######F####�"�&0�#���&0�###############O#l#
e#########################################################
###������������##################################################C#o#m#p#O#b#j#####
########################################################����#######################
#################l#######���########����###�����####### ###
#######

############################################################################## ###!
###"#######$###%###&###'###(###)###*###+###,######.###/###0###1###2###3###4###5###6###7###8###9###:###;######?
###@###A###B###C###D###E###F###G###H###I###J###K###L###M###N###O###P###Q###R###S###
T###U###V###W###X###Y###Z###[###\###]###^###_###`###a###b###c###d###e###f###g###h##
#i###j###k###l###m###n###o###p###q###r###s###t###u###v###w###x###y###z###{###|
###}###~###ࡱ###�#####O#l#e#1#0#N#a#t#i#v#e#########################################
####������������########################################$#######P#P#4#0############
#############################################

###������������########################################�/########S#u#m#m#a#r#y#I#n#
f#o#r#m#a#t#i#o#n###########################(#######��������#######################
#############�###�#######C#u#r#r#e#n#t#
#I#D#################################################������������##################
##############################################����####�����������������������������
����������������������������������������������������������������������������������
����������������������������������������������������������������������������������
����������������������������������������������������������������������������������
����������������������������������������������������������������������������������
����������������������������������������������������������������������������������
�������������������������������������������������
###���###Cartoons#C:\MSOFFICE\CLIPART\PCSFILES\CARTOONS.PCS########################
###################################################################################
#################################################################PS################
##########################################��#ࡱ#�################>#####��#
##����&#######�######F####Microsoft ClipArt
Gallery#####MS_ClipArt_Gallery#####MS_ClipArt_Gallery#####��#ࡱ#�###################
#############��#ࡱ#�################>###��
###############t#```��f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�```h#8###
#hfffffffffffffffffffffffffffffffffffffffffffffffffffff

####�#```�o�o�����f�f�f�f�f�f�f�o��f�f�f�f�f�f�f�f�f�f�f�f�f```n#8####jffffffffffff
fffffffffffffffffffffffffffffffffffffffff
####8#```��f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�```g#�####hfffffffff
ffffffffffffffffffffffffffffffffffffffffffff
####8#```�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f```h#8####jfffffffff
ffffffffffffffffffffffffffffffffffffffffffff"####�#```��f�f������f�f�f�f�f�f�f�f�f�
f�f�f�f�f�f�f�f�f�f�f�f�```h#8####hffffffffffffffffffffffffffffffffffffffffffffffff
fffff ##
#z#```�f�f�o����o�o����o����o�������������������f�f�f�f````#C####jffffffffffffffff
fffffffffffffffffffffffffffffffffffff ##
#6#```��f�f����������������o�������������o�����f�f�f�````#�####hffffffffffffffffff
fffffffffffffffffffffffffffffffffff ##
#�#```�f�f�o�����������������������o��������o��f�f�f�f```l

###jfffffffffffffffffffffffffffffffffffffffffffffffffffff"###444b`b��f�f�����������
�������o����������������f�f�f�```l

###hfffffffffffffffffffffffffffffffffffffffffffffffffffff ##

```�f�f�f�������������f��������������������f�f�f�f�f```l


###jfffffffffffffffffffffffffffffffffffffffffffffffffffff ##

b`b��f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�```l

###hfffffffffffffffffffffffffffffffffffffffffffffffffffff ##

```�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f```l

###jfffffffffffffffff�fffffffffffffffffffffffffffffffffff"##

f`f��f�f�f�o�o�o�f���o��o����o�f���o��o���f�f�f�f�```l

###hfffffffooo�o��oo�f��o����oo����of��o������ffffffff
###344`b`�f�f�f�f�o�f�f�f�o�f�o�f�f�f�f�f�o��f�f�f�f�f�f�f�f�f```l

###jfffffffffffffffffffff�fffffffffffffffffffffffffffffff ##

f`f��f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�```l


###hfffffffffffffffffo��oo����o��oo��offffffffffffffffff ##

bf`�f�f�f�f�f�f�f�f�f�f�������o�������f�f�f�f�f�f�f�f�f```l

###jfffffffffffffffffo��fofff�o�f�offffffffffffffffffffff"##

fbf��f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�```l

###hfffffffffffffffffffffffffffffffffffffffffffffffffffff ##

`fb�f�f�f�f�f�f�f�f�f�f�f�f��f�f�f�f�f�f�f�f�f�f�f�f�f�f```l

###jffffffffffffffffffff���oo����offfffffffffffffffffff
###444fff��f�f�f�f�f�f�f�f�f�f��o�������f�f�f�f�f�f�f�f�f�f�```l

###hffffffffffffffffffff��fffffff��ffffffffffffffffffffff ##

ffb�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f��f�f�f�f�f�f�f�f�f�f�f```l

###jfffffffffffffffffffffffffffffffffffffffffffffffffffff"##


fff��f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�```l

##&hfffffffffffffffffffffffffffffff�ffffffo�fffffffffffff ##

bff�f�f�f�f�f�f�f����������o�f���f����o�f�f�f�f�f�f�f```l

###jfffffffffffoo�of�ofo��������f�o���o��ffffffffffff ##

fff��f�f�f�f�f�f���f�f�o�f�f�f�f�f�f��f�f�f�f�f�f�f�f�f�```l

f#&hffffffffffffffffffffffffffffffffffff�ffffffffffffffff
###344fff�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f```l

#&#jffffffffffffffffff���ooof��o������ffffffffffffffffff"##

fff��f�f�f�f�f�f�f�f�f�o�����f������f�f�f�f�f�f�f�f�f�```l

&#fhffffffffffffffffff��f�ffofo�o��ffffffffffffffffffffff ###


fff�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f```l

#&#jfffffffffffffffffffffffffffffffffffffffffffffffffffff ##

#

fff��f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�```l

f&fhffffffffffffffffffffffffffffffffffoffffffffffffffffff ##

fff�f�f�f�f�f�f�f�f�o���o��f���������f�f�f�f�f�f�f�f�f```l

#f#jffffffffffffffffo���oo�of��������fffffffffffffffff"###444fff��f�f�f�f�f�f�f�f�f
�o�o�f���f�f�f�f�f�f�f�f�f�f�f�f�f�```l

f&fhffffffffffffffffffff�ffffffffffffffffffffffffffffffff ##

fff�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f```l

&f&jffffffffffffffffffff�o��f�o��oooffffffffffffffffffff ###


�ff��f�f�f�f�f�f�f�f�f�f�����f���o�f�f�f�f�f�f�f�f�f�f�```l

fffhffffffffffffffffffffoofffffo��fffffffffffffffffffffff ####

fff�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f```l

&f&jfffffffffffffffffffffffffffffffffffffffffffffffffffff"##

ff���f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�```l

fffhffffffffffffffffffffo�fffffffffffffffffffffffffffffff
###344fff�f�f�f�f�f�f�f�f�f�o����������o�f�f�f�f�f�f�f�f�f�f```l

fffjffffffffffffffffffoo�������o���fffffffffffffffffff ##

�f���f�f�f�f�f�f�f�f�f���f�o�f�f�o�f�f�f�f�f�f�f�f�f�f�f�```l

#fffhffffffffffffffffffffffffffff�ffffffffffffffffffffffff ###


f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f���f�f�f�f�f���f�f```l

fffjffffo���o��o���o��f���o�o�o�foof����o��������o�ffff"###

�f���f�f�o��o�o�o�o���o�o���o�o�f�o�������o��o�f�f�```l

fffhffffo��o�o�o���ofof�o��ooffo�o�o����o���o�ffff ##

fff�f�f�o�f�f�f�f�f�f����o�o�o�f��f�f�f�f�f�f�f�f�f�f```l

fffjfffffffffffffffffffffffffffffffffffffffffffffffffffff
###444�f���f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�```l

fffnffffffffffffffffffffffffffffffffffffffffffffffffffffn ##

f�f����������������������������```l##

fff�������������������������������������������������������###

�f�f�f�f�f�f�f�ffffffffffffffffffbfff`f`f`b`b```````````````l


fffffffffffffffff&f&f&f#&#f###&##############################

fff�fff�fff�ffffffffffffffffbfff`fbf`b`b````````````````````l

ffffffffffffff&f&&#f#&#&#&##################################

�f�f�f�f�f�f�fff�ffffffffffffffbfffbf`f`f`b`b```````````````l

t###�#&##�##�-&#####��&#####��&##4##��&##&##��,##"##�#-#####�)-##@##�A-#####��#####��-##,##��##&##��.##"##��.#####��.##@##�/#####�M/#####�M/#################################A#######
########b###############1############### #################Z#############T#
###K######0##d#######R###T# ###K######0##d#######Z###T# ###K######0##d#######�###T#
###K######0##d#############################################,##+####################
##################����####

#########AGg�#� ��############�##�#OG##a#0�@�@#
�############�##�#OG�#########�#####3##�##j�]�###���####��#####��#��d#########d#2##
#########Control Break Processing

#################,##########################��#��d#########d#2#######r##�##��0�M

���,###��#####��#��d#########d#########
###CHAPTER 10

#
#########
#####,###########
#########
####��#��d#########d#######################����######�###
###�##+####

###

###############L#################����####

#########AGg�#� ��############�##�#OG# A�g�p�
�#############�##�#OG####�###########r##�##��0�M
���,###��#####��#��d#########d#########
###OBJECTIVES

#
#########
#####,###########
#########
####��#��d#########d#########2##�##���M
s#��####��####U�
#��K#########d#########�###To familiarize you with1. The main types of computergenerated reports.2. The techniques used for efficient printing of group reports
and control totals.3. Control break processing and control break printing.�

#�#########�#################�#############U# ###K#########d#######1###U#
###K#########d#######S###U# ###K#########d#######7###U#
###K#########d#################################################################
U#################����####

#########AG��#� ��############�##T#�=# A����
�#############�##�#�=####�###########r##�##��@�}
���,###��#####��#��d#########d#############CONTENTS

#################,##########################��#��d#########d#########2##�##���}
�#��####��####U�n#��A#########d#########^###An Introduction to Control Break
ProcessingTypes of Reports: A Systems OverviewAn Example of a Control Break
ProcedureProgram Requirements for Control Break ProcessingA Single-Level Control
BreakRefinements to Improve the Quality of a Control Break ReportSummary of a
Single-Level Control Break ProcedureSelf-TestMultiple-Level Control Breaks

#^#########^#################^#####
###,###U#n###A#########d#######
%###U#�###A#########d#######(###U#�###A#########d#######2###U#n###A#########d######
#####U#�###A#########d#######=###U#�###A#########d#######2###U#�###A#########d#####
##
###U#�###A#########d###########U#n###A#########d###################################
##########�#�>######################################����####

#########AG#�S�
##�############�##�#g@################r##�##Q�p��##���,###��#####��#��d#########d##
#######+###An Introduction to Control Break Processing�

#+#########+#####,###########+#########+####��#��d#########d#######
###############��#�######�###########�#�>####!
###############O#################����####

#########AGg�3� #�############�##�#g@################r##�##��P�M
���$###��#####��#��d#########d#########$###Types of Reports: A Systems Overview

#$#########$#####$###########$#########$####��#��d#########d#######'###$###########
���######�###%###&###�#�>####(###############P#################����####

#########AGg�S� #�############�##d#�=# A�g�#�
0#############�##�#�=####�###########r##�##��p�M
#��,###��#####��#��d#########d#############Detail or Transaction Reports-

#################,##########################��#��d#########d#########2##�##��-�M
##############U# ###K#########d#########�###Detail or transaction reports are
those that include one or more lines of output for each input record read. Customer
bills generated from a master accounts receivable file would be an example of a
transaction or detail report. Similarly, payroll checks generated from a master
payroll file would be a detail report. Finally, a listing of each part number
stocked by a company would be a detail report.

#�#########�#################�#########n###U# ###K#########d#######x###U#
###K#########d#######Z###U# ###K#########d#######V###U#
###K#########d#######.###+#########################,######\#�>*###/#################################����####

#########AGg�#� ��############�##d#�=# A�g�p�
�#############�##T#�=####�###########r##�##��0�M
���,###��#####��#��d#########d#############Detail or Transaction Reports#

#################,##########################��#��d#########d#########2##�##���M
s#############U# ###K#########d############U# ###K#########d#######E###U#
###K#########d#######�###ࡱ#########################�###�###~###�###############
##################����####

#########AG����� ��############�##�##+# A�7�#�W
0#############�##L#�E####�###########r##�###�#�
���####��#####��#��d#########d#############200-DETAIL-RTN#Program Excerpt

#################$###############,##########################################��#��d#
########d#########2##�##q�-�# ##��####��#####� #��d#########d#########�###200DETAIL-RTN.EVALUATE TRUEWHEN FIRST-RECORD = 'YES'MOVE DEPT-IN TO WS-HOLD-DEPTMOVE
'NO ' TO FIRST-RECORDWHEN DEPT-IN NOT = WS-HOLD-DEPTPERFORM 300-CONTROL-BREAKENDEVALUATEIF WS-LINE-CT > 25PERFORM 400-HEADING-RTNEND-IF#

#�#########�#################�#############U# ###K#########d#############
#��d#########d############# #��d#########d############# #��d#########d#############
#��d#########d####### ##### #��d#########d############# #��d#########d############
#��d#########d############# #��d#########d############# #��d#########d#############
#��d#########d#######�###�#########################�###�###�#�>�###�###############
##################����####

#########AGg�#� ��############�##�##+# A�g�p�
�#############�##l#�=####�###IL######r##�##��0�M
���####��#####��#��d#########d#########*###200-DETAIL-RTN#Program Excerpt
(continued)

#*###############$###########################*#########*####��#��d#########d#######
##2##�##���M s#��####��#####� #��d#########d#########�###200-DETAIL-RTN.
MOVE
DEPT-IN TO DL-DEPT-OUTMOVE SLSNO-IN TO DL-SLSNO-OUTMOVE AMT-OF-SALES-IN TODL-AMTOF-SALES-OUTWRITE PRINT-REC FROM DETAIL-LINEAFTER ADVANCING 2 LINESADD 1 TO WSLINE-CTADD AMT-OF-SALES-IN TO WS-DEPT-TOTAL.

#�#########�#################�#####
######### #��d#########d#############
#��d#########d############# #��d#########d############# #��d#########d#############
#��d#########d#######!##### #��d#########d############# #��d#########d#############
#��d#########d#######&#####
#��d#########d#######�###�#########################�###�###�
�>�###�###############X#################����####

#########AGg�#� ��############�##�
g@# A�g�p�
�#############�##�#g@####�###########r##�##��0�M
���,###��#####��#��d#########d#############300-CONTROL-BREAK

#################,##########################��#��d#########d#########2##�##���M
s#��####��####U� #��K#########d#########�###In the 300-CONTROL-BREAK module we
print a summary line after a record is read that has a different department number
than the one stored at WS-HOLD-DEPT.
300-CONTROL-BREAK is performed when an input record's DEPT-IN, the control field,
differs from the one stored at WS-HOLD-DEPT. �

#�#########�#################�#########�###U# ###K#########d#######�###U#
###K#########d#######�###�#########################�###�###L
�>�###�#################################����####

#########AG7�C�W #�############�##�#g@# A�g�p� �#############�##$
g@####�###########r##�##q�`�#
���####��#####��#��d#########d#########>###300CONTROL-BREAK##When there is a change in DEPT-IN, we must:

#>###############$##########################>#########>####��#��d#########d#########2##�##���M
s#��####��####U� #��K#########d#########(###1. Print a line with the department
total accumulated for the previous DEPT-IN control group, which is stored in WSDEPT-TOTAL.2. Reinitialize WS-DEPT-TOTAL, the control total, so that the next
department's total begins at zero before any amounts for the new control group have
been accumulated.3. Move the current DEPT-IN to WS-HOLD-DEPT so that we can compare
succeeding input records to this new DEPT-IN control field.4. Return to 200-DETAILRTN and process the current record by printing a detail line and adding the amount
to the control total.

#(#########(#################(#########�###U# ###K#########d#######�###U#
###K#########d#######ࡱ###U# ###K#########d#######�###U#
###K#########d#######�###�#########################�###�###�
�>�###�#################################����####

#########AGg�#� ��############�##�##+# A�g�p� �#############�###
�=####�###########r##�##��0�M
���####��#####��#��d#########d#########!###300CONTROL-BREAK#Program Excerpt3

#!###############$###############,###########################!#########!
####��#��d#########d#########2##�##���M
s#��####��#####�
#��d#########d#########�###300-CONTROL-BREAK.MOVE WS-DEPT-TOTAL TO DEPT-TOTAL-OUT
WRITE PRINT-REC FROM GROUP-RECAFTER ADVANCING 2 LINESADD 1 TO WS-LINE-CTMOVE ZEROS
TO WS-DEPT-TOTALMOVE DEPT-IN TO WS-HOLD-DEPT.#

#�#########�#################�#############U# ###K#########d#######&#####
#��d#########d############# #��d#########d############# #��d#########d#############
#��d#########d############# #��d#########d#############
#��d#########d#######�###�#########################�###�###�#�>�###�###############
##################����####

#########AGg�#�

��############�##�##+# A�g�p�

�#############�###

�=####�###########r##�##��0�M
���$###��#####��#��d#########d#########7###Forcing
a Control Break When There Are No More Records y

#7#########7#####$###########7#########7####��#��d#########d#########2##�##���M
s#��####��####U�n#��K#########d#########7###Control break printing of totals
occurs when:A record with a new control field is read. The total for the last group
of records, then, will have been accumulated when ARE-THERE-MORE-RECORDS is equal
to 'NO '.A control total will not have been printed since there is no subsequent
record to trigger a change. #

#7#########7#################7#########.###U#
###K#########d#######,###U#n###K#########d#######y###U#n###K#########d#######d###U#
n###K#########d#######�###�#########################�###�###\

�>�###�#################################����####

#########AGg��

��############�##�#�=# A�g��

�#############�##�

�=####�###########r##�##����M
f��$###��#####��#��d#########d#########6###Forcing
a Control Break When There Are No More Records

#6#########6#####$###########6#########6####��#��d#########d##### ###2##�##����M
�#��####��####U� #��K#########d#############DEPT
0101--01 totals are
printed when 02 is read
0202--02 totals are printed when 03 is read
0303(no more records)At this point, the printing of 03 totals must be ``forced''
after ARE-THERE-MORE-RECORDS is set equal to 'NO '

###########################################U# ###K#########d#######
###U# ###K#########d############# #��d#########d#######,##### #��d#########d#######
###U# ###K#########d############# #��d#########d#######,##### #��d#########d#######
###U# ###K#########d############# #��d#########d###########U#
###K#########d#######n###U#
###K#########d#######�###�#########################�###�###

�>�###�#########7#######################����####

#########A�#�@�0 `#############�####g@##AGg�#�

��############�##�

g@####�###########r##�##��0�M
���$###��#####��#��d#########d#########6###Forcing
a Control Break When There Are No More Records

#6#########6#####$###########6#########6####��#��d#########d#####!
###2##�##J�]��#C#��####��####U�n#��K#########d#########%###We need to include a
procedure to print the 03 totals. In the main module, after 200-DETAIL-RTN has been
repeatedly executed and ARE-THERE-MORE-RECORDS is equal to 'NO '. We must return to
the statement following the in-line PERFORM ... END- PERFORM and force a printing
of this final total:R

#%#########%#################%#########8###U#
###K#########d#######u###U#n###K#########d#######x###U#n###K#########d#######�###�#
########################�###�###��>�###�#################################����####

#########AG����

��############�##�

g@################r##�##����}
v��$###��#####��#��d#########d#########