|
Vern, Y'all know that I like SQL. However I have a question with your statement "This is a case where SQL & Query/400 both have an advantage over join logicals, because the joins are not limited to linking to the primary." What about this: * ADDLFM FILE(MGR1499SID/ZDATAW) MBR(ZDATAW) * DTAMBRS((SAFETYF/AUDIT (AUDIT)) * (SAFETYF/AUDITINCID (AUDITINCID)) * (MGR1499SID/LOCATION (LOCATION)) * (MGR1499SID/EMPNAM (EMPNAM)) * (SAFETYF/INCIDENT (INCIDENT)) * (SAFETYF/STATUSES (STATUSES)) * (MGR1499SID/EMPNAM (EMPNAM)) * (MGR1499SID/COMPNAME (COMPNAME)) * (SAFETYF/INCIDENTT (INCIDENTT)) * (MGR1499SID/EMPNAM (EMPNAM)) * (MGR1499SID/DIVISION (DIVISION)) * (MGR1499SID/EMPNAM (EMPNAM))) * Modification log: * 06/11/97 by R.Berendt, CCP GDS, LLC * Added field TAKEACTION from INCIDENT. This field * is the 'Action to be taken' * JDFTVAL R ZDATAWR JFILE(AUDIT AUDITINCID + LOCATION EMPNAM INCIDENT + STATUSES EMPNAM COMPNAME + INCIDENTT EMPNAM DIVISION + EMPNAM) J JOIN(1 2) JFLD(AUDIT# AUDIT#) JDUPSEQ(SEQUENCE#) J JOIN(1 3) JFLD(LOC LOC) J JOIN(1 4) JFLD(AUDITOR# EMPLY) J JOIN(2 5) JFLD(INCIDENT# INCIDENT#) J JOIN(2 6) JFLD(STATUS STATUS) J JOIN(3 7) JFLD(MANAGR EMPLY) J JOIN(3 8) JFLD(ENTITY COMP) J JOIN(5 9) JFLD(INCIDENTYP INCIDENTYP) J JOIN(8 10) JFLD(MANAGR EMPLY) J JOIN(8 11) JFLD(DIV DIV) J JOIN(11 12) JFLD(MANAGR EMPLY) AUDIT# JREF(1) LOC JREF(1) LOCNAME JREF(3) RENAME(NAME) LOCMGR JREF(3) COLHDG('Location' + 'Manager') RENAME(MANAGR) LMNAME JREF(7) COLHDG('Location' + 'Manager') RENAME(NAME) ENTITY JREF(3) CMPMGR JREF(8) COLHDG('Company' + 'Manager') RENAME(MANAGR) CMNAME JREF(10) COLHDG('Company' + 'Manager') RENAME(NAME) DIV JREF(8) CMPNAME JREF(8) COLHDG('Company') + RENAME(DESC40) DIVNAME JREF(11) COLHDG('Division') + RENAME(DESC40) DVMGR JREF(11) COLHDG('Division' + 'Manager') RENAME(MANAGR) DVNAME JREF(12) COLHDG('Division' + 'Manager') RENAME(NAME) DATEAUDIT 8S 0 JREF(1) + EDTWRD(' / / ') DATAUDMM I SST(DATEAUDIT 5 2) DATAUDDD I SST(DATEAUDIT 7 2) DATAUDYY I SST(DATEAUDIT 3 2) AUDITOR# JREF(1) COLHDG('Auditor') AUDNAME JREF(4) COLHDG('Auditor') + RENAME(NAME) DATEREPORT 8S 0 JREF(1) + EDTWRD(' / / ') DATREPMM I SST(DATEREPORT 5 2) DATREPDD I SST(DATEREPORT 7 2) DATREPYY I SST(DATEREPORT 3 2) SEQUENCE# JREF(2) INCIDENT# JREF(2) INCIDENTYP JREF(5) INTYPDESC JREF(9) SHORTDESC JREF(5) REGULATION JREF(5) ACTION JREF(5) PENALTYAMT JREF(5) TAKEACTION JREF(5) STATUS JREF(2) STATUSDESC JREF(6) PRIORITY JREF(2) DATEDEADL 8S 0 JREF(2) + EDTWRD(' / / ') DATDEDMM I SST(DATEDEADL 5 2) DATDEDDD I SST(DATEDEADL 7 2) DATDEDYY I SST(DATEDEADL 3 2) DATECLOSE 8S 0 JREF(2) + EDTWRD(' / / ') DATCLOMM I SST(DATECLOSE 5 2) DATCLODD I SST(DATECLOSE 7 2) DATCLOYY I SST(DATECLOSE 3 2) COMMENTS JREF(2) DOCID10 JREF(2) K AUDIT# This is an actual file in production. (Back before my SQL days.) Sure makes Queries for the users a LOT easier. Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com
As an Amazon Associate we earn from qualifying purchases.
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.