Fix routine to merge 020 tags
- Article Type: General
- Product: Aleph
- Product Version: 18.01
Description:
I have records that have multiple 020 tag fields. The first record has a subfield a, while each subsequent 020 tags have a subfield z. I want to concatentate the first 020 tag subfield a with the subfield z of the other 020 tags. As an example:
Input
020 L $$a0684314290 (electronic book)
020 L $$z0684312573
020 L $$z0028658078 (v. 1 : alk paper)
what I want as a result is one record of:
020 L $$a0684314290 (electronic book)$$z0684312573$$z0028658078 (v. 1 : alk paper)
deleting all the remaing 020 tag fields with the subfield z only.
In NDU01/tab/import, I created a fix routine called gvrl.fix. This uses the CONCATENATE-FIELDS option. However, it concatenates the subfield a to each subsequent subfield z. Using the example above, my output looks like this:
020 L $$a0684314290 (electronic book)$$a0684314290 (electronic book)
020 L $$z0684312573$$a0684314290 (electronic book)
020 L $$z0028658078 (v. 1 : alk paper)$$a0028659937 (electronic book)
Is this the right routine I should use or is there a better one? If this is the right one, how do I use it to get the results I want? [ <Phil Andrzejewski > ]
--------------------------------------------------------------------------------
[ <Randy Menakes > ]
[ <Randy Menakes > ]
Resolution:
Here is a version of a script that should work in all cases. If there are more than one 020, only subsequent 020's with a single subfield of $z will be concatenated with the first 020. Subsequent 020 fields that include a $a won't be touched.
!-!!!!!-!!-!-!!!-!!!-!!!!!-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1 020## 00002 COND-LOAD-VAL-FIELD N
1 020## 00002 CHANGE-FIELD 02A
1 020## 00002 CHANGE-FIELD 02B
1 020## 00002 CHANGE-FIELD 02C
1 02A## COPY-FIELD 02X
1 02B## COPY-FIELD 02Y
1 02C## COPY-FIELD 02Z
1 02X## DELETE-FIELD-COND Y,$$a
1 02Y## DELETE-FIELD-COND Y,$$a
1 02Z## DELETE-FIELD-COND Y,$$a
1 020## CONCATENATE-FIELDS 02X
1 020## CONCATENATE-FIELDS 02Y
1 020## CONCATENATE-FIELDS 02Z
1 02X## DELETE-FIELD
1 02Y## DELETE-FIELD
1 02Z## DELETE-FIELD
1 02A## DELETE-FIELD-COND N,$$a
1 02B## DELETE-FIELD-COND N,$$a
1 02C## DELETE-FIELD-COND N,$$a
1 02A## CHANGE-FIELD 020
1 02B## CHANGE-FIELD 020
1 02C## CHANGE-FIELD 020
- Article last edited: 10/8/2013