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



Ok, I had that backwards, you're using an index, not a view. And it's
totally unusable by sql, RUNQRY QRYFILE(...), etc.

CREATE INDEX ROB/AAAKEYL1
ON ROB/AAAKEY
(CONAME AS BIGLONGNAME FOR SHORTNAME)
WHERE LOC='A'
RCDFMT AAAKEY1R
ADD SYSTEM, DBLIB

Name of LF is AAAKEYL1
Based on PF AAAKEY
Key field is CONAME renamed to BIGLONGNAME and a new short name of
SHORTNAME.
Where clause available now on index
Have to have that record format name in RPGLE file operations.
Add additional columns from table that you want to appear in index. Too
bad you can't rename those here also.

select * from rob/aaakeyl1
AAAKEYL1 in ROB not table, view, or physical file.

DSPFFD ROB/AAAKEYL1
Field Level Information
Data Field Buffer Buffer Field Column
Field Type Length Length Position Usage Heading
SHORTNAME CHAR 40 40 1 Both COMPANY
NAME
Field text . . . . . . . . . . . . . . . : COMPANY NAME
Alternative name . . . . . . . . . . . . :
BIGLONGNAME
Renamed field . . . . . . . . . . . . . . : CONAME
SYSTEM CHAR 8 8 41 Both AS/400
Field text . . . . . . . . . . . . . . . : NAME OF AS/400
DBLIB CHAR 10 10 49 Both DBLIB
Field text . . . . . . . . . . . . . . . : NAME OF LIBRARY

*************** Beginning of data
FAAAKEYL1 IF E K DISK
/free
*inlr=*on;
read aaakey1r;
dsply shortname; // will find nothing because of WHERE clause
/end-free
****************** End of data ***

Compile listing:
IAAAKEY1R
*------------------------------------------------------
* RPG record format . . . . : AAAKEY1R
* External format . . . . . : AAAKEY1R : ROB/AAAKEYL1
* Format text . . . . . . . : FORMAT0001
*------------------------------------------------------
I A 1 40 SHORTNAME
I A 41 48 SYSTEM
I A 49 58 DBLIB


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.