Post #197,821
3/9/05 3:15:33 PM
|
Evil COBOL question
Where does execution START if the CA/ZIP test fails? \n\tIF (IN-STATE = 'CA') OR\n\t\t( (IN-ZIP-3 > 899) AND (IN-ZIP-3 < 962) )\n\n\t\t SET PROBI TO BKI\n\t\t IF PROB-KIT-IND (PROBI) = 'Y'\n\t\t\t MOVE 'Y' TO PROB-KIT-SW\n\t\t\t PERFORM 406-SEARCH THRU 406-EXIT\n\t\t\t GO TO 400-EXIT.\n\n\tMOVE CUCBOM-KIT (BKI) TO ADD-KIT.\n\tMOVE CUCBOM-KIT (BKI) TO OUT-KIT-NAME.\n\tMOVE CUCBOM-PROJ (BKI) TO ADD-PROJ.\n\tMOVE SYSIN-MONTH TO ADD-PROJ-MONTH.\n\tMOVE CUCBOM-FORM (BKI) TO ADD-LOOKUP-FORM.\n\tMOVE CUCBOM-UP-FACTOR (BKI) TO OUT-UP-FACTOR.\n\tMOVE CUCBOM-PROG-TYPE (BKI) TO ADD-ATW-CODE.\n\tMOVE CUCBOM-WINDOW (BKI) TO OUT-WINDOW.\n\tMOVE CUCBOM-LABEL-IND (BKI) TO ADD-LABEL-FLAG.\n\tGO TO 400-IS-SPACES.\n\n
|
Post #197,824
3/9/05 4:04:35 PM
|
Somewhere around 1967?
|
Post #197,826
3/9/05 4:39:10 PM
|
Isn't COBOL scoped by indentation?
If so, then at MOVE CUCBOM-KIT (BKI) TO ADD-KIT. makes sense to me.
Cheers, Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
|
Post #197,846
3/9/05 6:35:22 PM
|
No. By "PERIOD"
|
Post #197,851
3/9/05 7:29:53 PM
|
A pox upon you for even knowing that.
bcnu, Mikem
Eine Leute. Eine Welt. Ein F\ufffdhrer. God Bless America.
|
Post #197,827
3/9/05 4:40:39 PM
|
MOVE CUCBOM-KIT (BKI) TO OUT-KIT-NAME.
I think.
No "THEN"? No "END-IF"?
I hate Cobol.
[link|http://forfree.sytes.net|
] Imric's Tips for Living
- Paranoia Is a Survival Trait
- Pessimists are never disappointed - but sometimes, if they are very lucky, they can be pleasantly surprised...
- Even though everyone is out to get you, it doesn't matter unless you let them win.
|
Nothing is as simple as it seems in the beginning, As hopeless as it seems in the middle, Or as finished as it seems in the end.
|
|
Post #197,861
3/9/05 9:20:18 PM
|
C'mon people
I NEED THIS. I really do not KNOW. Based on the number of periods, a failed test should start AFTER the \nMOVE CUCBOM-KIT (BKI) TO ADD-KIT.\n Which contradicts the ovbious intended logic. And NO, I cannot TEST this, it is a snippet of a 10,000 line program that I don't even know how to compile, let alone run. My inhouse COBOL person told me it starts on the MOVE, not after it. Of course, he was talking with a VERY heavy Russian accent, and I'm not really sure I ever understand him. He could not explain the issue of the PERIOD scoping. My goal here is to pull enough business logic to duplicate the functionality of this program. This means I will need to get to the point where I will run the data against mine, they run against theirs, and we compare. when they are different (AND THEY WILL BE), I need to be able to read enough of the COBOL to figure why. But in this case, it feels like the COBOL program has a bug. So can anyone tell me for sure?
|
Post #197,864
3/9/05 9:32:45 PM
|
Can't you write a small test program and experiment?
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
|
Post #197,868
3/9/05 10:04:53 PM
|
Too ignorant
These are the missing pieces for me to do that:
Learn how to login to the editor (which is different from my current interface). Create a file. Create a syntactically correct COBOL program. Compile it. Link it. Save it to a library that I can execute from. Create the associated JCL to run it. Submit it. Figure out how to access the MF logs. Go through the INCREDIBLY PAINFUL debugging cycle as I work through the JCL issues that I screwed up.
Lose 2 weeks of my life to a task I hope to never repeat. The editor make me long for the days of edlin. JCL debugging is as close to torture as you can get.
I've done most of the above, in multiple pieces over the last 5 years. Last time was about a year ago. It was horrible.
I'd rather whine here, since I know SOME of you are past COBOL programmers. I'll also forward the code to a couple of other people as well.
|
Post #197,877
3/9/05 11:21:14 PM
|
Re: Too ignorant
Look [link|http://www.csis.ul.ie/cobol/Course/Selection.htm#part1|here].
When there is no END-IF, IF scope is terminated by a period.
That means (nested IFs notwithstanding) the one in line:
GO TO 400-EXIT.
Read the text at the link.
As with girls, a missing period could mean a serious problem.
Alex
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. -- Bertrand Russell
|
Post #197,897
3/10/05 8:02:33 AM
|
Nested if...
[link|http://forfree.sytes.net|
] Imric's Tips for Living
- Paranoia Is a Survival Trait
- Pessimists are never disappointed - but sometimes, if they are very lucky, they can be pleasantly surprised...
- Even though everyone is out to get you, it doesn't matter unless you let them win.
|
Nothing is as simple as it seems in the beginning, As hopeless as it seems in the middle, Or as finished as it seems in the end.
|
|
Post #197,867
3/9/05 9:55:29 PM
|
Periods in COBOL.
The language was extended somewhat from the original designs and the way the period ends IF statements and such happened a bit by accident. It causes just the sort of bugs you're seeing now.
Looking [link|http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/AM0C1002/CCONTENTS?DT=19921218100410|http://publibz.bould...DT=19921218100410] I see that the *both* IFs are terminated by the single period. Your Russian colleague is correct. Technically, your nested IF is not legal.
Other IBM COBOL resources: [link|http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/AM0C1002/CCONTENTS?DT=19921218100410|http://publibz.bould...DT=19921218100410]
Wade.
Is it enough to love Is it enough to breathe Somebody rip my heart out And leave me here to bleed
| | Is it enough to die Somebody save my life I'd rather be Anything but Ordinary Please
| -- "Anything but Ordinary" by Avril Lavigne. |
|
Post #197,869
3/9/05 10:10:01 PM
|
Thanks
\n Note: When the ELSE phrase is omitted, all statements following the\n condition and preceding the corresponding END-IF or the separator period\n for the sentence are considered to be part of statement-1.\n 10,000 line of code. Not one END-IF. Kill me now.
|
Post #197,870
3/9/05 10:43:12 PM
|
When I said 'I think'
I meant what I said.
[link|http://forfree.sytes.net|
] Imric's Tips for Living
- Paranoia Is a Survival Trait
- Pessimists are never disappointed - but sometimes, if they are very lucky, they can be pleasantly surprised...
- Even though everyone is out to get you, it doesn't matter unless you let them win.
|
Nothing is as simple as it seems in the beginning, As hopeless as it seems in the middle, Or as finished as it seems in the end.
|
|
Post #197,881
3/10/05 12:39:46 AM
|
END-IF is relatively new.
I do remember my COBOL days enough to recall that as soon as you use nearly anything added to it after the original design - like nested IFs - it goes hairy.
Wade.
Is it enough to love Is it enough to breathe Somebody rip my heart out And leave me here to bleed
| | Is it enough to die Somebody save my life I'd rather be Anything but Ordinary Please
| -- "Anything but Ordinary" by Avril Lavigne. |
|
Post #197,874
3/9/05 11:02:49 PM
|
You need Meerkat's COBOL-fu.
Peter [link|http://www.ubuntulinux.org|Ubuntu Linux] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Home] Use P2P for legitimate purposes!
|
Post #198,710
3/15/05 4:59:04 AM
|
Darnit, I've been a bit slow to catch up :(
Two out of three people wonder where the other one is.
|
Post #197,875
3/9/05 11:04:56 PM
|
Ш сфт щаау
That is, "I can offer translation services". :)
--
And what are we doing when the two most powerful nations on earth -- America and Israel -- stomp on the elementary rights of human beings?
-- letter to the editor from W. Ostermeier, Liechtenstein
|
Post #197,862
3/9/05 9:21:36 PM
3/9/05 9:22:02 PM
|
Dupe - ignore
I NEED THIS. I really do not KNOW. Based on the number of periods, a failed test should start AFTER the \nMOVE CUCBOM-KIT (BKI) TO ADD-KIT.\n Which contradicts the ovbious intended logic. And NO, I cannot TEST this, it is a snippet of a 10,000 line program that I don't even know how to compile, let alone run. My inhouse COBOL person told me it starts on the MOVE, not after it. Of course, he was talking with a VERY heavy Russian accent, and I'm not really sure I ever understand him. He could not explain the issue of the PERIOD scoping. My goal here is to pull enough business logic to duplicate the functionality of this program. This means I will need to get to the point where I will run the data against mine, they run against theirs, and we compare. when they are different (AND THEY WILL BE), I need to be able to read enough of the COBOL to figure why. But in this case, it feels like the COBOL program has a bug. So can anyone tell me for sure?
Edited by broomberg
March 9, 2005, 09:22:02 PM EST
|
Post #197,882
3/10/05 1:02:33 AM
|
<obCrackMonkey>Ha Ha COBOL</obCrackMonkey>
Peter [link|http://www.ubuntulinux.org|Ubuntu Linux] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Home] Use P2P for legitimate purposes!
|