BCD Websmat



HOME    SUBSCRIBE

  Midrange Guru - OS/400 Edition

Editors: Ted Holt and Howard Arner     Managing Editor: Mari Barrett

This issue of the OS/400 Edition of Midrange Guru is sponsored by:

Symtrax
Business Computer Design, Int'l, Inc.
COMMON

Topics Covered In Volume 1, Number 3:

Removing A Character From A Character Field

Hey, Ted :

Is it possible through SQL to remove a character from a text field? I have a file that has a name field with the last name first and first name last. Some of the records were keyed with a comma separating the two names, as in SMITH, JOHN. Other records have no comma. I would like to remove the commas. The names are all different lengths so I can't use any kind of constant length.

Yes, SQL can handle this problem for you. First, select the records that have the comma, because those are the only ones you want to update. I doubt you have any records with a comma in the first position of the field, but just in case, exclude them by checking for a comma anywhere after the first position.

select * from customer
where position (',' in custname) > 1

Use the position function again to extract the last and first names, which precede and follow the comma.

select custname,
substr(custname,1,position (',' in custname) - 1)
concat
substr(custname,position(',' in custname) + 1)
from customer
where position (',' in custname) > 1

Now that the select is working correctly, convert it to an update statement.

update customer
set custname =
substr(custname,1,position (',' in custname) - 1)
concat
substr(custname,position(',' in custname) + 1)
where position (',' in custname) > 1

Be sure to try this on a copy of the production file first to verify that your SQL command will work correctly.

-- Ted  

 

 

NEW SYMTRAX capabilities save more time and money!

Download FREE evaluation copies of COMPLEO and the "NEW" SYMTRAX REFORM at

http://www.symtrax.com/fhn

Award-winning COMPLEO reformats to XLS, HTML, PDF, and more, eliminating labor-intensive rekeying.

SYMTRAX REFORM painlessly adds custom electronic forms. Automate the complete process!

Call (800) 627-6013 or email us at sales@symtrax.com



 

 

ATTEND COMMON IN MINNEAPOLIS OCT 21-25

Join thousands and receive the iSeries IT education you need at the COMMON User Group's Fall 2001 Conference October 21-25 in Minneapolis. Complete information is available at http://www.common.org/Conferences/conf.html

Right now, read what a $995 registration gives you:

You'll choose from over 800 session hours that cover such vital topics as Web development, Java, VPN, WebSphere, Client Access, RPG IV, and Linux. Select the exact education you need and make yourself the problem solver in your organization.

Also, because we'll only be 1 1/2 hours from Rochester, Minnesota, you'll learn more than ever before about the iSeries. More IBMers will be in attendance, and this is a golden opportunity to share ideas with them.

In addition, you'll network with top iSeries professionals and exchange e-mail addresses. This connects you with the people who can help you accomplish more for your company.

To register online and/or become a member go to http://www.common.org/Conferences/confnew.html

Most important: Take action now. Register for the COMMON IT Education Conference, because there's no faster way to increase your value to your organization.




 

Subscription And Advertising Information

Subscription Information

To unsubscribe, change your email address, or sign up for any of Guild Companies, Inc's free email newsletters, visit http://www.itjungle.com. Hit the SUBSCRIBE button on the homepage and it will lead you to our online subscription system.

When you sign up for one of our e-newsletters, you can be assured that your e-mail address will NEVER be sold to an outside company.

Advertising Information

Please contact Timothy Prickett Morgan at

Phone: 212 942 5818

Email: tpm@itjungle.com

Which CL Messages Should I Monitor?

Hey, Ted:

Our programmers need a list of the error messages that can be monitored in CL programs. Such a list used to appear in the Programming Reference Summary manual. I've looked in the Information Center and it refers me to the CL manual, which doesn't give me the error messages to monitor. I have an OS/400 V3 manual, but we are currently running OS/400 V4R5, and many new commands have been added to the CL language since then. How can I get a list of error messages?

Here's how. The iSeries Information Center does provide a list of commands that can be monitored. Each command is followed by its syntax diagram. The iSeries Information Center's alphabetical listing of commands can be found at http://as400bks.rochester.ibm.com/pubs/html/ as400/v5r1/ic2924/info/rbam6/rbam6alphatable.htm.

But there's an easier way to look them up. From a command line or within OS/400's Screen Entry Utility (SEU), type the name of the command that you want to monitor and press F4 to prompt it. The cursor will be positioned to the first entry field. Move the cursor up to a higher line and press F1 to get the help text for the command. Within the help text, you will see the escape, status, and notify messages that can be monitored.

-- Ted

 

 

Save time and money by doing fast, easy automated or end-user driven iSeries400 Report Distribution, e-mailing, Data Extraction... with the #1 Voted industry tools. Streamline the workflow process!

Whether you want to view reports online with a point & click download feature, or automate the entire process of downloading, converting & distributing reports, you need the right tools:

CATAPULT--Voted the #1 Automated Email Report Distribution tool for 2001. Automatically distribute via email, download and archive reports. Splits reports. Distributes them in the desired format. Converts to HTML, PDF, RTF, TIF. Uses AFP files.

Award winning Spool-Explorer/400 -- End users point and click to view / download reports. Converts to PDF, HTML, RTF... New version 3! Generate bookmarks and hyperlinks based on report contents... more.

Interfaces to EZ-Pickin's or Monarch for powerful data extraction and report mining, update Excel / Access spreadsheets... and so much more.

Also try WebSmart, voted best eBusiness / eCommerce Development and Deployment tool for 2001.

See the difference for yourself. Download and try CATAPULT, Spool-Explorer, EZ-Pickin’s -or- WebSmart now for FREE or get a FREE CD and you'll be more productive the very first day.

Call 630-986-0800 for more information, or visit our Web site at http://www.BCDsoftware.com



 


Reader Feedback And Insights

One of the great things about the OS/400 community is that it is indeed a community. We may be all working from our cubicles, but we are all connected and trying to figure out how to best employ the computer technology at our disposal. There are more than a few ways to skin any cat, and if you have a clever and unique answer to a problem that one of our Midrange Gurus has solved, we'd love to hear from you. This newsletter is an open dialog, and we value your input as well as your readership.

It goes without saying--but we'll say it anyway--that your hard technical questions pertaining to real world problems are equally valuable as a foundation for this newsletter as are your programming insights. We hope you find all the editions of Midrange Guru valuable, and we are going to work hard to make sure that they are.

Contact the Editors

If you have a tough problem, our gurus can probably help. Their mailboxes are always open.

* Email Ted Holt at tholt@itjungle.com

* Email Howard Arner at harner@itjungle.com

BCD Websmat

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved. This document may be redistributed freely and enthusiastically by email, but only in its unedited form. Thanks for your cooperation. Midrange Guru is a registered trademark of Guild Companies, Inc. IBM, AS/400, iSeries, OS/400, and eServer registered trademarks of International Business Machines Corp. All other product names are trademarked or copyrighted by their respective holders.