Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Error’d: You Talkin’ to Me?

      September 20, 2025

      The Psychology Of Trust In AI: A Guide To Measuring And Designing For User Confidence

      September 20, 2025

      This week in AI updates: OpenAI Codex updates, Claude integration in Xcode 26, and more (September 19, 2025)

      September 20, 2025

      Report: The major factors driving employee disengagement in 2025

      September 20, 2025

      Development Release: Zorin OS 18 Beta

      September 19, 2025

      Distribution Release: IPFire 2.29 Core 197

      September 19, 2025

      Development Release: Ubuntu 25.10 Beta

      September 18, 2025

      Development Release: Linux Mint 7 Beta “LMDE”

      September 18, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Student Performance Prediction System using Python Machine Learning (ML)

      September 21, 2025
      Recent

      Student Performance Prediction System using Python Machine Learning (ML)

      September 21, 2025

      The attack on the npm ecosystem continues

      September 20, 2025

      Feature Highlight

      September 20, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Hyprland Made Easy: Preconfigured Beautiful Distros

      September 20, 2025
      Recent

      Hyprland Made Easy: Preconfigured Beautiful Distros

      September 20, 2025

      Development Release: Zorin OS 18 Beta

      September 19, 2025

      Distribution Release: IPFire 2.29 Core 197

      September 19, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: An Annual Report

    CodeSOD: An Annual Report

    August 5, 2025

    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.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleVulture – find dead code
    Next Article Comprendere il Riavvio dello Spazio Utente nei Sistemi GNU/Linux

    Related Posts

    News & Updates

    Development Release: Zorin OS 18 Beta

    September 19, 2025
    News & Updates

    Distribution Release: IPFire 2.29 Core 197

    September 19, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-53572 – eMarket-Design WP Easy Contact Object Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Mlmmj is a simple and slim mailing list manager

    Linux

    CVE-2025-7480 – PHPGurukul Vehicle Parking Management System SQL Injection

    Common Vulnerabilities and Exposures (CVEs)

    New VMware Tools Vulnerability Allows Attackers to Tamper with Virtual Machines, Broadcom Issues Urgent Patch

    Development

    Highlights

    Qilin Ransomware Emerges as World’s Top Threat, Demands $50 Million Ransom

    June 19, 2025

    Qilin Ransomware Emerges as World’s Top Threat, Demands $50 Million Ransom

    Qilin ransomware has rapidly ascended to become the world’s most prevalent ransomware threat, accumulating over $50 million in ransom payments throughout 2024 alone.
    Originally developed as ‘Agent’ in …
    Read more

    Published Date:
    Jun 19, 2025 (2 hours, 22 minutes ago)

    Vulnerabilities has been mentioned in this article.

    CVE-2023-27532

    A smart sensor assessed my home’s risk of electrical fires, and I was impressed

    August 17, 2025

    “This decision was not made lightly” — Tomb Raider dev Crystal Dynamics hit by “necessary” layoffs for second time this year, and I’m sick of writing this headline

    August 28, 2025

    WooCommerce tip: How to manage discounts based on taxonomies

    April 11, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.