Home > Ask the AS/400 Experts > iSeries Application Development Questions & Answers > Searching part of a name or address in AS/400
Ask The iSeries 400 Expert: Questions & Answers
EMAIL THIS

Searching part of a name or address in AS/400

John Blenkinsop EXPERT RESPONSE FROM: John Blenkinsop

Pose a Question
Other iSeries 400 Categories
Meet all iSeries 400 Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 15 April 2008
When working with AS400, can you query or search on part of a name or address?

>
Yes; but this, of course depends on what you mean by 'search.'

If you are referring to an application on your AS/400, it depends on the application. Either it allows such a search or it doesn't.

If you are referring to a programming language such as SQL or RPG, then of course you can write code to do the search. In ILE RPG, the code would look like this:

C If D1FIND <> *Blank and

C %Scan(%Subst(D1FIND:1:%Len(%TrimR(D1FIND)))

C :%Xlate(L_Case:U_Case:D#SFLN)) = *Zero

C Eval RecFound = *Off

C EndIf

...where the field to be searched is D#SFLN, and may contain both upper and lower case text. The field containing the word to search for is D1FIND, which can only contain upper case text. The code will turn OFF the indicator field RecFound if the search word is NOT found in the field to be searched.

So, if your address line contains '22 Murray Avenue, Nome, Alaska' and your search field contains 'OME', this scan will convert the D#SFLN data to all upper case, then conduct the scan, and will find the search term in the string.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries Application Development
Monitoring escape messages and using RCVMSG for diagnostic messages
Listing contents of multiple FTP directories on AS/400
Chain operation error after converting RPG3 to ILE RPG (RPGIV)
Space offset X'0015FF00' or X'0000000000000000' is outside current limit for object QIGC2424C
Searching fields for values
iSeries application display subfiles with other program windows
Passing parameters in an ILE RPG module
What's happening to my subfile?
What happening to my subfile?
What is a Decimal Data Error?

iSeries ILE programming
Tracking data changes on IBM i with triggers
Introduction to SQLRPGLE on IBM i: Making a report
How to use an embedded SQL statement and display the result in a subfile
Eight steps for creating program documentation using AS/400 utilities
Searching fields for values
Top 10 programmer tips YTD
How to use the binder language to manage service programs -- Part 3: Examples and pitfalls
Top 10 programmer tips of 2005
Understanding the binder language on AS/400
How to use the binder language to manage service programs -- Part 1: Service program signatures

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



iSeries Networking - Printing, Remote Access, TCP/IP
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts