× 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 02-Jul-2010 00:36, David FOXWELL wrote:

After running a test procedure, I found the results of the
program comparing the test results with the previous test very
difficult to read. The output file being compared contains
various dates in different formats. My modification changed
nearly all these dates among other things, so I ended up having
to read a very large spool file as all the test cases were
affected.

I tried select fld1, fld2, etc from testfile union select fld1,
fld2, etc from savedtestfile, ignoring the different date fields.
The test cases having 2 lines in this select were those I
wanted.

As the file in the select has a lot of zones, the sql wasn't easy
to code. I had to select all fields, then find those I didn't
want, delete them from the statement and copy the first half of
the statement to the second half.

Eg, select fld1, fld2, ....fld100, from testfile

delete fld3, fld74, etc from statement.


Could I achieve this any easier?


Unfortunately SQL does not have an OMIT column list to correlate to a column list of name.* on the select-clause; i.e. as a request to include all columns, there is no ability to exclude columns with any subclauses such as in the following pseudo-SQL SELECT statement using a non-existent OMIT clause as a subclause of the SELECT-clause:

SELECT RRN(A) AS R,A.* OMIT A.F3, A.F74 FROM TESTFILE AS A

One option would be to duplicate each file with data to another file, then ALTER TABLE EachDuplicate DROP COLUMN FLD3 DROP COLUMN FLD74 or possibly since v6r1 to issue ALTER TABLE on each, to ALTER COLUMN on FLD3 and FLD74 to make those columns IMPLICITLY HIDDEN such that the asterisk as the SELECT list notation would exclude those columns.
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/db2/rbafzselectnotation.htm

FWiW any good prompted SQL interface should probably have a manner to easily effect "select all" of the columns [seems not so with STRSQL, which also means STRQM; i.e. no F21=select all from the "select and sequence fields" panel]. The resultant statement should then be able to be copied\pasted or saved to a file. Also note that a recursive query of the SQL catalog [syscolumns or equivalent] or of a DSPFFD output file should be able to generate a column list [I have posted an example here in the past] in a report as a varchar one-line result. Similarly, but as a line per column, the following query can easily produce a select list of all columns:

<code>

select
case colno when 1 then ' ' else ',' end concat sys_cname
from qsys2/syscolumns /* or modify & use DSPFFD OutFile */
where sys_tname='TESTFILE' and sys_dname='TheLibName'
/* and sys_cname not in ('FLD3', 'FLD74') */
order by colno

So for QCUSTCDT in QIWS, the result of the above query:

....+....1....+..
String Expression
CUSNUM
,LSTNAM
,INIT
,STREET
,CITY
,STATE
,ZIPCOD
,CDTLMT
,CHGCOD
,BALDUE
,CDTDUE
******** End of data ***

</code>

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.