× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Luc,

I agree, default edit codes or words would be nice. However they are very
limited as to where they are used. For example, let's take this DDS file:
R LUCR
NBRFLD 9P 0 EDTWRD(' - - ')

If I compile that and punch in two records and then run RUNQRY
QRYFILE(LUC) I get:
....+....1.
NBRFLD
123-45-6789
987-65-4321

All well and good. However if I pull that into Excel I get
NBRFLD
1.23E+08
9.88E+08
Then I adjust my column width and I get:
NBRFLD
123456789
987654321

Where's my editing? How would that appear on a web screen (by "default")?

Let's try this instead. If run this wee bit of sql:
CREATE TABLE ROB/LUC2
(NBRFLD DEC(9,0))
RCDFMT LUC2R;

CREATE FUNCTION ROB/SSN(INPUT DEC(9,0))
RETURNS CHAR(11)
RETURNS NULL ON NULL INPUT
LANGUAGE SQL
BEGIN
DECLARE CHARNBR CHAR(9);
DECLARE SSN CHAR(11);
SET CHARNBR = CHAR(INPUT);
SET SSN = SUBSTR(CHARNBR,1,3) CONCAT '-' CONCAT
SUBSTR(CHARNBR,4,2) CONCAT '-' CONCAT
SUBSTR(CHARNBR,6,4);
RETURN SSN;
END;

CREATE VIEW ROB/LUC2VIEW AS (
SELECT NBRFLD, SSN(NBRFLD) AS SSNFMT
FROM LUC2)
RCDFMT LUC2VIEWR;

and then I run this:
select * from rob/luc2view
I get:
NBRFLD SSNFMT
123,456,789 123-45-6789
987,654,321 987-65-4321

Now, when I pull this down into Excel the column SSNFMT looks like:
SSNFMT
123-45-6789
987-65-4321

And there's nothing that says that different regions cannot have their own
version of the SSN function.
The SSN function itself could have logic in it to reformat based on
region.


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.