Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cobol Segmentation Error

Status
Not open for further replies.

internetgoddess

Programmer
Nov 8, 2004
2
US
Segmentation Error everytime I try to compile, I haven't used cobol in forever so it is probably something stupid but I can't see it!!

Thanks!!!

*Update a customer file.

identification division.
program-id. customer.
environment division.
input-output section.
file-control. select transact assign to 'tran.dat'
organization is sequential.
select old assign to 'old_inventory.dat'
organization is sequential.
select new assign to 'new_inventory.dat'
organization is sequential.
data division.
file section.
fd old.
01 old-rec.
05 inv-num pic A(16).
05 prod-name pic A(21).
05 prod-code pic A(4).
05 oh-qty pic x(4).
05 bo-qty pic x(4).
05 oo-qty pic x(4).
05 inv-eval pic xxxxx.xx.
05 avg-cost pic xxxx.xx.
05 sell-price pic xxxx.xx.
fd transact.
01 transact-rec.
05 tran-code pic 9.
05 tinv-num pic A(16).
05 tprod-name pic A(21).
05 tprod-code pic A(4).
05 tsell-price pic xxxx.xx.
fd new.
01 new-rec pic x(80).
working-storage section.
01 are-there-more-records pic xxx value 'YES'.
01 out-rec.
05 inv-num-out pic A(16).
05 prod-name-out pic A(21).
05 prod-code-out pic A(4).
05 oh-qty-out pic x(4).
05 bo-qty-out pic x(4).
05 oo-qty-out pic x(4).
05 inv-eval-out pic xxxxx.xx.
05 avg-cost-out pic xxxx.xx.
05 sell-price-out pic xxxx.xx.
05 ws-date.
10 ws-year pic 9999.
10 ws-month pic 99.
10 ws-day pic 99.
05 ws-page-ct pic 99 value zero.
05 ws-line-ct pic 99 value zero.
01 heading-1.
05 pic x(36) value spaces.
05 pic x(25) value 'Transaction Error Listing'.
05 pic x(40) value spaces.
01 date-page.
05 date-out.
10 month-out pic z9.
10 pic x value '/'.
10 day-out pic z9.
10 pic x value '/'.
10 year-out pic 9999.
05 pic x(60) value spaces.
05 pic x(5) value 'Page'.
05 page-out pic z9.
01 heading-2.
05 pic x(11) value 'Transaction'.
05 pic x(30) value spaces.
05 pic x(5) value 'Error'.
05 pic x(2) value spaces.

procedure division.

***** Sort guest-data file *****
100-main-module.
open input old
transact
output new.
perform 500-print-headers-rtn.
perform until are-there-more-records = 'NO'
read old
at end
move 'NO ' to are-there-more-records
not at end
perform 200-outfile-rtn
end-read
end-perform
close old
transact
new.
stop run.

****200-outfile-rtn*******
200-outfile-rtn.
if ws-line-ct >= 62
perform 500-print-headers-rtn
end-if
move spaces to out-rec
move inv-num to inv-num-out
move prod-name to prod-name-out
move prod-code to prod-code-out
move oh-qty to oh-qty-out
move bo-qty to bo-qty-out
move oo-qty to oo-qty-out
move inv-eval to inv-eval-out
move avg-cost to avg-cost-out
move sell-price to sell-price-out
write new-rec from out-rec after advancing 1.

**** Print Headers ****
500-print-headers-rtn.
add 1 to ws-page-ct
move ws-page-ct to page-out
move function current-date to ws-date
move ws-month to month-out
move ws-day to day-out
move ws-year to year-out
write out-rec from date-page after advancing page
write out-rec from heading-1
after advancing 2 lines
write out-rec from heading-2 after advancing 2 lines
move 5 to ws-line-ct.
 
You really try to execute a linux program in a windows XP box ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top