iSnare.com - Free Content Articles Directory
Authors Contents [Advanced Search][Add OpenSearch][Job Search]
Distribute your articles to thousands of article sites for only $2 and below! Read more...

Index  Computers and Technology
 

AS/400 Queries Are Easy As Pie

 
[ Contact the Author] [ Send to a Friend] [ Article Publisher] [Make PDF] [ Print] [ Bookmark & Share]
 
Read our Terms of Service before reprinting this article. The submitter specified above has claimed the rights to this article.
John Andersen

One of my all time favorite tools for creating reports, data lookup inquiry screens or custom file downloads for the AS/400 and iSeries platforms is IBMs very own Query/400. This is amazing tool is an additional licensed program but I find the cost worth it since it is a user friendly menu driven application and it makes creating custom reports a snap.

The first step is to actually create a Query/400 query definition by issuing the command WRKQRY. And the first option is to specify the file selections you will use for the query. This is where you tell query which file or files you will be using to create your report, so you will specify each file, library and member if the file has multiple members. If you need to add another file simply press the F9 key.

Once you have specified the files it is time to let query know how it is going to join them together, if you have any experience with SQL then this step should come naturally but if you aren’t familiar with SQL let me explain. The join operation tells Query/400 which fields match between the selected files so it can query them together at the same time and present the resulting data set as if it is one large logical file. On the join field you will typically select either matched records or matched records with primary file. In all my years of writing Query/400 queries I have not once needed to use the unmatched records option.

After choosing the matching type it is time to tell query what fields you are going to match by. Simply type in the first field with the test condition followed by the second matching field. If you are using multiple files and matching records with the primary file the first set of match fields will always be from the primary file and the second fields listed will be from the secondary files.

Now that you have the files joined together and the matching fields defined it is time to create the constraints by taking the option for select records. Once on the select records screen simply enter in the field you want to build the constraint on along with the test condition such as equal, not equal, greater than, data range and so on and the value. The value can be a constant, field name, number or more.

One feature I absolutely love about Query/400 is that if you are using multiple files it will automatically prefix all of the field names T01, T02 and so on. This makes it very easy to find the file and field name combination you wish to use and it completely eliminates problems with duplicate field names between files.

Now that you have defined the query constraints it’s time to actually run the report and see some data results, this can be done any time you are in query by using the F5 key. A word of caution though that if you are doing joins with multiple files the system may need to build a temporary index and this can take awhile depending on the data files in use and other factors used by the AS/400s query optimizer engine.

The last step I usually take after running the query a few times using F5 and making sure the report looks corect on the screen is to take the option to select output type and output form. Depending on the desired output of the query I will either select a printable report or display output type. If you choose printer there will be some additional options to configure like the addition or removal of a header page, which I typically remove to save the wasted sheet of paper.

Important NoticeDISCLAIMER: All information, content, and data in this article are sole opinions and/or findings of the individual user or organization that registered and submitted this article at Isnare.com without any fee. The article is strictly for educational or entertainment purposes only and should not be used in any way, implemented or applied without consultation from a professional. We at Isnare.com do not, in anyway, contribute or include our own findings, facts and opinions in any articles presented in this site. Publishing this article does not constitute Isnare.com's support or sponsorship for this article. Isnare.com is an article publishing service. Please read our Terms of Service for more information.

John Andersen is the marketing manager and editor for the AS400 Tutorials website. To get your free AS400 and iSeries courses check out AS400 Tutorials.

Article Tags: file [See Dictionary], files [See Dictionary], time [See Dictionary]
Got a question about this article? Ask the community!
Article published on August 24, 2009 at Isnare.com
 
Rate this article:

5 Simple AS/400 Data Download Techniques
Submitted by: John Andersen

One of the most common questions I get is how do I get the data from my AS/400 or iSeries onto my computer or Excel spreadsheet program so I can manipulate it using PC programs and spreadsheets...

AS400 Commands in a Nutshell
Submitted by: John Andersen

The AS/400 and iSeries systems are essentially command driven operating systems There are definite advantages to a command line driven environment but nowadays with the widespread popularity of GUIs people seem to recoil when talking about anything command driven...

AS400 Operations Navigator to the Rescue
Submitted by: John Andersen

There is a large misconception running about the user community these days that the AS/400 and iSeries platform are old antiquated machine as scarce as the dinosaurs and just as hard to use with its crummy looking text only interface commonly known as the green screen...

Four Day to Day AS400 Commands You Need to Know
Submitted by: John Andersen

The operating system that natively runs on the AS/400 and iSeries platform is a command and menu driven system, so it’s important that you have a good understand of how to use commands and in particular become familiar with commands you will use regularly...

The Coolest AS/400 Program Ever
Submitted by: John Andersen

By far the one of the coolest programs and most commonly used on the AS/400 and iSeries platforms is the Work with Active Jobs display that is built into the operating system...

Are Your Saving the Right AS/400 Data
Submitted by: John Andersen

Keeping correct data backups of any enterprise system is a critically important task for any system administrator...

The ISeries is the 21st Century Business Platform
Submitted by: John Andersen

IBMs midrange platform AS/400 and iSeries systems are definitely the systems for the 21st century Having worked on these systems for ten years I admit it, I’m a bit slanted towards there reliability, functionality and processing power...

AS/400 Data Tools Make Your Life Easier
Submitted by: John Andersen

At the core of every AS/400 is the built in DB2 database that is tightly integrated into the operating system...

Midranges Are Still Alive and Kicking
Submitted by: John Andersen

Rumors, stories and myths abound about the death of the fabled AS/400 and successor iSeries system made popular when release by IBM nearly thirty years ago...

Don't Ruin Your Laminator - 4 Reasons to Always Use a Carrier With Your Pouch Laminating Machine
Submitted by: Jeff McRitchie

One of the most important supplies you'll need when getting ready to use a pouch laminator is a carrier...

GBC ShredMaster CC195 Cross-Cut Shredder Review
Submitted by: Jeff McRitchie

If you've visited an office supply store recently or checked out paper shredders on the Internet, it probably seems like paper shredders are all alike, especially in the looks department...

Frequently Asked Questions About Spiral Coil Binding
Submitted by: Jeff McRitchie

Coil binding - also known as spiral binding - is a very popular method of binding, but it can be difficult to understand how it's done...

An Overview of the GBC C-75 Comb Binding Machine
Submitted by: Jeff McRitchie

If you are looking for an inexpensive comb binding machine for your office or home office you might be considering the GBC C75...

5 Great Features of the Rhin-O-Tuff HD6500
Submitted by: Jeff McRitchie

Designed for the heaviest duty users such as print and copy shops, binderies and large organizations, the Rhino Tuff HD6500 is a machine that offers top of the line flexibility and capacity...

Comparing the Swingline SmartCut EasyBlade and EasyBlade Plus Rotary Trimmers
Submitted by: Jeff McRitchie

At first glance, Swingline's SmartCut EasyBlade and EasyBlade Plus may look very similar, except for the price...

Five Reasons to Consider the Rhino-Tuff OD4000 Modular Binding Punch
Submitted by: Jeff McRitchie

Though it may be the smallest of Rhino's electric interchangeable punches, the OD4000 offers you about as much as a binding punch can offer...

DirectAccess Takes the Place of VPN For Windows Seven
Submitted by: Gregg Housh

Microsoft has unveiled Direct Access for Windows 7 and Windows Server 2008, remotely connecting users to their office as if they were right there...

Choosing a Guillotine Style Paper Cutter
Submitted by: Jeff McRitchie

An important piece of equipment to have in your copy room or work area is a guillotine paper cutter Guillotine paper cutters can help you quickly trim large stacks of paper...

Sony Ericsson W595 Mobile Phone Review - The Latest and Best Walkman Phone?
Submitted by: Carlson Osbourne

The one thing that most Sony Ericsson phones have in abundance is good looks No matter what lies beneath the surface, they all tend to have unique and beautiful appearances that can enhance the style factor of everyone using them...

Sony Ericsson W705 Mobile Phone Review - Tune Into the Beat With the Ultimate Walkman Phone
Submitted by: Carlson Osbourne

Sony Ericsson is known the world over for their amazingly functional and stylish mobile phones It is easy to see why when you take a look at some of the handsets that they have produced over the years and one of their latest additions to the Walkman range can be added to that illustrious list...

Notebook - Smart Shopping Tips
Submitted by: Roberto Sedycias

There are many choices of notebooks and sometimes it is hard to find the appropriate notebook that represents the true value for money...

The Many Applications of GPS Cell Phone
Submitted by: Roberto Sedycias

GPS is known to navigate global positioning easily and is widely used in vehicle tracking and map navigation, benefiting people in their daily needs...

Things To Know About Formatting Your Memory Card
Submitted by: Lance Edwards

If you use a new memory card on your digital camera for the first time you should always format it, or it may not store your photos correctly...

Choosing a Scanner
Submitted by: Lorraine Vybihal

When choosing a scanner for your business, there are many things you need to consider You need a scanner that is fast, reliable, and that will increase your overall productivity...

Isnare.com Footer Divider

© 2004-2009. Isnare Free Articles - An Isnare Online Technologies Free Articles Project. All Rights Reserved.   Privacy Policy