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

      DistroWatch Weekly, Issue 1140

      September 21, 2025

      Distribution Release: DietPi 9.17

      September 21, 2025

      Development Release: Zorin OS 18 Beta

      September 19, 2025

      Distribution Release: IPFire 2.29 Core 197

      September 19, 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

      @ts-ignore is almost always the worst option

      September 22, 2025
      Recent

      @ts-ignore is almost always the worst option

      September 22, 2025

      MutativeJS v1.3.0 is out with massive performance gains

      September 22, 2025

      Student Performance Prediction System using Python Machine Learning (ML)

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

      DistroWatch Weekly, Issue 1140

      September 21, 2025
      Recent

      DistroWatch Weekly, Issue 1140

      September 21, 2025

      Distribution Release: DietPi 9.17

      September 21, 2025

      Hyprland Made Easy: Preconfigured Beautiful Distros

      September 20, 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

    DistroWatch Weekly, Issue 1140

    September 21, 2025
    News & Updates

    Distribution Release: DietPi 9.17

    September 21, 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-30675 – Apache CloudStack Access Control Bypass Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Designer Spotlight: Luca Franceschetti

    News & Updates

    CVE-2025-48287 – Pagaleve Pix 4x sem juros – Object Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    How to Automate CI/CD with GitHub Actions and Streamline Your Workflow

    Development

    Highlights

    WAGO Device Manager Vulnerabilities Expose Critical Industrial Infrastructure to Remote Exploits

    June 17, 2025

    WAGO Device Manager Vulnerabilities Expose Critical Industrial Infrastructure to Remote Exploits

    German industrial automation manufacturer WAGO GmbH & Co. KG has released critical security updates for its WAGO Device Manager after researchers uncovered serious vulnerabilities that could allow una …
    Read more

    Published Date:
    Jun 18, 2025 (2 hours, 24 minutes ago)

    Vulnerabilities has been mentioned in this article.

    Cloudreve – self-hosted file management system with multi-cloud support

    August 28, 2025

    CVE-2025-6841 – Code-projects Product Inventory System SQL Injection Vulnerability

    June 29, 2025

    CVE-2025-2168 – Elementor Store Kit CSRF

    May 1, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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