• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Reader Feedback and Insights: SQL to the Rescue!

    October 25, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I am writing in regard to the September 20, 2002 Midrange Guru article, “Comparing Lists of Numbers to a Value .” I would like to offer the following embedded SQL example as an alternative solution:

    D found           s              1a              
    D
     * if (field1 or field2 or field3) > 25 
    C/exec sql                                       
    C+    select case                                
    C+      when max(:field1, :field2, :field3) > 25 
    C+         then '1'                              
    C+         else '0'                              
    C+      end                                      
    C+    into :found                                
    C+    from (any file with one record)
    C/end-exec                                       
    C                                                
    C                   if        found = *on        
     .................. whatever ..................
    C                   else 
    ................... whatever ..................
    C                   endif
    

    This program uses the SQL CASE statement to evaluate whether any one of a list of input host variable values is greater than a control value. A pseudo-Boolean character value is returned, indicating whether the condition was satisfied. The appropriate program logic can then be executed based upon the resulting value.

    — Jeff

    Thanks for the idea, Jeff. Isn’t it silly that you have to have a one-record dummy file for these things?

    — Ted

    Sponsored By
    ADVANCED SYSTEMS CONCEPTS

    Business Analytics
    – Practical –
    – Cost Effective –
    – Easy to Deploy –

    SEQUEL FYI

    User Quote:
    “I love SEQUEL FYI because it lets me look at the data any way I need to see it, instantly. This is the easiest tool to manage complex product relationships that I have ever seen.”

    SEQUEL FYI offers outstanding OLAP business intelligence functionality for a fraction of the cost of comparable solutions.

    Read More > View Streaming Video

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: mgo_rc, Volume 2, Number 82 -- October 25, 2002

    Sponsored by
    VISUAL LANSA 16 WEBINAR

    Trying to balance stability and agility in your IBM i environment?

    Join this webinar and explore Visual LANSA 16 – our enhanced professional low-code platform designed to help organizations running on IBM i evolve seamlessly for what’s next.

    🎙️VISUAL LANSA 16 WEBINAR

    Break Monolithic IBM i Applications and Unlock New Value

    Explore modernization without rewriting. Decouple monolithic applications and extend their value through integration with modern services, web frameworks, and cloud technologies.

    🗓️ July 10, 2025

    ⏰ 9 AM – 10 AM CDT (4 PM to 5 PM CEST)

    See the webinar schedule in your time zone

    Register to join the webinar now

    What to Expect

    • Get to know Visual LANSA 16, its core features, latest enhancements, and use cases
    • Understand how you can transition to a MACH-aligned architecture to enable faster innovation
    • Discover native REST APIs, WebView2 support, cloud-ready Azure licensing, and more to help transform and scale your IBM i applications

    Read more about V16 here.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Type2 IFS Directories Reader Feedback and Insights: Thanks for the Information

    Leave a Reply Cancel reply

MGO Volume: 2 Issue: 82

This Issue Sponsored By

    Table of Contents

    • Reader Feedback and Insights: SQL to the Rescue!
    • Another Way to Dump an IFS File
    • Johnny Can’t Read and RPG Can’t Do Math

    Content archive

    • The Four Hundred
    • Four Hundred Stuff
    • Four Hundred Guru

    Recent Posts

    • Liam Allan Shares What’s Coming Next With Code For IBM i
    • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
    • VS Code Will Be The Heart Of The Modern IBM i Platform
    • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
    • IBM i PTF Guide, Volume 27, Number 25
    • Meet The Next Gen Of IBMers Helping To Build IBM i
    • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
    • Will Independent IBM i Clouds Survive PowerVS?
    • Now, IBM Is Jacking Up Hardware Maintenance Prices
    • IBM i PTF Guide, Volume 27, Number 24

    Subscribe

    To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

    Pages

    • About Us
    • Contact
    • Contributors
    • Four Hundred Monitor
    • IBM i PTF Guide
    • Media Kit
    • Subscribe

    Search

    Copyright © 2025 IT Jungle