[Isis-users] Global Change

spinaker spinaker at adinet.com.uy
Mon Dec 11 18:51:36 CET 2017


Fred

There is a way to circunvent the problem with normal quotes *'*   using 
inverted quotes *`*   like the following example

*C:\dbisis\cds>mx cds "pft=if v26:`'` then mfn,x2 fi" now
000103  000138*

Regards
Ernesto Spinak


El 11/12/2017 a las 13:51, fred train escribió:
> Thanks Egbert
>
> Your proc example gives exactly the thing I was looking for. Saves us 
> a lot of work because I can generate these statements.
>
> The reason why my version of creating a gizmo database did not work 
> happens to be a stupid thing:
> The commands were executed in a cygwin (=unix on windows) shell. The 
> 'çat' command in the cygwin shell creates files with only linefeeds.
> When I changed the input file from LF to CRLF it worked as expected.
>
> New challenge number 1:
> Is it possible to instruct a gizmo that it should match the complete 
> field?
> Example of the field content: RWXR
> Example of the line in the gizmo database : RW|Read Write
> This transforms the field to : Read WriteXR
> Is there a way to instruct gizmo to check the complete string?
> Or should I add a dummy in the gizmo database like: RWXR|RWXR
>
> New challenge number 2:
> The value1 in "if v620^a='value1' then" cannot contain the single 
> quote. Is there a way to rewrite the if statement in such a way that 
> the test value can be specified with a quote?
>
> Thanks & Regards
> Fred
>
> Op 7-12-2017 om 06:19 schreef De Smet Egbert:
>> The challenge is how to identify which of your (repeated) keywords should move to another field and which not. If there is a consistent way of defining that, it can be easily done in (C)ISIS.
>> E.g. if it is always the first occurrence, you can point to it with the occurrence counter. Your proc will run as a repeatable group anyway since it deals with a repeated field, and each iteration has its own counter for the occurrence.
>> If it is not a fixed occurrence, then the values should be matched against values to decide on whether the field should move to the other field or not. That is tricky if there are many possible values. You could first create an 'authority' database, e.g. from a sequential files where all values are listed one per line with the seq= parameter. Then you could use e.g. a ref(l()) construct and if that function applied to the current occurrence of your field matches, which means the value exists in the external authority database, then you know it should move.
>>
>> Example starting point for your proc (to be saved as a file) :
>> 'd620'  /*delete the original field as we are going to process it in the output */
>> (      /* start of repeatable group */
>> if v620^a='value1' then '<611>',v620^a,'</611>'  else '<620>', |^a| v620^a,'</620)' fi,  /* move v620^a to v611 if it is equal to the value1, otherwise put it back into v620 */
>> )  /* end of repeatable group */
>> Always be carefull doing such operations, e.g. take a backup of your original database and output to a test-database first. CISIS is a bit ideosyncratic sometimes in applying procs.
>>
>> As for the command mx seq=xxx.lst~ create=xxx now, please note that in this case 'xxx.lst' is just a placeholder for a filename to a real sequential file. If the text-lines in that file have separated values (the separator is by default | but can also be re-defined as in the example with ~) these values will become fields v1, v2...vN.
>>
>> Small example :
>> - create a text file 'xxx.lst' with contents
>> one~1
>> two~2
>> three~3
>> four~4
>> - create an ISIS database from that sequential file :
>> mx seq=xxx.lst~ create=xxx now  -all
>>
>> then that xxx database will contain 4 records with each 2 fields, the first field is the textual one, the second the numeric value. Since you added ~ after the filename, it will be used as the alternative separator to split values in each line as fields.
>> Such a database is in fact what is used with the gizmo-parameter to change all words 'one' to '1', 'two' to '2' etc.
>> In your case the file was empty most probably, so resulting in an empty database.
>>
>> I hope this helps.
>>
>> Egbert de Smet
>> Universiteit Antwerpen
>> ________________________________________
>> From: Fred Hommersom<fred.hommersom at xs4all.nl>
>> Sent: Wednesday, December 6, 2017 10:17 PM
>> To: De Smet Egbert; Albert LEMORT;isis-users at iccisis.org
>> Subject: Re: [Isis-users] Global Change
>>
>> Thanks gentlemen,
>> I found a manual "CISIS-ManualReferencia-en-5.2" with a large description of MX with a proc
>> Are more examples present anywhere?
>> I am trying to change one of the members of a repeating field.
>> The field is called "Keywords" and contains on each line a keyword.
>> I am looking for an example how to operate on only one of the keywords.
>>
>> I also tried a gizmo for another option. I found an example in manual CISIS-ManualReferencia-en-5.2.pdf
>> Applies a gizmo to the record, which can apply to a list of specific fields.
>> echo transpiration~xxx> xxx.lst
>> mx seq=xxx.lst~ create=xxx now
>> This code creates  xxx.mst and xxx.xrf as expected.
>> However: the content of this database is empty.
>> The command "mx xxx" shows no records.
>>
>> Any help or examples available?
>> Regards
>> Fred
>>
>>
>>
>> Op 6-12-2017 om 15:42 schreef De Smet Egbert:
>>
>> Unfortunately CISIS (as used in ABCD) does not support a reformatting FST, which is a CDS/ISIS or WinISIS concept.
>> But it is replaced by a more flexible 'proc' (process or procedure) parameter which defines either in-line or by referral to a script which operations need to be done on a record, using the Formatting Language (as in the FST).
>> Here records but also fields can be deleted, added, reformatted etc.
>> So according to the current value of your field 611^a that occurrence of the (sub-)field can be either left untouched or deleted and added into v620, which is more or less what you need.
>>
>> Such a 'proc' (or several of them) is to be passed to mx in a command (terminal), while at the same time in the same run of the command one or more gizmo's can be applied. So the list of possibilities to manipulate fields in records is enormous...
>>
>> Egbert de Smet
>> Universiteit Antwerpen
>> ________________________________________
>> From: isis-users<isis-users-bounces+egbert.desmet=ua.ac.be at iccisis.org><mailto:isis-users-bounces+egbert.desmet=ua.ac.be at iccisis.org>  on behalf of Albert LEMORT<albert.lemort at hepl.be><mailto:albert.lemort at hepl.be>
>> Sent: Wednesday, December 6, 2017 3:24 PM
>> To:isis-users at iccisis.org<mailto:isis-users at iccisis.org>
>> Subject: Re: [Isis-users] Global Change
>>
>> Hello Fred,
>>
>> You could try using a reformatting FST.
>>
>> If your Keyword field has tag 611 and a subfield ^a and you want to copy some fields to Locations with tag 620, then the following FST should work:
>>
>> [cid:part1.BFBA7E8E.ED848F5A at hepl.be]
>>
>> The data will be copied, not moved.
>>
>> Albert
>>
>> Le 05-12-17 à 17:36, fred train a écrit :
>> Hello guru's
>>
>> We have repeatable field called Keywords.
>> This field contains for historical reasons also coded location information.
>> A Keyword field could have entries like
>> Colored; upside; metal; painted; GLD; LIM; NLD; sale
>> The semicolons are added by the PFT. Each keyword has its own record.
>>
>> We have created a new repeatable field called Locations. And the location entries from the keywords should be moved to the new Locations field and also translated into more readable strings.
>> The end-effect after the operation should look like:
>>
>> Keyword: Colored; upside; metal; painted; sale
>> Locations: Gelderland(GLD); Limburg(LIM); Netherlands
>>
>> The idea was to apply a global change for each of the keywords GLD, LIM and NLD.
>> I can modify the strings into their target strings (e.g. GLD becomes Gelderland) in the keywords.
>> But the Move option in Global change moves all entries of Keyword to Locations.
>>
>> Is there a solution for my problem?
>> In other words: Is it possible with Global Change or another option to move some entries from the source repeatable field to a target repeatable field?
>> Regards
>> Fred
>>
>> _______________________________________________
>> isis-users mailing list
>> isis-users at iccisis.org<mailto:isis-users at iccisis.org><mailto:isis-users at iccisis.org><mailto: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<mailto:hlrutten at xs4all.nl><mailto:hlrutten at xs4all.nl><mailto:hlrutten at xs4all.nl>
>>
>> [https://ecolevirtuelle.provincedeliege.be/docStatique/images/Logo%20HEPL10ans_RVB_signature.jpg]
>> _______________________________________________
>> isis-users mailing list
>> isis-users at iccisis.org<mailto: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<mailto:hlrutten at xs4all.nl>
>>
>>
>> _______________________________________________
>> 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
>
>
>
> _______________________________________________
> 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/20171211/87bbf6d6/attachment.html>


More information about the isis-users mailing list