• 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
    Computer Keyes

    Fax Directly from your IBM i

    KeyesFax is a full function automated IBM i fax system. Spooled files are burst by fax number and auto transmitted with overlays.  It combines both a send and receive facsimile processing system with a complete image package.

    The fax software will edit, send, receive, display, print, and track fax documents or images using any standard IBM i without additional expensive hardware, software or subscriptions.

    Computer Keyes has been developing Software Solutions since 1978!

    www.computerkeyes.com

    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

  • Tool Aims To Streamline Git Integration For Old School IBM i Devs
  • IBM To Add Full System Replication And FlashCopy To PowerHA
  • Guru: Decoding Base64 ASCII
  • The Price Tweaking Continues For Power Systems
  • IBM i PTF Guide, Volume 27, Numbers 31 And 32
  • You Can Now Get IBM Tech Support For VS Code For i
  • Price Cut On Power S1012 Mini Since Power S1112 Ain’t Coming Until 2026
  • IBM i: Pro and Con
  • As I See It: Disruption
  • IBM i PTF Guide, Volume 27, Number 30

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