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

      UX Job Interview Helpers

      August 5, 2025

      .NET Aspire’s CLI reaches general availability in 9.4 release

      August 5, 2025

      15 Essential Skills to Look for When Hiring Node.js Developers for Enterprise Projects (2025-2026)

      August 4, 2025

      African training program creates developers with cloud-native skills

      August 4, 2025

      Why I’ll keep the Samsung Z Fold 7 over the Pixel 10 Pro Fold – especially if these rumors are true

      August 5, 2025

      You may soon get Starlink internet for a much lower ‘Community’ price – here’s how

      August 5, 2025

      uBlock Origin Lite has finally arrived for Safari – with one important caveat

      August 5, 2025

      Perplexity says Cloudflare’s accusations of ‘stealth’ AI scraping are based on embarrassing errors

      August 5, 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

      Send Notifications in Laravel with Firebase Cloud Messaging and Notifire

      August 5, 2025
      Recent

      Send Notifications in Laravel with Firebase Cloud Messaging and Notifire

      August 5, 2025

      Simplified Batch Job Creation with Laravel’s Enhanced Artisan Command

      August 5, 2025

      Send Notifications in Laravel with Firebase Cloud Messaging and Notifire

      August 5, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      This comfy mesh office chair I’ve been testing costs less than $400 — but there’s a worthy alternative that’s far more affordable

      August 5, 2025
      Recent

      This comfy mesh office chair I’ve been testing costs less than $400 — but there’s a worthy alternative that’s far more affordable

      August 5, 2025

      How to get started with Markdown in the Notepad app for Windows 11

      August 5, 2025

      Microsoft Account Lockout: LibreOffice Developer’s Week-Long Nightmare Raises Concerns

      August 5, 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

    Why I’ll keep the Samsung Z Fold 7 over the Pixel 10 Pro Fold – especially if these rumors are true

    August 5, 2025
    News & Updates

    You may soon get Starlink internet for a much lower ‘Community’ price – here’s how

    August 5, 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-36593 – Dell OpenManage Network Integration RADIUS Authentication Bypass

    Common Vulnerabilities and Exposures (CVEs)

    How to make GIMP more like Photoshop

    News & Updates

    UK NCA Arrests Four in Cyberattacks on M&S, Co-op, and Harrods

    Development

    Microsoft launches Intel-exclusive Surface Laptop 5G with reengineered design — but it’s SHOCKINGLY expensive

    News & Updates

    Highlights

    CVE-2025-34071 – Kerio Control Remote Code Execution Vulnerability

    July 2, 2025

    CVE ID : CVE-2025-34071

    Published : July 2, 2025, 2:15 p.m. | 1 hour, 1 minute ago

    Description : A remote code execution vulnerability in GFI Kerio Control 9.4.5 allows attackers with administrative access to upload and execute arbitrary code through the firmware upgrade feature. The system upgrade mechanism accepts unsigned .img files, which can be modified to include malicious scripts within the upgrade.sh or disk image components. These modified upgrade images are not validated for authenticity or integrity, and are executed by the system post-upload, enabling root access.

    Severity: 0.0 | NA

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    SonicWall Confirms Active Exploitation of Flaws Affecting Multiple Appliance Models

    May 11, 2025

    CVE-2025-4900 – Campcodes Sales and Inventory System SQL Injection Vulnerability

    May 18, 2025

    CVE-2025-46756 – Apache HTTP Server Unvalidated User Input

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

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