× 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.



On 10-Jun-2010 07:27, Tomasz SkorÅa wrote:

In some files I have numeric field1 8 length, 0 decimal, But in
other files related field2 is 8 length character with leading
zeros. i.e. 608093, 00608093
To join it in any report I created a temp file where I have
field1and field2 created by calling SQL statement:
INSERT INTO LIB/TEMP_FILE
SELECT FIELD1, DIGITS(FIELD1)
FROM PROD_FILE

Have you any idea how to create some logical file/view which
willhave DIGITS built in second field?
Calling SQL every time is quite painful.


Aside from the obvious and already suggested CREATE VIEW, if the data type of the numeric field is Zoned Decimal, the most efficient method to effect the same would be to create a logical file [CRTLF] from source which maps [redefines] the numeric field to a character data type and making that field a key in the logical file. The release was also not mentioned, but since v6r1, the logical file can be created instead as an SQL INDEX with the DIGITS function, and then querying the VIEW should be able to use that derived index when the TABLE is queried using SQL.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.