HP3000-L Archives

December 2006, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Eben Yong <[log in to unmask]>
Reply To:
Eben Yong <[log in to unmask]>
Date:
Mon, 4 Dec 2006 23:49:43 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (34 lines)
Is there a way, in Quiz, given String X, length 30, and String Y, length 2, to 
do the following?

1.  remove spaces from both left and right side of string X
2.  check to see if the last 2 characters of the result from #1 match String Y
3.  check to see if the 3rd to the last character of the result from #1 equals 
SPACE
4.  if #2 and #3 are true then assign String Z to the portion of the result from 
#1, less 3 characters

In Visual Basic, the code would go something like this:

if right(trim(X),2)=Y and mid(trim(X),len(trim(X))-2,1)=" " then Z=left(trim
(X),len(trim(X))-3)

The business objective is to split a string which *might* have the state code 
embedded into the city field such that we isolate the string value representing 
the city (e.g., SACRAMENTO CA transforms to SACRAMENTO; or BUFFALO NY 
transforms to BUFFALO).  So, from the above example, String X contains the 
CITY and (maybe) the STATE code.  String Y = the STATE code.  We wish to 
extract String Z (the CITY value).

I've dumped the data to MS ACCESS and achieved the desired results using 
MS Access SQL, and am interested in performing the actions on the HP3000.

Any takers?  :-)

As always, thanks to the MPE gurus out there.
-Eben Yong
[log in to unmask]

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2