[Isis-users] Search&replace using MS - Busqueda dentro de un campo repetible con MX

spinaker spinaker at adinet.com.uy
Fri Mar 8 18:37:01 CET 2013


Dear Carlos

My explanation will be in English because this question could be 
interesting for everybody

You have a repeatable field (v859) with subfields, let's say something like

  859:  ^aSome data1^b12345^cmore data1
  859:  ^aSome *SAP *data^b12500^cmore data2
  859:  ^aSome data3^b13001^cmore data3

Your problem is how to modify an occurrence of field 859 when
   IF v859^a  contains 'SAP' or 'sap' or any variation of this trigram
            then
    add a leter at the end of subfield  v856^b
   FI

Let's say that the letter to add is  'E'  (which stands for Ernesto :-) )
So the result of the example above is

  859:  ^aSome data1^b12345^cmore data1
  859:  ^aSome *SAP *data^b12500*E*^cmore data2
  859:  ^aSome data3^b13001^cmore data3

Ok, let's go to work

You have to do it from the command line, using MX,
let's say the name of your database is dbcarlos

mx dbcarlos  proc=@sap.prc create=xxx now -all tell=1000
copy xxx.* dbcarlos.*
then you have to do a fullinversion of dbcarlos

Now come the interesting part,   sap.prc  this file you can create with 
notepad
-----------------------------------------------------
'd859'

( if p(v859) then

    '<859>^a', v859^a,
                     |^b|v859^b,  if  s(mhu,v859^a,mpl):'SAP' then 'E' fi,
                     |^c|v859^c,
     '</859>',

fi )
-----------------------------------------------------
Note the trick: s(mhu,v859^a,mpl):'SAP'
in this way you can catch all variations of the string   SAP, sAP, Sap, etc


Enjoy it
Regards
Ernesto Spinak



El 08/03/2013 12:57, Carlos Andres Di Pierro escribió:
> Hola a todos!
>
> Quiero saber si es posible con la herramienta MX hacer lo siguiente.
>
> Tengo un campo repetible(*v859*) con 3 subcampos *a,b,c*
> El subcampo "*b"* guarda el inventario.
> Necesito agregar un letra al final del subcampo *"b"*, siempre y 
> cuando el subcampo *"a"* contenga "SAP". Eso con cada ocurrencia del 
> campo *v859* que cumpla con esa condición.
>
>
> Desde ya muchas gracias por cualquier sugerencia que me puedan dar
>
> Saludos
> Carlos
>
>
> _______________________________________________
> isis-users mailing list
> isis-users at iccisis.org
> To manage your own subscription options go to: http://lists.iccisis.org/listinfo/isis-users
> Or contact Henk Rutten: hlrutten at xs4all.nl


-- 
   .^.                                .^.
   ( )                                ( )
   ===                                ===
  =[=]================================[=]=
   | |  Ernesto Spinak                | |
   | |  spinaker at adinet.com.uy        | |
   | |  Montevideo, Uruguay           | |
   | |  tel/fax  (598) 2622-3352      | |
   | |  celular  (598) 99612238      | |
  =[=]================================[=]=
   ===                                ===
   ( )                                ( )
    V                                  V

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.iccisis.org/pipermail/isis-users/attachments/20130308/43ca759d/attachment.html>


More information about the isis-users mailing list