Researchers pinpoint key warning signs of MS that are routinely ignored... would YOU recognise them?
'Ethnic cleansing' gentrification row hits council estate where A Clockwork Orange was filmed amid backlash at 'white, middle-class' regeneration project
Labour's 'one in one out' small boat migrant deal with France will expire in just 11 MONTHS after launch this week
London restaurant sparks outrage after adding 'sneaky' charge to diners' bills
Lauren Sanchez struggles to keep her footing during double dinner date with husband Jeff Bezos as pair are joined by Leonardo DiCaprio and Vittoria amid $485m superyacht holiday
Germany and Japan teamed their ISS robots for seek-and-photograph mission
Japanese space agency JAXA and Germany’s DLR have conducted what they say is the first collaboration between independently developed robots on the International Space Station.…
Fergie, Duchess of Greed: Eye-popping debts, dubious 'charity work' and the vulgar truth of exactly what Prince Andrew's ex squanders money she doesn't have on, all exposed by the book Royals tried to ban
NASA's Lunar Trailblazer Mission Ends In Disappointment
Read more of this story at Slashdot.
Jessie J is targeted after revealing her 'heartbreak' over footage of Hamas hostage 'digging his own grave'
Love Island contestants were so randy during 'particularly feral year' in show's history that bosses 'had to stock up on condoms'
Johnny Vegas admits he had a 'meltdown' amid his ADHD battle as he reflects on the 'most difficult part of his life' and what saved him
The real story behind viral video of French farmer getting rid of travellers by spraying them with manure... and why he had to take action
Repair Shop host Jay Blades is charged with two counts of rape as he awaits trial on separate charge of controlling and coercive behaviour
Amy Shark posts bizarre TikTok seeking dinner date while holidaying in Wales - despite being married
Teacher pleads guilty to years-long sex abuse of 13-year-old schoolgirl
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.
Zendaya flashes her $200k engagement ring as she enjoys a romantic dog walk with fiancé Tom Holland in Richmond Park
Lyft and Baidu plan Eurobocab launch, starting in UK and Germany next year
Rideshare challenger Lyft and China’s Baidu plan to bring robo-cabs to the UK and Europe next year.…