June 10th, 2008, 09:05 PM
|
#1 (permalink)
| | Ultimate Member
Join Date: Mar 2005 Location: Out of my mind
Posts: 2,792
|
Yeah, I need a little help if possible (I know, I know, the all powerful programmer is asking for help!) ROFL
Compiling a MicroFocus COBOL program and getting a "too many subscripts" error....weird stuff.
I've recoded the program and still get error. Funny thing is, it's in a COBOL paragraph that is exactly the same as one above it (I call it based on some criteria). One goes ok, the second one bombs with that COMPILER error; note that this isn't runtime; it's a "compiler thang".
Last edited by Rootstonian : June 10th, 2008 at 09:08 PM.
|
| |
June 10th, 2008, 09:12 PM
|
#2 (permalink)
| | Ultimate Member
Join Date: Oct 2001
Posts: 21,019
|
appears a 'subscript' is an array in COBOL
do you possibly have an infinite loop that is causing the array to go out of bounds? |
| |
June 10th, 2008, 09:22 PM
|
#3 (permalink)
| | Ultimate Member
Join Date: Mar 2005 Location: Out of my mind
Posts: 2,792
|
Nope...remember, this is a compiler error; the program never runs and therefore the index would not go "out of bounds". And the SAME code above it doesn't error-out.
Here is code...I call it 2 times based on a value I find...second COBOL paragraph bombs on the "COMPUTE OTH-PAY" with the "too many subscripts" error
Oh, I love my job! LOL <edit...kids, do not try this at home!  > Code:
PERFORM VARYING PLAN-IDX FROM 1 BY 1
UNTIL PLAN-IDX > PLAN-COUNT OF PARTC
IF PLAN-TYPE OF PLAN-DATA OF PARTC(PLAN-IDX)
= PLAN-TYPE OF APAY-DATA OF PARTC(APAY-IDX)
AND COVERAGE-ELECT-ELECT OF PLAN-DATA OF PARTC(PLAN-IDX)
PERFORM VARYING COST-IDX FROM 1 BY 1
UNTIL COST-IDX > COST-COUNT OF PARTC
IF COST-TYPE-PRICE OF PARTC(COST-IDX)
AND PLAN-TYPE OF COST-DATA OF PARTC(COST-IDX)
= PLAN-TYPE OF APAY-DATA OF PARTC(APAY-IDX)
AND OPTION-ID OF COST-DATA OF PARTC(COST-IDX)
= OPTION-ID OF PLAN-DATA OF PARTC(PLAN-IDX)
IF OTH-PAY OF PARTC(APAY-IDX) >
DEDN-AMT-B-TAX OF COST-DATA
OF PARTC(COST-IDX)
COMPUTE OTH-PAY OF PARTC(APAY-IDX)
= OTH-PAY OF PARTC(APAY-IDX)
- DEDN-AMT-B-TAX OF COST-DATA
OF PARTC(COST-IDX)
ELSE
DISPLAY ' '
DISPLAY 'Check Medical Additional Pay'
DISPLAY 'for EMPLID = ' EMPLID OF PARTC
DISPLAY ' '
END-IF
END-IF
END-PERFORM
END-IF
END-PERFORM
Last edited by Rootstonian : June 10th, 2008 at 09:36 PM.
|
| |
June 10th, 2008, 10:39 PM
|
#4 (permalink)
| | Super F@D Folder
Join Date: Jun 2004
Posts: 5,004
|
did you copy/paste the code? Maybe it's an issue with character encoding or non printing characters somewhere in there? |
| |
June 10th, 2008, 11:06 PM
|
#5 (permalink)
| | Real gangstas sip on Yacc
Join Date: Oct 2001 Location: Suckas-ville
Posts: 4,549
|
Heh COBOL, have fun with that  Unfortunately I have zero COBOL experience and hope to keep it that way.
__________________
Signatures blow hard
If your signature contains an ad of any kind, congratulations, you're on my ignore list.
|
| |
June 10th, 2008, 11:10 PM
|
#6 (permalink)
| | Ultimate Member
Join Date: Mar 2005 Location: Out of my mind
Posts: 2,792
|
Oh, gee thanks, that'll be fun
Worth a look, but I'll have to FTP the program up to our mainframe and then go into it's editor and look at it in HEX....oh boy  That will be a "last resort" check!!
It does have something to do with the nesting level of subscripts; I do think I've found that our compiler will handle 16 deep. I just don't see where I'm over that.
Alas, tomorrow is another day in the cube/cell. That's why I get the big bucks, right? ROFL
Hmmm...small light bulb on..."Note to Self: Dave, check out the Perform varying loops; see if those may cause the subscript nesting error..." "But, why doesn't it bomb on the first one?" |
| |
June 10th, 2008, 11:58 PM
|
#7 (permalink)
| | Ultimate Member
Join Date: Mar 2005 Location: Out of my mind
Posts: 2,792
| Quote:
Originally Posted by jkrohn Heh COBOL, have fun with that  Unfortunately I have zero COBOL experience and hope to keep it that way. | Yeah, it was part of my first degree.
I still support a COBOL program written in 1976...believe it or NOT! LOL |
| |
June 11th, 2008, 12:40 AM
|
#8 (permalink)
| | Thaumaturge Member
Join Date: Oct 2001 Location: West Haven, Utah
Posts: 12,671
|
I last programmed in COBOL in the late 80's. I admire your problem, but I don't think I can help... |
| |
June 11th, 2008, 08:18 AM
|
#9 (permalink)
| | Ultimate Member
Join Date: Mar 2005 Location: Out of my mind
Posts: 2,792
|
LOL @ HOWSTE; Yes, an "artist" does appreciate this problem  |
| |
June 11th, 2008, 09:42 AM
|
#10 (permalink)
| | Ultimate Member
Join Date: Jun 2004 Location: England
Posts: 1,377
| Quote:
Originally Posted by Rootstonian Yo, Programming Guys | Shouldn't that be Yo, Programming Cats? |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | |
Similar Threads | | Thread | Thread Starter | Forum | Replies | Last Post | | Help with programming please | andy1984 | Webmastering and Programming | 55 | August 12th, 2005 11:07 AM | | programming | sunny22 | Webmastering and Programming | 44 | June 19th, 2005 01:47 AM | | C++ programming HELP! | TechKnickle | Webmastering and Programming | 3 | September 19th, 2004 02:49 AM | | Programming | quantumlight | Webmastering and Programming | 22 | September 10th, 2004 07:38 PM | | Need help with C programming | Lemon[H]ead | Webmastering and Programming | 9 | July 8th, 2002 07:57 PM | | Most Active Discussions | | | | | Recent Discussions  | | | | | |