Monday, September 30, 2013

Course on the psalms has taken shape quickly

My course on the psalms has taken shape - I have learned to upload videos myself! and I even put together a playlist so you can find the psalm to be heard at the beginning of each session. (But who would use such things when ads are inserted into them?) If you want to take the course - go ahead and do it - it is free. The only cost to you is the learning time (priceless) and the cost of a copy of the book (cheap). You can use any Psalter or translation of the psalms in any Bible but it will be harder to do the exercises because you won't have the recurrence tables - and you would benefit from them.

The blogger editor keeps losing my playlist - can you believe it?  What did my playlist do to get lost - so the six psalms for the six sessions are the following:

  1. Purcell, Jehova quam multi sunt hostes mei? (Psalm 3)
  2. Bairstow, Lord thou hast been our refuge (Psalm 90 and others)
  3. Handel, Dixit Dominus (Psalm 110)
  4. Bernstein, Psalms 2 / 23
  5. Gibbons, Psalm 47 O Clap Your Hands Together
  6. Vantoura, Psalm 96 - Sing to יהוה a New Song

All six video sessions are uploaded. If you want to use the course for adult education in a church - please let me know with a comment. I am happy to answer questions or even participate remotely. If there is a version 2 of the video - use that one and ignore version 1.

I have taught bits of this course live in several places - but the whole is new in this form - I expect it will change over time and grow once I have taught it live, something which I hope will happen soon in my own home town.

If you want me to teach the course - I will if we can figure out how to get me where I need to be for the amount of time needed. We could squeeze the course into two days - but it is more effective over several weeks of learning.

My motivation is to spread the word about how good the Psalms are.

Sunday, September 29, 2013

Videos available for Seeing the Psalter

There are currently several videos available and in production related to Seeing the Psalter.
  • The first was given live at the conference on Digital Media and Sacred Text in London at The Open University in June 2013. It is here on you-tube. It had also been presented earlier to high school students at Pacific Christian School and between services on Sunday morning at Spokane Cathedral.
  • The second is the first of a series of 6 lectures, [now all done] all the rest of which are in various stages in my office. The six are intended as an online course - which I also hope to deliver in my home base and to anyone who wishes on the road.  But equally, I am preparing course material so that the sessions could be run by individuals and groups anywhere.
These with Power Point slides can be made available to anyone who wants to teach the psalms. They are designed to be used over a period of six weeks by a group of students. There is substantial homework and workshop time. Let me know if you are interested at stenagmois at gmail.com.

Friday, September 27, 2013

New things in Science

Geometry trumps endless math - the Amplituhedron
Locality is the notion that particles can interact only from adjoining positions in space and time. And unitarity holds that the probabilities of all possible outcomes of a quantum mechanical interaction must add up to one. The concepts are the central pillars of quantum field theory in its original form, but in certain situations involving gravity, both break down, suggesting neither is a fundamental aspect of nature.
Gravity is trumping some fondly held beliefs that are seen only from a human point of view. Curiouser and curiouser said Alice

Thursday, September 26, 2013

Thoughts about youth, money, power, mental illness, and religion

Yes - pray for your enemies. This is a description of the wicked from Psalm 36 - very curious this oracle... My attention was drawn to the word 'divided'.  We are 'divided' against ourselves. So the horror at the mall, the site of the middle class consumer, in Nairobi comes from those who are divided against themselves even as I can be divided against myself.

This is a tough one, isn't it. I find a great tension between faith and futility. This "oracle on the wicked in my heart" speaking of the wicked that "divides itself in its own eyes to find hate for its iniquity" makes me think that the poet considered that I also am capable of great sin. (Augustine agreed). So the poem closes with a prayer: "do not let a proud stride come to me nor the hand of the wicked make me waver".

But this is far from enough. The middle section of the poem speaks of all humanity "they will be saturated from the fatness of your house and the torrents of your enthrallment they will drink".

Have we missed something?

I recall from The Two Solitudes, by Hugh MacLennan, Athenase, beginning his own writing of a book on religion, writes this:
The basis of all religious belief is the child's fear of the dark. When the child grows into a man, this fear appears to lie dormant, but it is still in him. He invents a system of beliefs to render it less terrible to him. Among primitive tribes we call these beliefs superstitions, but among civilized nations they are masked by the honoured name of religion. God, therefore is mankind's most original invention, greater even than the wheel...
Athenase, French Canadian, member of Parliament, is at ease in his hometown, Saint-Marc des Erables, where he is (in 1917) "the only limit under God and the law to the priest's authority".  This is a fine book and I have just begun to explore it. The authority of the Church keeps the people in line. The priest had told the seven-year-old Paul, Athenase's son by his second marriage, "all about hell and how the fire was real except that it replenished the flesh the instant it burned off so the burning went on forever". The youth are branded with this fear and so kept under the control of the parish which in turn will benefit from the proposed factory for the town around the production of electricity from the powerful falls. The priest might well know the disadvantages of the factory, but the "bishop would certainly see advantages ... percentages of all pay envelopes could be channeled to the Church".

We certainly don't want to go back to such a structure, now thoroughly discredited by scandal. What simpler days! - not a chance. The same powers that exercised rule then continue to exercise it today, but are they adequate to the need?
Youth as terrorist or youth as suppressed by fear. What kind of choice is this? - surely both futility.

Now what about the market and the dream of riches? Will this do as motivation and explanation for reality? Who cares for those who don't make it within the market? I am more aware of mental health issues in North America than I was when I was a child. Part of the reason has been diminished funding for mental illness in Canada and the US and the increased visibility of the mentally ill. A statistic from 2002 is that 20% of Canadians suffer some form of mental illness during their lives and that the cost to society will be in the order of $50 billion over the next 30 years. Mental illness therefore affects all of us and is a part of our homeless problem and is also contributing to the problems that land people in the prison system. What gives a person manageable control over fear, terror, and what gives us the ability and motivation to care for the weak of our society and not to fear fear where there is no fear (Psalm 53)? Have we the sense to use even money sensibly? (See this well summarized study from the Canadian government: http://www.phac-aspc.gc.ca/publicat/miic-mmac/pdf/men_ill_e.pdf.)

On the subject of the American dream and the market, see the recent post from OUP: http://blog.oup.com/2013/09/private-equity-hedge-funds-regulation/.
Millions of people are angry, and many millions more are simply frustrated. At the beginning of 2012, it was estimated that over 20% of US residential mortgages are under water and almost 15% of Americans use food stamp benefits. Statistics in Britain and other European countries were equally bleak.
So where is our religion? Is it in the radicalization of youth to destroy in the name of ? Is it in the archaic structures of power and money in the Church? Is it in an accumulation and protection of riches? Is it in our social responsibility? All these thoughts in their complexity came to me when I read Psalm 36.

Yhwh how precious your loving-kindness O God
And the children of humanity
in the shadow of your wings take refuge

So this was/is my prayer for Africa.

Wednesday, September 25, 2013

Crowd sponsoring


I am not a crowd - but please spread the word to your friends - let's see if we can get a new album from this quartet.  I heard two of them in Cambridge on my last trip to the UK. Not my usual haunts - but definitely worthwhile.

Monday, September 23, 2013

Continuing work on a course on the Psalms

I think this could be run remotely or with other instructors than me (obviously a different flavour). But here is a full PP drafted - 54 slides at present over 6 2 hour sessions. Could do 5 or 6 consecutive evenings or 5 or 6 weeks in a row - but need time for the homework which is extensive, the intent being that people might really learn to love reading the psalms.

Here's the link. Isn't there an alter ego of mine out there who loves the psalms and could give some substantial feedback - with not a few challenges - like Bob - it's too much?

I am just reading William L. Holladay The Psalms through Three Thousand Years, Prayerbook of a Cloud of Witnesses.  There's a lot of it that I like, and a few chapters I have skipped so far, and also a few places where I disagree with his criticism. The title makes it sound like Susan Gillingham's book (Psalms through the Centuries) from 2008 but hers is quite different.

Holladay may have placed some of the psalms into their rough dates - but the evidence seems very tenuous to me. I don't read the psalms this way - and I find it a bit of a turn-off as if I were reading something that had nothing to say to me today - and who knows maybe that's my problem. Maybe there is no solution to the human predicament short of mutual self-destruction. I have not chosen to believe such a statement.

Monday, September 16, 2013

A course on the Psalms

I think it is vital that the psalms be explored face to face. But some of this six week course has also found its way into video...

Here's my current announcement and full set of slides [under continuous update] Feedback welcome. I would happily run this onsite for anyone who wants it. [Now fully drafted in videos]

A brief introduction to the Psalter

I tried to watch the Psalms intro here [?], but got stuck in advertisements. With perseverance, I got more than the 42 seconds. It is a fun intro, somewhat light on detail. I wrote a heavier one now embedded below

Wednesday, September 11, 2013

Reading the pain of a missing person

I was introduced yesterday at UVic to Marion Partington through the CSRS fellow, Michael Hadley. By the time you read this I will have finished her book, If You Sit Very Still.

I am not going to review this book - just to say - get a hold of it and read it. It is a journey of completeness.

Monday, September 9, 2013

Politics and the Psalms - the case against Syria

This is a summary post of other posts on the subject. The consensus seems to be that a limited strike is not possible. There are probably hundreds of articles out there. And I only read a few like this one from the OUP blog.

Because I have surgical strike in my title on the Psalm 90 post, I have 5 times my usual hit rate.  Hah - that should get my ratings up.

This morning I read Herbie O'Driscoll's article on crumbs from the master's table in the Diocesan Post (October not online yet). We might note that the woman is Syrian - Let's have a few crumbs then! A creative response to our parochial interests. I hardly need point out that Jesus gave his life for the life of the world, not for its death. As I noted in the post on Psalm 22 as prayer for Syria, citing Psalm 146, God restores orphan and widow. Obviously, armed conflicts are good ways to create them.

I don't read political arguments and I am sure there are plenty on both sides. I scanned this one on 'the great debate' and this from the cable foreign policy- follow the link at Huff post if you need to to avoid pay-walls and ads. And there's CBS News and the NY Times and Move On. And have we forgotten Egypt?

Who among my blogging friends writes on politics? I don't know. [This just out from James McGrath and here from Dom Crossan.] Google reader had a good search. Feedly wants money. (Forget it.) I haven't seen any Biblical Studies folks that are directly writing, but by implication, this is the worst possible time in the Jewish liturgical year for approving a strike against the innocent bystander. See Rachel's post here on what Jews should be doing at this time of the year.

Well - Jesus didn't have to go to Syria or strike against Syria for the woman's daughter to be healed. He did say - it is not right to give the children's food to dogs.  You know how creative the woman was.  Are we able to be so creative?

Saturday, September 7, 2013

The president has given us time - Psalm 22 and Syria

Think again. Yet forty days and Nineveh will be changed ... We have been given a second time to pray for the peoples of Syria. The psalms provide unlimited models for prayer. On the turn of the year, I suggested Psalm 90 and it need not stop there. Just about any psalm will have a suitable verse for Syria today while the nations furiously rage together.

they stare at me ... and for my clothing they cast lots
Imagine for a moment that Syria is the 'me' of Psalm 22.

to the hart of the dawn
My God, My God, why have you forsaken me?

The hart (deer or doe, male and female) of the inscription is surrounded by bulls, lions, and dogs. In the midst of this, the poet invites God into the circle.

But you, יהוה, you be not distant
My hart, to my help, hurry

Imagine Syria praying, or one person on their behalf? It is God who is invited into the circle of destruction. Hart in its masculine plural form (אֵילִים ayilim) is a cipher for God, (אֱלֹהִים elohim).

The second half of the psalm is uniformly positive.

The afflicted will eat and be satisfied

Imagine ... on behalf of the people of Syria - afflicted by war and famine. Judgment with justice will be heard to the ends of the earth.

All the ends of the earth will remember and will turn to יהוה
All the families of the nations will worship in your presence
for to יהוה is the kingdom and he governs in the nations

This God governs this way (from Psalm 146).
keeping truth forever
doing judgment for the oppressed
giving bread to the hungry
יהוה releasing the prisoners
יהוה giving sight to the blind
יהוה 
uplifting the disturbed
יהוה loving the righteous
יהוה sheltering the guest
orphan and widow he restores
and the way of the wicked he subverts
Surely we should do more than throw the dice yet again. We do not have to exercise human destruction to try to bring about the divine obliteration. What about isolation of the enemy so that it might know shame, so that it might recognize that absolute monarchy is not what life is about, so that like the king of Nineveh, it might call for national repentance...
and I,
will I not show pity to Nineveh
the great city?
for there are in her more than 12 ten-thousands of humans
who cannot tell their right hand from their left
and also many cattle
 120,000 - nearly equal the death toll to date in Syria. We have forgotten both the children and the cattle.

Friday, September 6, 2013

Thinking about 'how I did it'

People have asked me 'how' I wrote Seeing the Psalter. There is a brief 4-pager here. I could write a book on it. But one part I have never shared is that for almost every panel in the screens in the brief 4-pager, I wrote a lot of code like the stuff below. Hundreds of bits of it actually over a period of 7 years - or this is what it looks like when one of these snippets is fully expanded by the GX-LEAF software that I used to help me.

GX-LEAF helped in so many ways as I felt my way into the Hebrew of the Psalms and decided what direction I should take with this very complex bit of poetic history. It held my data one character at a time. It let me draw and explore diagrams of the psalms as I learned them. It allowed queries and graphs to experiment with the data I had entered. And it provided the development environment for the panels that would let me control the translation process with queries and updates such as the snippet below.

This is an example of the code that creates a cross-tab from the database given a number of user-defined search parameters. I designed it to allow up to 40 columns. Of course there may not be that many columns so each column header is conditioned by a separate query to determine whether it will let itself be visible or not.  Altogether, one does not want to read this unless necessary. But there you have a bit of the background to the tables that you may have seen in other posts like the recent ones on Psalm 90 and Psalm 109.
SELECT ROOT,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,
       P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD,AE,
       AF,AG,AH,AI,AJ,AK,AL,AM,AN,VSS,REALROOT
FROM 
  (SELECT kwd_cd root, (decode(vs,1,bl,NULL)) a, (decode(vs,2,bl,NULL)) b, (decode(vs,3,bl,NULL)) c, (decode(vs,4,bl,NULL)) d, (decode(vs,5,bl,NULL)) e, (decode(vs,6,bl,NULL)) f, (decode(vs,7,bl,NULL)) g, (decode(vs,8,bl,NULL)) h, (decode(vs,9,bl,NULL)) i, (decode(vs,10,bl,NULL)) j, (decode(vs,11,bl,NULL)) k, (decode(vs,12,bl,NULL)) l, (decode(vs,13,bl,NULL)) m, (decode(vs,14,bl,NULL)) n, (decode(vs,15,bl,NULL)) o, (decode(vs,16,bl,NULL)) p, (decode(vs,17,bl,NULL)) q, (decode(vs,18,bl,NULL)) r, (decode(vs,19,bl,NULL)) s, (decode(vs,20,bl,NULL)) t, (decode(vs,21,bl,NULL)) u, (decode(vs,22,bl,NULL)) v, (decode(vs,23,bl,NULL)) w, (decode(vs,24,bl,NULL)) x, (decode(vs,25,bl,NULL)) y, (decode(vs,26,bl,NULL)) z, (decode(vs,27,bl,NULL)) aa, (decode(vs,28,bl,NULL)) ab, (decode(vs,29,bl,NULL)) ac, (decode(vs,30,bl,NULL)) ad, (decode(vs,31,bl,NULL)) ae, (decode(vs,32,bl,NULL)) af, (decode(vs,33,bl,NULL)) ag, (decode(vs,34,bl,NULL)) ah, (decode(vs,35,bl,NULL)) ai, (decode(vs,36,bl,NULL)) aj, (decode(vs,37,bl,NULL)) ak, (decode(vs,38,bl,NULL)) al, (decode(vs,39,bl,NULL)) am, (decode(vs,40,bl,NULL)) an,
grp_cd realroot,
vss
   FROM 
(SELECT dgm_grp_cd, kwd_seq, kwd_id, kwd_cd,
   (SELECT max(vs)
    FROM
      (SELECT DGM_GRP_CD,
              VS
       FROM
         (SELECT dgm_grp_cd,
                 rownum vs
          FROM
            (SELECT dgm_grp_cd,
                    min(kwd_seq),
                    min(kwd_id)
             FROM
               (SELECT count(kwd_loc) over (partition BY dgm_grp_cd) keyword_count,
                                                                     min(kwd_id) over (partition BY dgm_grp_cd
                                                                                       ORDER BY (decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'))),kwd_id) kwd_id,
dgm_grp_cd,
min(decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'))) over (partition BY dgm_grp_cd
                                                                                                                         ORDER BY (decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'))),kwd_id) kwd_seq, replace(kwd_loc,'-','') kwd_loc,
(SELECT
   (SELECT nvl(max(comm_fld),upper('2')) comm_fld
    FROM cs_udpv
    WHERE udg_cd = 'SVARS'
      AND udp_cd = 'KEYVALPR'
      AND udpv_gen_key1 = USER
      AND udpv_gen_key2 = upper('kwd_first')
      AND udpv_gen_key3 IS NULL
      AND udpv_gen_key4 IS NULL)
 FROM dual) fst_only,
            kwd_gen_key1
                FROM cs_dgmkwd d
WHERE instr(
              (SELECT nvl(max(comm_fld),upper('`L,YHVH,)LVH,KY,)L,)T')) comm_fld
               FROM cs_udpv
               WHERE udg_cd = 'SVARS'
                 AND udp_cd = 'KEYVALPR'
                 AND udpv_gen_key1 = USER
                 AND udpv_gen_key2 = upper('excl_root')
                 AND udpv_gen_key3 IS NULL
                 AND udpv_gen_key4 IS NULL),dgm_grp_cd)=0
AND kwd_tp =
(SELECT nvl(max(comm_fld),upper('PSALMS')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('b_books')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL)
AND (kwd_loc LIKE substr(
                           (SELECT nvl(max(comm_fld),upper('--1')) comm_fld
                            FROM cs_udpv
                            WHERE udg_cd = 'SVARS'
                              AND udp_cd = 'KEYVALPR'
                              AND udpv_gen_key1 = USER
                              AND udpv_gen_key2 = upper('kwd_loc_st')
                              AND udpv_gen_key3 IS NULL
                              AND udpv_gen_key4 IS NULL),1,3)||'%')
AND substr(decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'),kwd_loc),5) BETWEEN
(SELECT nvl(max(comm_fld),upper('001')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_seq_st')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL) AND
(SELECT nvl(max(comm_fld),upper('176')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_seq_end')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL)
AND substr(decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'),kwd_loc),5) NOT BETWEEN
(SELECT nvl(max(comm_fld),upper('998')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_seq_xst')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL) AND
(SELECT nvl(max(comm_fld),upper('999')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_seq_xend')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL)
                ORDER BY (decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'))), kwd_id)
WHERE keyword_count >
(SELECT nvl(max(comm_fld),upper('1')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_count1')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL)
AND keyword_count <=
(SELECT nvl(max(comm_fld),upper('99')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_count2')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL)
AND (fst_only= '2'
     OR fst_only=decode(kwd_gen_key1,NULL,'0','1'))
             GROUP BY dgm_grp_cd
             ORDER BY 2,
                    3)))) maxvs,
(SELECT vs
FROM
(SELECT DGM_GRP_CD,
  VS
FROM
(SELECT dgm_grp_cd,
    rownum vs
FROM
(SELECT dgm_grp_cd,
      min(kwd_seq),
      min(kwd_id)
FROM
 (SELECT count(kwd_loc) over (partition BY dgm_grp_cd) keyword_count,
                                                       min(kwd_id) over (partition BY dgm_grp_cd
                                                                         ORDER BY (decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'))),kwd_id) kwd_id,
dgm_grp_cd,
min(decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'))) over (partition BY dgm_grp_cd
                                                                                                                         ORDER BY (decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'))),kwd_id) kwd_seq, replace(kwd_loc,'-','') kwd_loc,
(SELECT
   (SELECT nvl(max(comm_fld),upper('2')) comm_fld
    FROM cs_udpv
    WHERE udg_cd = 'SVARS'
      AND udp_cd = 'KEYVALPR'
      AND udpv_gen_key1 = USER
      AND udpv_gen_key2 = upper('kwd_first')
      AND udpv_gen_key3 IS NULL
      AND udpv_gen_key4 IS NULL)
 FROM dual) fst_only,
            kwd_gen_key1
  FROM cs_dgmkwd d
WHERE instr(
              (SELECT nvl(max(comm_fld),upper('`L,YHVH,)LVH,KY,)L,)T')) comm_fld
               FROM cs_udpv
               WHERE udg_cd = 'SVARS'
                 AND udp_cd = 'KEYVALPR'
                 AND udpv_gen_key1 = USER
                 AND udpv_gen_key2 = upper('excl_root')
                 AND udpv_gen_key3 IS NULL
                 AND udpv_gen_key4 IS NULL),dgm_grp_cd)=0
AND kwd_tp =
(SELECT nvl(max(comm_fld),upper('PSALMS')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('b_books')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL)
AND (kwd_loc LIKE substr(
                           (SELECT nvl(max(comm_fld),upper('--1')) comm_fld
                            FROM cs_udpv
                            WHERE udg_cd = 'SVARS'
                              AND udp_cd = 'KEYVALPR'
                              AND udpv_gen_key1 = USER
                              AND udpv_gen_key2 = upper('kwd_loc_st')
                              AND udpv_gen_key3 IS NULL
                              AND udpv_gen_key4 IS NULL),1,3)||'%')
AND substr(decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'),kwd_loc),5) BETWEEN
(SELECT nvl(max(comm_fld),upper('001')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_seq_st')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL) AND
(SELECT nvl(max(comm_fld),upper('176')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_seq_end')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL)
AND substr(decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'),kwd_loc),5) NOT BETWEEN
(SELECT nvl(max(comm_fld),upper('998')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_seq_xst')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL) AND
(SELECT nvl(max(comm_fld),upper('999')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_seq_xend')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL)
  ORDER BY (decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'))), kwd_id)
WHERE keyword_count >
(SELECT nvl(max(comm_fld),upper('1')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_count1')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL)
AND keyword_count <=
(SELECT nvl(max(comm_fld),upper('99')) comm_fld
 FROM cs_udpv
 WHERE udg_cd = 'SVARS'
   AND udp_cd = 'KEYVALPR'
   AND udpv_gen_key1 = USER
   AND udpv_gen_key2 = upper('kwd_count2')
   AND udpv_gen_key3 IS NULL
   AND udpv_gen_key4 IS NULL)
AND (fst_only= '2'
     OR fst_only=decode(kwd_gen_key1,NULL,'0','1'))
GROUP BY dgm_grp_cd
ORDER BY 2,
       3)))
WHERE dgm_grp_cd = e.dgm_grp_cd) vs,
                       vss,
                       kwd_gen_key1,
                       grp_cd,
                       bl
 FROM
(SELECT count(kwd_loc) over (partition BY dgm_grp_cd) keyword_count,substr(kwd_loc,5) vss, replace(replace(substr(kwd_cd,1,instr(kwd_cd,'&')-1)||'░'||'','color','background-color'),'* ','') bl, kwd_id,kwd_cd, dgm_grp_cd,
(SELECT
(SELECT nvl(max(comm_fld),upper('2')) comm_fld
FROM cs_udpv
WHERE udg_cd = 'SVARS'
AND udp_cd = 'KEYVALPR'
AND udpv_gen_key1 = USER
AND udpv_gen_key2 = upper('kwd_first')
AND udpv_gen_key3 IS NULL
AND udpv_gen_key4 IS NULL)
FROM dual) fst_only,
   decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'), kwd_loc) kwd_seq,
   replace(kwd_loc,'-','') kwd_loc,
   kwd_gen_key1,
   grp_cd
FROM cs_dgmkwd d
WHERE instr(
        (SELECT nvl(max(comm_fld),upper('`L,YHVH,)LVH,KY,)L,)T')) comm_fld
     FROM cs_udpv
     WHERE udg_cd = 'SVARS'
       AND udp_cd = 'KEYVALPR'
       AND udpv_gen_key1 = USER
       AND udpv_gen_key2 = upper('excl_root')
       AND udpv_gen_key3 IS NULL
       AND udpv_gen_key4 IS NULL),dgm_grp_cd)=0
AND kwd_tp =
(SELECT nvl(max(comm_fld),upper('PSALMS')) comm_fld
FROM cs_udpv
WHERE udg_cd = 'SVARS'
AND udp_cd = 'KEYVALPR'
AND udpv_gen_key1 = USER
AND udpv_gen_key2 = upper('b_books')
AND udpv_gen_key3 IS NULL
AND udpv_gen_key4 IS NULL)
AND (kwd_loc LIKE substr(
                     (SELECT nvl(max(comm_fld),upper('--1')) comm_fld
                  FROM cs_udpv
                  WHERE udg_cd = 'SVARS'
                    AND udp_cd = 'KEYVALPR'
                    AND udpv_gen_key1 = USER
                    AND udpv_gen_key2 = upper('kwd_loc_st')
                    AND udpv_gen_key3 IS NULL
                    AND udpv_gen_key4 IS NULL),1,3)||'%')
AND substr(decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'),kwd_loc),5) BETWEEN
(SELECT nvl(max(comm_fld),upper('001')) comm_fld
FROM cs_udpv
WHERE udg_cd = 'SVARS'
AND udp_cd = 'KEYVALPR'
AND udpv_gen_key1 = USER
AND udpv_gen_key2 = upper('kwd_seq_st')
AND udpv_gen_key3 IS NULL
AND udpv_gen_key4 IS NULL) AND
(SELECT nvl(max(comm_fld),upper('176')) comm_fld
FROM cs_udpv
WHERE udg_cd = 'SVARS'
AND udp_cd = 'KEYVALPR'
AND udpv_gen_key1 = USER
AND udpv_gen_key2 = upper('kwd_seq_end')
AND udpv_gen_key3 IS NULL
AND udpv_gen_key4 IS NULL)
AND substr(decode(length(substr(kwd_loc,instr(kwd_loc,'.')+1)),2,replace(kwd_loc,'.','.0'),1,replace(kwd_loc,'.','.00'),kwd_loc),5) NOT BETWEEN
(SELECT nvl(max(comm_fld),upper('998')) comm_fld
FROM cs_udpv
WHERE udg_cd = 'SVARS'
AND udp_cd = 'KEYVALPR'
AND udpv_gen_key1 = USER
AND udpv_gen_key2 = upper('kwd_seq_xst')
AND udpv_gen_key3 IS NULL
AND udpv_gen_key4 IS NULL) AND
(SELECT nvl(max(comm_fld),upper('999')) comm_fld
FROM cs_udpv
WHERE udg_cd = 'SVARS'
AND udp_cd = 'KEYVALPR'
AND udpv_gen_key1 = USER
AND udpv_gen_key2 = upper('kwd_seq_xend')
AND udpv_gen_key3 IS NULL
AND udpv_gen_key4 IS NULL)
ORDER BY kwd_seq,
 kwd_id) e
WHERE keyword_count >
(SELECT nvl(max(comm_fld),upper('1')) comm_fld
FROM cs_udpv
WHERE udg_cd = 'SVARS'
AND udp_cd = 'KEYVALPR'
AND udpv_gen_key1 = USER
AND udpv_gen_key2 = upper('kwd_count1')
AND udpv_gen_key3 IS NULL
AND udpv_gen_key4 IS NULL)
AND keyword_count <=
(SELECT nvl(max(comm_fld),upper('99')) comm_fld
FROM cs_udpv
WHERE udg_cd = 'SVARS'
AND udp_cd = 'KEYVALPR'
AND udpv_gen_key1 = USER
AND udpv_gen_key2 = upper('kwd_count2')
AND udpv_gen_key3 IS NULL
AND udpv_gen_key4 IS NULL)
AND (fst_only= '2'
OR fst_only=decode(kwd_gen_key1,NULL,'0','1'))
 ORDER BY 2,
3))