Okay, I'm new to cobol and learning how to debug when writing code. Currently I'm getting a cc0012 error when compiling my code. I'm unsure how to narrow down my search for what is wrong with my code. If anyone could help me find my error or help me narrow my search that would be great. Below is my retrieved job message as well as my code.
I've writing a few programs already and am pretty sure we don't have a jcl error
Here are my code files
identification division.
program-id. A3SCOMM.
date-written. 2/5/2025.
author. Owen Heeringa.
*
**************************************************************
* Description:
* To retrieve file input for sales commisions and build a
* paged report with detailed calculations and totals in
* a clear and easy to read format.
**************************************************************
*
environment division.
configuration section.
input-output section.
file-control.
* input-file declaration
select input-file
assign to INFILE
organization is sequential.
* output-file declaration
select output-file
assign to OUTFILE
organization is sequential.
data division.
file section.
* input and output file reading and writing definitions
fd input-file
recording mode is F
data record is input-line
record contains 32 characters.
*
01 input-line.
05 person-no pic 9(3).
05 person-name pic x(8).
05 person-sales pic 9(6).
05 min-comm pic 9(6).
05 max-comm pic 9(6).
05 comm-percent pic 9(3).
*
fd output-file
recording mode is F
data record is output-line
record contains 97 characters.
01 output-line pic x(97).
working-storage section.
* Part of our report title all static data.
01 ws-report-header.
05 filler pic x(70)
value spaces.
05 filler pic x(27)
value 'Owen Heeringa, Assignment 3'.
* Part of our report title all static data.
01 ws-report-title.
05 filler pic x(38)
value spaces.
05 filler pic x(22)
value 'SALES COMMISION REPORT'.
05 filler pic x(37)
value spaces.
* Part of our report title all static data.
01 ws-column-title.
05 filler pic x(3)
value 'NO.'.
05 filler pic x(5)
value spaces.
05 filler pic x(4)
value 'NAME'.
05 filler pic x(6)
value spaces.
05 filler pic x(5)
value 'SALES'.
05 filler pic x(5)
value spaces.
05 filler pic x(3)
value 'MIN'.
05 filler pic x(6)
value spaces.
05 filler pic x(3)
value 'MAX'.
05 filler pic x(4)
value spaces.
05 filler pic x(4)
value 'RATE'.
05 filler pic x(5)
value spaces.
05 filler pic x(6)
value 'EARNED'.
05 filler pic x(6)
value spaces.
05 filler pic x(4)
value 'PAID'.
05 filler pic x(5)
value spaces.
05 filler pic x(14)
value 'BONUS/NO BONUS'.
05 filler pic x(2)
value spaces.
05 filler pic x(7)
value spaces.
* Part of our report title all static data.
01 ws-column-div.
05 filler pic x(3)
value '---'.
05 filler pic x(3)
value spaces.
05 filler pic x(8)
value '--------'.
05 filler pic x(3)
value spaces.
05 filler pic x(7)
value '-------'.
05 filler pic x(3)
value spaces.
05 filler pic x(7)
value '-------'.
05 filler pic x(3)
value spaces.
05 filler pic x(7)
value '-------'.
05 filler pic x(3)
value spaces.
05 filler pic x(5)
value '-----'.
05 filler pic x(3)
value spaces.
05 filler pic x(10)
value '----------'.
05 filler pic x(3)
value spaces.
05 filler pic x(10)
value '----------'.
05 filler pic x(3)
value spaces.
05 filler pic x(16)
value '----------------'.
* Finalised data before output
01 ws-data-out.
05 ws-no-out pic x(3).
05 filler pic x(3)
value spaces.
05 ws-name-out pic x(8).
05 filler pic x(3)
value spaces.
05 ws-sales-out pic x(7).
05 filler pic x(3)
value spaces.
05 ws-min-out pic x(7).
05 filler pic x(3)
value spaces.
05 ws-max-out pic x(7).
05 filler pic x(3)
value spaces.
05 ws-rate-out pic x(5).
05 filler pic x(3)
value spaces.
05 ws-earned-out pic x(10).
05 filler pic x(3)
value spaces.
05 ws-paid-out pic x(10).
05 filler pic x(3)
value spaces.
05 ws-bonus-out pic x(16).
* Finalized totals before output.
01 ws-totals-out.
05 filler pic x(38)
value spaces.
05 filler pic x(7)
value 'Totals:'.
05 filler pic x(2)
value spaces.
05 ws-total-earned-out pic x(10).
05 filler pic x(3)
value spaces.
05 ws-total-paid-out pic x(10).
05 filler pic x(19)
value spaces.
* Summarty of report totals before output.
01 ws-report-total-out.
05 filler pic x(40)
value 'Numbers with bonus more than max'.
05 ws-over-max-out pic x(3).
05 filler pic x(40)
value 'Numbers with no bonus less than min'.
05 ws-less-than-min-out pic x(3).
05 filler pic x(40)
value 'Numbers of salespeople with bonus'.
05 ws-sales-w-bonus-out pic x(3).
05 filler pic x(40)
value 'Numbers of salespeople without bonus'.
05 ws-sales-wo-bonus-out pic x(3).
05 filler pic x(40)
value 'Numbers of salespeople'.
05 ws-sales-out pic x(3).
05 filler pic x(40)
value 'Number with paid equal earned'.
05 ws-num-paid-equal-out pic x(3).
05 filler pic x(40)
value 'Percent with paid equal earned'.
05 ws-percent-paid-equal-out pic x(6).
05 filler pic x(40)
value 'Percent with bonus > $300,000'.
05 ws-percent-w-bonus-out pic x(6).
05 filler pic x(40)
value 'Percent with bonus <= $300,000'.
05 ws-percent-wo-bonus-out pic x(6).
01 ws-flags.
05 ws-eof-flag pic x
value "n".
05 ws-other-flag pic x
value "x".
* Variables needed for calculations and totals
01 ws-counters.
05 ws-over-max pic 9(3).
05 ws-less-than-min pic 9(3).
05 ws-sales-with-bonus pic 9(3).
05 ws-sales-without-bonus pic 9(3).
05 ws-sales pic 9(3).
05 ws-num-paid-equal pic 9(3).
05 ws-percent-paid-equal pic 9(5).
05 ws-percent-w-bonus pic 9(5).
05 ws-percent-wo-bonus pic 9(5).
01 ws-input-line.
05 ws-person-no pic 9(3).
05 ws-person-name pic x(8).
05 ws-person-sales pic 9(6).
05 ws-min-comm pic 9(6).
05 ws-max-comm pic 9(6).
05 ws-comm-percent pic 9(3).
01 ws-calc-data.
05 ws-comm-earned pic 9(10).
05 ws-comm-paid pic 9(10).
77 ws-earned pic x(16)
value 'BONUS EARNED'.
77 ws-not-earned pic x(16)
value 'BONUS NOT EARNED'.
77 ws-bonus pic 9(7)
value 115.25.
procedure division.
000-main.
* Open files
open input input-file.
open output output-file.
* Writing report header and column titles
write output-line from ws-report-header.
write output-line from ws-report-title
after advancing 1 line.
* write output-line from ws-column-title
* after advancing 1 line.
write output-line from ws-column-div.
move spaces to output-line.
* Process each input record and read in next record
perform 100-process-file
until ws-eof-flag = "y".
move ws-data-out to output-line
write output-line.
goback.
* Get data from file into ws
100-process-file.
read input-file into ws-input-line
at end move 'y' to ws-eof-flag
not at end perform 200-process-record
end-read.
* All the calculations and processes for the record
200-process-record.
* Calculate salesperson earned commision
if ws-person-sales <= 300000 then
compute ws-comm-earned rounded
= ws-person-sales * ws-comm-percent
move ws-comm-earned to ws-earned-out
move ws-earned to ws-bonus-out
else
compute ws-comm-earned rounded
= (ws-person-sales * ws-comm-percent)
+ ((ws-person-sales - 300000) * ws-bonus)
move ws-comm-earned to ws-earned-out
move ws-not-earned to ws-bonus-out
end-if.
* Calculate salesperson paid commision
if ws-comm-earned <= 300000 then
if ws-comm-earned > ws-max-comm then
move ws-max-comm to ws-comm-paid
else
move ws-comm-earned to ws-comm-paid
end-if
move ws-comm-paid to ws-paid-out
else
if ws-comm-earned < ws-min-comm then
move ws-min-comm to ws-comm-paid
else
move ws-comm-earned to ws-comm-paid
end-if
move ws-comm-paid to ws-paid-out
end-if.
end program A3COMM.
and my JCL file
//CLYYYA2 JOB
//COBOL EXEC PROC=IGYWCL,
// PARM.COBOL='TEST,RENT,APOST,OBJECT,NODYNAM,LIB,SIZE(2097152)'
//COBOL.STEPLIB DD DSN=IGY630.SIGYCOMP,
// DISP=SHR
/* DECLARE DATASET THAT CONTAINS SOURCE CODE
//COBOL.SYSIN DD DSN=KC03D02.INFT2200.A3.COBOL(A3SCOMM),
// DISP=SHR
/*
/* DECLARE PDS MEMBER TO STORE LOAD MODULE
//LKED.SYSLMOD DD DSN=KC03D02.INFT2200.COBOL.LOADLIB(A3SCOMM),
// DISP=OLD
/*
system out msg
STMT NO. MESSAGE
2 IEFC001I PROCEDURE IGYWCL WAS EXPANDED USING SYSTEM LIBRARY SVTSC.PROCLIB
33 IEF686I DDNAME REFERRED TO ON DDNAME KEYWORD IN PRIOR STEP WAS NOT RESOLVED
Thank you all!
I've tried checking my line sizes and i think everything checks out. I'm just really lost at where to look to start with my error.
Okay, I'm new to cobol and learning how to debug when writing code. Currently I'm getting a cc0012 error when compiling my code. I'm unsure how to narrow down my search for what is wrong with my code. If anyone could help me find my error or help me narrow my search that would be great. Below is my retrieved job message as well as my code.
I've writing a few programs already and am pretty sure we don't have a jcl error
Here are my code files
identification division.
program-id. A3SCOMM.
date-written. 2/5/2025.
author. Owen Heeringa.
*
**************************************************************
* Description:
* To retrieve file input for sales commisions and build a
* paged report with detailed calculations and totals in
* a clear and easy to read format.
**************************************************************
*
environment division.
configuration section.
input-output section.
file-control.
* input-file declaration
select input-file
assign to INFILE
organization is sequential.
* output-file declaration
select output-file
assign to OUTFILE
organization is sequential.
data division.
file section.
* input and output file reading and writing definitions
fd input-file
recording mode is F
data record is input-line
record contains 32 characters.
*
01 input-line.
05 person-no pic 9(3).
05 person-name pic x(8).
05 person-sales pic 9(6).
05 min-comm pic 9(6).
05 max-comm pic 9(6).
05 comm-percent pic 9(3).
*
fd output-file
recording mode is F
data record is output-line
record contains 97 characters.
01 output-line pic x(97).
working-storage section.
* Part of our report title all static data.
01 ws-report-header.
05 filler pic x(70)
value spaces.
05 filler pic x(27)
value 'Owen Heeringa, Assignment 3'.
* Part of our report title all static data.
01 ws-report-title.
05 filler pic x(38)
value spaces.
05 filler pic x(22)
value 'SALES COMMISION REPORT'.
05 filler pic x(37)
value spaces.
* Part of our report title all static data.
01 ws-column-title.
05 filler pic x(3)
value 'NO.'.
05 filler pic x(5)
value spaces.
05 filler pic x(4)
value 'NAME'.
05 filler pic x(6)
value spaces.
05 filler pic x(5)
value 'SALES'.
05 filler pic x(5)
value spaces.
05 filler pic x(3)
value 'MIN'.
05 filler pic x(6)
value spaces.
05 filler pic x(3)
value 'MAX'.
05 filler pic x(4)
value spaces.
05 filler pic x(4)
value 'RATE'.
05 filler pic x(5)
value spaces.
05 filler pic x(6)
value 'EARNED'.
05 filler pic x(6)
value spaces.
05 filler pic x(4)
value 'PAID'.
05 filler pic x(5)
value spaces.
05 filler pic x(14)
value 'BONUS/NO BONUS'.
05 filler pic x(2)
value spaces.
05 filler pic x(7)
value spaces.
* Part of our report title all static data.
01 ws-column-div.
05 filler pic x(3)
value '---'.
05 filler pic x(3)
value spaces.
05 filler pic x(8)
value '--------'.
05 filler pic x(3)
value spaces.
05 filler pic x(7)
value '-------'.
05 filler pic x(3)
value spaces.
05 filler pic x(7)
value '-------'.
05 filler pic x(3)
value spaces.
05 filler pic x(7)
value '-------'.
05 filler pic x(3)
value spaces.
05 filler pic x(5)
value '-----'.
05 filler pic x(3)
value spaces.
05 filler pic x(10)
value '----------'.
05 filler pic x(3)
value spaces.
05 filler pic x(10)
value '----------'.
05 filler pic x(3)
value spaces.
05 filler pic x(16)
value '----------------'.
* Finalised data before output
01 ws-data-out.
05 ws-no-out pic x(3).
05 filler pic x(3)
value spaces.
05 ws-name-out pic x(8).
05 filler pic x(3)
value spaces.
05 ws-sales-out pic x(7).
05 filler pic x(3)
value spaces.
05 ws-min-out pic x(7).
05 filler pic x(3)
value spaces.
05 ws-max-out pic x(7).
05 filler pic x(3)
value spaces.
05 ws-rate-out pic x(5).
05 filler pic x(3)
value spaces.
05 ws-earned-out pic x(10).
05 filler pic x(3)
value spaces.
05 ws-paid-out pic x(10).
05 filler pic x(3)
value spaces.
05 ws-bonus-out pic x(16).
* Finalized totals before output.
01 ws-totals-out.
05 filler pic x(38)
value spaces.
05 filler pic x(7)
value 'Totals:'.
05 filler pic x(2)
value spaces.
05 ws-total-earned-out pic x(10).
05 filler pic x(3)
value spaces.
05 ws-total-paid-out pic x(10).
05 filler pic x(19)
value spaces.
* Summarty of report totals before output.
01 ws-report-total-out.
05 filler pic x(40)
value 'Numbers with bonus more than max'.
05 ws-over-max-out pic x(3).
05 filler pic x(40)
value 'Numbers with no bonus less than min'.
05 ws-less-than-min-out pic x(3).
05 filler pic x(40)
value 'Numbers of salespeople with bonus'.
05 ws-sales-w-bonus-out pic x(3).
05 filler pic x(40)
value 'Numbers of salespeople without bonus'.
05 ws-sales-wo-bonus-out pic x(3).
05 filler pic x(40)
value 'Numbers of salespeople'.
05 ws-sales-out pic x(3).
05 filler pic x(40)
value 'Number with paid equal earned'.
05 ws-num-paid-equal-out pic x(3).
05 filler pic x(40)
value 'Percent with paid equal earned'.
05 ws-percent-paid-equal-out pic x(6).
05 filler pic x(40)
value 'Percent with bonus > $300,000'.
05 ws-percent-w-bonus-out pic x(6).
05 filler pic x(40)
value 'Percent with bonus <= $300,000'.
05 ws-percent-wo-bonus-out pic x(6).
01 ws-flags.
05 ws-eof-flag pic x
value "n".
05 ws-other-flag pic x
value "x".
* Variables needed for calculations and totals
01 ws-counters.
05 ws-over-max pic 9(3).
05 ws-less-than-min pic 9(3).
05 ws-sales-with-bonus pic 9(3).
05 ws-sales-without-bonus pic 9(3).
05 ws-sales pic 9(3).
05 ws-num-paid-equal pic 9(3).
05 ws-percent-paid-equal pic 9(5).
05 ws-percent-w-bonus pic 9(5).
05 ws-percent-wo-bonus pic 9(5).
01 ws-input-line.
05 ws-person-no pic 9(3).
05 ws-person-name pic x(8).
05 ws-person-sales pic 9(6).
05 ws-min-comm pic 9(6).
05 ws-max-comm pic 9(6).
05 ws-comm-percent pic 9(3).
01 ws-calc-data.
05 ws-comm-earned pic 9(10).
05 ws-comm-paid pic 9(10).
77 ws-earned pic x(16)
value 'BONUS EARNED'.
77 ws-not-earned pic x(16)
value 'BONUS NOT EARNED'.
77 ws-bonus pic 9(7)
value 115.25.
procedure division.
000-main.
* Open files
open input input-file.
open output output-file.
* Writing report header and column titles
write output-line from ws-report-header.
write output-line from ws-report-title
after advancing 1 line.
* write output-line from ws-column-title
* after advancing 1 line.
write output-line from ws-column-div.
move spaces to output-line.
* Process each input record and read in next record
perform 100-process-file
until ws-eof-flag = "y".
move ws-data-out to output-line
write output-line.
goback.
* Get data from file into ws
100-process-file.
read input-file into ws-input-line
at end move 'y' to ws-eof-flag
not at end perform 200-process-record
end-read.
* All the calculations and processes for the record
200-process-record.
* Calculate salesperson earned commision
if ws-person-sales <= 300000 then
compute ws-comm-earned rounded
= ws-person-sales * ws-comm-percent
move ws-comm-earned to ws-earned-out
move ws-earned to ws-bonus-out
else
compute ws-comm-earned rounded
= (ws-person-sales * ws-comm-percent)
+ ((ws-person-sales - 300000) * ws-bonus)
move ws-comm-earned to ws-earned-out
move ws-not-earned to ws-bonus-out
end-if.
* Calculate salesperson paid commision
if ws-comm-earned <= 300000 then
if ws-comm-earned > ws-max-comm then
move ws-max-comm to ws-comm-paid
else
move ws-comm-earned to ws-comm-paid
end-if
move ws-comm-paid to ws-paid-out
else
if ws-comm-earned < ws-min-comm then
move ws-min-comm to ws-comm-paid
else
move ws-comm-earned to ws-comm-paid
end-if
move ws-comm-paid to ws-paid-out
end-if.
end program A3COMM.
and my JCL file
//CLYYYA2 JOB
//COBOL EXEC PROC=IGYWCL,
// PARM.COBOL='TEST,RENT,APOST,OBJECT,NODYNAM,LIB,SIZE(2097152)'
//COBOL.STEPLIB DD DSN=IGY630.SIGYCOMP,
// DISP=SHR
/* DECLARE DATASET THAT CONTAINS SOURCE CODE
//COBOL.SYSIN DD DSN=KC03D02.INFT2200.A3.COBOL(A3SCOMM),
// DISP=SHR
/*
/* DECLARE PDS MEMBER TO STORE LOAD MODULE
//LKED.SYSLMOD DD DSN=KC03D02.INFT2200.COBOL.LOADLIB(A3SCOMM),
// DISP=OLD
/*
system out msg
STMT NO. MESSAGE
2 IEFC001I PROCEDURE IGYWCL WAS EXPANDED USING SYSTEM LIBRARY SVTSC.PROCLIB
33 IEF686I DDNAME REFERRED TO ON DDNAME KEYWORD IN PRIOR STEP WAS NOT RESOLVED
Thank you all!
I've tried checking my line sizes and i think everything checks out. I'm just really lost at where to look to start with my error.
Share Improve this question asked 12 hours ago Owen HeeringaOwen Heeringa 111 bronze badge New contributor Owen Heeringa is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.1 Answer
Reset to default 0Take a look at the output in the SYSPRINT DD for the COBOL step executing the IGYCRCTL program. Error messages for your program compile will be contained there.
The value for ws-bonus
exceeds its picture clause. I think you mean 9(7)V99.
The name supplied on your end
statement for the program doesn't match the name in the Identification Division.
Also, though not a programming error, the word "commission" is misspelled in ws-report-title
. (8->#