My problem is that I can't join the tables on a certain field. Can anyone think of a fancy way i may be able to use a where clause, or a like clause, or something..or do some fancy awk work on this?
Hi jeffs42885,
You've been with us for well over eight year now. You know we always want to know what operating system and shell you're using, what you have tried to solve this problem on your own, what you have done that is working well, what you have done that isn't getting the output you want, and where you are stuck?
Please give us the above details. Please help us help you.
I have tried various joins on fields that I thought were similar..and other queries.
I did this to get a listing of the application ID's based on the table names-
select substr(tabname,1,3) from syscat.tables where LENGTH(tabname) = 4 and tabschema='ROOT'
I am stuck here. This is where my skill runs out sadly. I have ideas, just not sure how to implement them, or even how to put them into words!
--- Post updated at 06:27 PM ---
Here's some progress, I think
This output gives me about 90 or so rows, probably more in production that I will need to use below. Snippet-
db2 => select syscat.tables.tabname from syscat.tables where length(tabname)=4 and tabschema='ROOT'
TABNAME
--------------------------------------------------------------------------------------------------------------------------------
ACA1
AKA1
AZZ1
BHY1
BJA1
....
The column header isn't correct but the results are when I manually did a count from AKA1 and ACA1.
db2 => select distinct DOCUMENT, 'ACA1' as ID from ACA1 union all select distinct DOCUMENT, 'AKA1' as AKA1 from AKA1
DOCUMENT ACA1
----------- ----
15FAAA AKA1
31FAAA AKA1
31FAAZ AKA1
2FAAA ACA1
My next step, is to figure out how to add another column or field to that.
Basically, if column2(AKA1) like "%something" aka (AKA) - add a field next to it. Use an output file to create it. That file looks like this...