DXL for objects that contain more than one shall

I would like to create a filter in DXL for objects that contain more than one shall.

Anyone has a DXL already created?  If so, please share it with me.


jhaveri99 - Wed Jul 12 17:49:25 EDT 2017

Re: DXL for objects that contain more than one shall
Mike.Scharnow - Thu Jul 13 06:19:57 EDT 2017

There are several threads in the forum about recognizing and even counting "shall" (as opposed to "shallow" and "marshall"). Using the forum search you should be able to find these posts. Some threads that might help you are

https://www.ibm.com/developerworks/community/forums/html/threadTopic?id=77777777-0000-0000-0000-000014695315

https://www.ibm.com/developerworks/community/forums/html/threadTopic?id=f45d5565-c6a1-4f34-813c-a37af2458046

https://www.ibm.com/developerworks/community/forums/html/threadTopic?id=77777777-0000-0000-0000-000014936264

Re: DXL for objects that contain more than one shall
jhaveri99 - Thu Jul 20 12:50:32 EDT 2017

Mike.Scharnow - Thu Jul 13 06:19:57 EDT 2017

There are several threads in the forum about recognizing and even counting "shall" (as opposed to "shallow" and "marshall"). Using the forum search you should be able to find these posts. Some threads that might help you are

https://www.ibm.com/developerworks/community/forums/html/threadTopic?id=77777777-0000-0000-0000-000014695315

https://www.ibm.com/developerworks/community/forums/html/threadTopic?id=f45d5565-c6a1-4f34-813c-a37af2458046

https://www.ibm.com/developerworks/community/forums/html/threadTopic?id=77777777-0000-0000-0000-000014936264

The DXL scripts in those links that you send only count the number of shall's.  I am looking for a DXL script that will identify which objects contain more than 1 shall.

Re: DXL for objects that contain more than one shall
Mike.Scharnow - Fri Jul 21 03:01:37 EDT 2017

jhaveri99 - Thu Jul 20 12:50:32 EDT 2017

The DXL scripts in those links that you send only count the number of shall's.  I am looking for a DXL script that will identify which objects contain more than 1 shall.

and where exactly is the difficulty in putting together parts of different scripts, e.g. by converting count to a local variable and writing sth.. like 

if count > 0 then ...

To create a filter you will actually use the commands "reject" and "accept", see the DXL manual for an explanation.

Re: DXL for objects that contain more than one shall
MartinHunter - Mon Jul 24 10:33:53 EDT 2017

jhaveri99 - Thu Jul 20 12:50:32 EDT 2017

The DXL scripts in those links that you send only count the number of shall's.  I am looking for a DXL script that will identify which objects contain more than 1 shall.

Something like this should do what you want.

#code

Object o
Module m = current
Regexp rShall = regexp2 "([sS]hall)"
string s
int count

for o in entire m do {
 count = 0
 if (null o){continue}
 if (isDeleted o){continue}
 s = o."Object Text"
 while (rShall s) {
  s = s [0:start 1 - 1] s[end 1 + 1:]
  count++
 }
 if (count > 1) {
  accept o
 }
 else {
  reject o
 }
}

delete rShall

filtering on

 

#endcode