• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Include Comments in Query/400 Queries

    September 20, 2006 Hey, Ted

    OK, I’ll bite. In your article Query/400 Handles Zero Dates (Sort Of), from Four Hundred Guru Volume 6, Number 25, you said, “This is one way to include comments in a query.” Does that mean there are other ways I can include comments in queries?

    –Paul

    I know of one other way to comment result fields other than the one I used in that example. First, let’s review that method. Here’s the first result field in that article.

    Field       Expression                 Column Heading        Len   Dec
    SDNOT0      shipdt/(shipdt-0.0000001)  0=Ship date is zero     1     0
                                           1=ship date is not             
                                           zero                           
    

    In this example, I used the Column Heading entry fields to explain that SDNOT0 will have one of two values. Zero indicates that the ship date is zero, and one indicates that ship date is not zero.

    The other method of which I am aware is to define dummy result fields that you never refer to elsewhere. You can use not only the Column Heading entry fields, but also the Expression entry field, enclosing the comment text in quotation marks.

    Field     Expression                         Column Heading    Len   Dec
    COMMENT1  'The third character of the item   1=steel, 2=iron 
              number tells which metal the item  3=aluminum      
              is made of'                                        
                                                                   
    METAL     substr(itmno, 3, 1) 
    

    You will probably not want to include these comment fields in the “Select and sequence fields” panel.

    It’s not elegant, but as a rule, I don’t use elegant and Query/400 in the same sentence.

    –Ted

    RELATED STORY

    Query/400 Handles Zero Dates (Sort Of)

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Maxava

    Migrate IBM i with Confidence

    Tired of costly and risky migrations? Maxava Migrate Live minimizes disruption with seamless transitions.

    Upgrading to Power10, Power11, or cloud hosted system, Maxava has you covered!

    Book A Consultation Today

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Bug Busters Software Engineering:  Quality software solutions for the iSeries since 1988
    PowerTech:  Your security expert for the iSeries and AS/400
    COMMON:  Join us at the Spring 2007 conference, April 29 – May 3, in Anaheim, California

    Admin Alert: One Common Cure for SQL0901 Package Errors Expect i5/OS V5R5 in 2007, Power6 for System i Maybe in 2007

    Leave a Reply Cancel reply

Volume 6, Number 34 -- September 20, 2006
THIS ISSUE SPONSORED BY:

T.L. Ashford
ProData Computer Services
Twin Data

Table of Contents

  • Redirecting a List of Qshell Commands
  • Include Comments in Query/400 Queries
  • Admin Alert: Dissecting the Unusual QLGPGCMA.LOCALE Error

Content archive

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

Recent Posts

  • With Power11, Power Systems “Go To Eleven”
  • With Subscription Price, IBM i P20 And P30 Tiers Get Bigger Bundles
  • Izzi Buys CNX, Eyes Valence Port To System Z
  • IBM i Shops “Attacking” Security Concerns, Study Shows
  • IBM i PTF Guide, Volume 27, Number 26
  • 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

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