identification division. program-id. gen-1. author. bill rogers. * compile and run this program to generate the transaction * file that will be used to update the sequential master file. * you may wish to modify the "assign" clause in the environment * division to specify a disk and/or path location in which * this program will create its output. environment division. input-output section. file-control. select out-file assign to 'txn1.dat' organization is line sequential. data division. file section. fd out-file data record is out-item. 01 out-item. 02 out-accnt-number pic x(5). 02 out-description pic x(25). 02 out-amount pic s9(6)v99. working-storage section. 01 data-text. 02 pic x(39) value '00001Check 101 00001000-'. 02 pic x(39) value '00001Check 102 00005000-'. 02 pic x(39) value '00001Check 103 00004000-'. 02 pic x(39) value '00001Deposit 00010000+'. 02 pic x(39) value '00001Check 104 00000150-'. 02 pic x(39) value '00002Direct Deposit 00100000+'. 02 pic x(39) value '00002Check 1076 00010000-'. 02 pic x(39) value '00002Check 1077 00005500-'. 02 pic x(39) value '00003Check 1075 00004000-'. 02 pic x(39) value '00003Cash Station 00002500-'. 02 pic x(39) value '00003Check 1072 00015500-'. 02 pic x(39) value '00003Automated Payment VISA 00010000-'. 02 pic x(39) value '00003Fee 00000050-'. 02 pic x(39) value '00004Check 099 00000500-'. 02 pic x(39) value '00005Withdraw 00010000-'. 02 pic x(39) value '00005Deposit 00050000+'. 02 pic x(39) value '00005Check 714 00007500-'. 02 pic x(39) value '00005Check 715 00006500-'. 02 pic x(39) value '00005Check 717 00003500-'. 02 pic x(39) value '00005Direct Deposit 00057500+'. 02 pic x(39) value '00005Teller Fee 00000500-'. 02 pic x(39) value '00005Misc. Fee 00000175-'. 02 pic x(39) value '00006Cash Station 00005000-'. 02 pic x(39) value '00006Deposit 00010000+'. 02 pic x(39) value '00006Deposit 00056000+'. 02 pic x(39) value '00006Check 2159 00007619-'. 02 pic x(39) value '00006Cash Station 00010150-'. 01 data-table redefines data-text. 02 data-item occurs 27 times. 03 data-accnt-number pic 9(5). 03 data-description pic x(25). 03 data-amount pic 9(6)v9(2). 03 data-sign pic x. 01 x pic 9(4) comp. procedure division. mainline. open output out-file. perform the-loop varying x from 1 by 1 until x > 27. close out-file. stop run. the-loop. move data-accnt-number (x) to out-accnt-number. move data-description (x) to out-description. if data-sign (x) = '-' compute out-amount = data-amount (x) * -1 else compute out-amount = data-amount (x) * 1. write out-item.