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



John Candidi wrote:
How do you add an index to fields in a physical file
which was defined in COBOL without recreating the file?


Presumably "defined in COBOL" means the file declared\referenced in\by the COBOL; i.e. an externally described PF was created using SQL or DDS. In that case, then either of ADDPFCST CL command or the ALTER TABLE ADD CONSTRAINT SQL statement, to add either a PRIMARY KEY constraint or a UNIQUE constraint would suffice; note: these require MAXMBRS(1) for the physical, if it was created using CRTPF. If the desired key can not be unique, then the best option [to avoid re-creating the PF with the desired key fields] is to create and then use a keyed LF over the PF; created either by DDS with CRTLF or SQL CREATE INDEX SQL statement. I prefer to use the LF approach anyhow, to use only constraints for any keys in a physical.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.