- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
''' // CHECK FOR VALID FIELD IF FIELD1 <> *BLANKS AND FIELD1 < 'SECNOD'; IsFrist = *ON; LEAVESR; ENDIF;
'''
Admin
My suggestion would be to replace a test for var<1 AND var>5 with False. Even with strings, your first character can't be both smaller than '1' and greater than '5' unless in your character enumeration '5' is before '1'. Which wouldn't be impossible with this Highly Paid Consultant.
Admin
^ HPC says that wrong markdown mark up made me look bad. LOL
Admin
"higher a Highly Paid Consultant" - speech to text issue?
Edit Admin
Well. I hesitate to take the HPC's side, of course, even though he was highered and I was not. But I will state for the record that customers sure as hell love changing their minds and three times out of ten will deny that they ever asked for Feature Foo, despite all evidence proving such, including the Requirements document they signed. (Of course, customers have been known to have high turnovers, which is a great timesaver because you don't even try the "we delivered what as asked for" line.)
Admin
They may or may not have enjoyed Higher Ed.
Edit Admin
How can it ever be both less than 1 and greater than 5? Surely that
AND
should be anOR
(properly parenthesized)?Admin
How do we know what is stored in that field are numbers? All we can see here are the way they start. Might be 'numbers' in the sense of part numbers, and '1' - '5' are coded as parts of the engine, while '6' - '9' are the chassis. So 12DF6, 43FG7 are engine bits, and 71GG5, 96AB0 are different panels.
Based on that, I think the highered consultant is a more interesting Wed, Thur, Fri thing
Admin
different code space??
Admin
COBOL has dialects, including one for the AS/400. So some migration would probably be necessary, but not to a different language.
Edit Admin
Or a highly paid copy editor?
Admin
Story not up to usual DailyWTF standards... A little too much weekend?
Admin
has? Are you saying the detestable language is still being used?!!
Edit Admin
O ... if only RPG had a way to store a numeric value ....
You can do integers, decimals (packed or zoned), and floats in RPG, so there's no excuse!
Edit Admin
Clearly you will never be a HPC, cschneid. You don't get to be "highly paid" by doing only the work necessary, after all. If you're in a learning mood and there are no HPCs nearby willing to reveal their secrets, go to the nearest auto dealership and see how many services they tell a customer are "absolutely needed", and how many perfectly good parts "must" be replaced.
Admin
I forgot I'd sent that CodeSOD in!
Malte and adamantoise--Yes, of course, the AND should have been an OR.
erffrfez--It was a single-character field, with no inherent meaning. That value was defined by an entity we shared data with. Who never happened to notice that we never had data in that field.
cschneid--I wondered about the COBOL vs. RPG thing myself. I was hired (highered?) near the end of the project to maintain that mess...er, codebase...and keep the AS/400 running, so I don't know how that decision was made.
dpm--We had two employees from the HPC firm onsite, each working on a different department's programs. The one in the story was converting straightforward, well-documented reports. She was apparently so unfamiliar with COBOL and RPG (and logic in general) that she couldn't get the reports to balance. The HPCs weren't even adding features, just making sure the new stuff worked like the old stuff.
Edit Admin
True, but the article cited that they bought their own AS/400, and therefore they moved from COBOL to RPG (probably RPG-II, but whatevs) and therefore they got in an HPC. That sequence of events makes no sense because as cschneid said, AS/400 has COBOL available, and so the "and therefore" of switching to RPG(-II) is null and void.
Admin
You're just changing ASCII encodings to make the HPC look bad.
Admin
RPG III.
My employer bought an accounts-payable package from the HPC, including the RPG II (yuck) source code. The software was so bad we replaced it with PC-based within a year or two.
The company we were sharing/renting an HP3000 with was moving to an AS/400 (three or four racks' worth), so my employer decided to get their own tiny AS/400 model B10. The HPC was an IBM business partner, and apparently they were the ones who said both companies "needed" RPG. Like dpm said, you don't get to be "highly paid" by only doing the work necessary.
The HPC firm also doesn't get repeat business for a Y2K conversion in a few years, when their client already has 4-digit years in their tables and code. So they dropped the century digits during the conversion. I don't know what excuse they gave my employer for doing that, I wasn't there yet and the people who were have retired.
Admin
"AS/400 has COBOL available," however not necessarily included in the unit they purchased which would meaning buying and licensing another product from IBM. [Cha-ching.]
Admin
Maybe you "hire" a consultant but "higher" a Highly Paid Consultant.
Admin
Usually all compilers come together with the same licensed program. Though now that I think about it, if it were a real AS/400, then you might have had to purchase each one separately back then. I don't remember any more.
Admin
Everything old is new again. Migrate that code to the cloud!
Admin
Cobol, numbers as text. Makes me question whether this might be a one character field.
(Still doesn't excuse the bug, though.)
Admin
The requirement "both less than 1 and greater than 5" can be fulfilled by the value 07: the leading zero is alphabetically less than 1, and the 7 is numerically greater than 5. Also, the RPG presented seems to be "free-form RPG", very modern, good sale. Imagine you would need to present (and explain) column-oriented "classic RPG"... Finally: Get off my lawn.
Edit Admin
In theory a combination of UTF-8 characters (where some values appear to have sign bits set) and software that expects 7-bit ASCII might end up processing something so that both the <1 and >5 comparisons succeed.
Edit Admin
I can't see how that would happen. Any seven bit ASCII character is encoded as is in UTF-8 and so the comparison would always fail. Any other UTF-8 character always starts with a byte with the top bit set. Such a byte would be less than '1' if it was treated as a signed number and greater than '5' if it was treated as an unsigned number. So for the condition to ever be true, the compiler would need to treat the number as signed and unsigned in the same expression.