Feed aggregator
Fraudulent Scientific Papers Are Rapidly Increasing, Study Finds
Read more of this story at Slashdot.
Man Controls iPad With His Mind Using Synchron Brain Implant
Read more of this story at Slashdot.
NASA's Lunar Trailblazer Mission Ends In Disappointment
Read more of this story at Slashdot.
CodeSOD: An Annual Report
Michael has the "fun" task of converting old, mainframe-driven reports into something more modern. This means reading through reams of Intelligent Query code.
Like most of these projects, no one has a precise functional definition of what it's supposed to do. The goal is to replace the system with one that behaves exactly the same, but is more "modern". This means their test cases are "run the two systems in parallel and compare the outputs; if they match, the upgrade is good."
After converting one report, the results did not match. Michael dug in, tracing through the code. The name of the report contained the word "Annual". One of the key variables which drove original the report was named TODAYS-365 (yes, you can put dashes in variables in IQ). Michael verified that the upgraded report was pulling exactly one year's worth of data. Tracing through the original report, Michael found this:
# DIVIDE ISBLCS BY ISB-COST-UOM GIVING ISB-COST-EACH. MULTIPLY ISB-STK-QOH TIMES ISB-COST-EACH GIVING ISB-ON-HAND-COST. # SUBTRACT TODAYS-DATE MINUS 426 GIVING TODAYS-365. # SEARCH FOR ITMMAN = 'USA' AND ITMNMB <> '112-*'This snippet comes from a report which contains many hundreds of lines of code. So it's very easy to understand how someone could miss the important part of the code. Specifically, it's this line: SUBTRACT TODAYS-DATE MINUS 426 GIVING TODAYS-365..
Subtract 426 from today's date, and store the result in a variable called TODAYS-365. This report isn't for the past year, but for the past year and about two months.
It's impossible to know exactly why, but at a guess, originally the report needed to grab a year. Then, at some point, the requirement changed, probably based on some nonsense around fiscal years or something similar. The least invasive way to make that change was to just change the calculation, leaving the variable name (and the report name) incorrect and misleading. And there it say, working perfectly fine, until poor Michael came along, trying to understand the code.
The fix was easy, but the repeated pattern of oddly name, unclear variables was not. Remember, the hard part about working on old mainframes isn't learning COBOL or IQ or JCL or whatever antique languages they use; I'd argue those languages are in many cases easier to learn (if harder to use) than modern languages. The hard part is the generations of legacy kruft that's accumulated in them. It's grandma's attic, and granny was a pack rat.
[Advertisement] Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more.US To Expedite Plan For Nuclear Reactor On the Moon
Read more of this story at Slashdot.
Google Agrees To Pause AI Workloads To Protect the Grid When Power Demand Spikes
Read more of this story at Slashdot.
Disney Scrapped Deepfakes For Moana and Tron To Avoid 'Bad Publicity'
Read more of this story at Slashdot.
Rivian Sues To Sell Its EVs Directly In Ohio
Read more of this story at Slashdot.
Hyundai To Help Build Nuclear-Powered Datacenter In Texas
Read more of this story at Slashdot.
CrowdStrike Investigated 320 North Korean IT Worker Cases In the Past Year
Read more of this story at Slashdot.
The Uproar Over Vogue's AI-generated Ad Isn't Just About Fashion
Read more of this story at Slashdot.
ChatGPT Nears 700 Million Weekly Users, Up 4x From Last Year
Read more of this story at Slashdot.
Engineer Restores Pay Phones For Free Public Use
Read more of this story at Slashdot.
World in $1.5 Trillion 'Plastics Crisis' Hitting Health From Infancy To Old Age, Report Warns
Read more of this story at Slashdot.
The Great Indian IT Squeeze
Read more of this story at Slashdot.
Google Tells iPhone Buyers To 'Just Change Your Phone' After Apple's AI Delays
Read more of this story at Slashdot.
What Happens To Your Data If You Stop Paying for Cloud Storage?
Read more of this story at Slashdot.
Delta's Dynamic AI Pricing Plan Sounds Different Now
Read more of this story at Slashdot.
Microsoft Used China-Based Engineers to Support Product Recently Hacked by China
Read more of this story at Slashdot.
Perplexity is Using Stealth, Undeclared Crawlers To Evade Website No-Crawl Directives, Cloudflare Says
Read more of this story at Slashdot.