fhg
Volume 6, Number 34 -- September 20, 2006

Include Comments in Query/400 Queries

Published: 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)



Sponsored By
PRODATA COMPUTER SERVICES

Save the day with RSP and ProData utilities!
DBU...database access made simple:
DBU Audit...log changes & views made via DBU
DBUnifier...unify database apps & dump DFUs!
RSP...RPG Server Pages for Web enablement
STE...Stored Procedure Test Environment
SQL/Pro...query & reporting tools

 

All NEW ServerProven products that are virtually FREE with IBM's rebate offering!

 

Sign up to Win a Video iPod!

800.228.6318
http://www.DoDBU.com



Senior Technical Editor: Ted Holt
Technical Editors: Howard Arner, Joe Hertvik, Shannon O'Donnell, Kevin Vandever
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Brian Kelly, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

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

 


 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement