• 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 or cloud hosted system, Maxava has you covered!

    Learn More

    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

  • 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
  • Big Blue Raises IBM i License Transfer Fees, Other Prices
  • Keep The IBM i Youth Movement Going With More Training, Better Tools
  • Remain Begins Migrating DevOps Tools To VS Code
  • IBM Readies LTO-10 Tape Drives And Libraries
  • IBM i PTF Guide, Volume 27, Number 23

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