!   2   3  4  5   6    7                 8                           9
!-!!!!!-!!-!-!!!-!!!-!!!!!-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!* Change 440 fields to 490/830 pairs
!*
!* 20170413 ME final version with corrections and enhancements
!*
!* Eight iterations of the script, handles one 440 per iteration.
!* If there are more than eight 440s in a record, rerun script.
!* Maximum seen in one record is 26.
!*
!* Handles $$6 linked pairs of fields as long as record contains
!* no link numbers above 49, else duplicate link numbers created.
!* First section to handle $$6 commented out: they were handled in
!* advance through reporting and editing of records.
!*
!* No $$0, $$3, or $$8 in 440s in current database so no handling here
!* Only garbage in $$w in 440s in current database so they are stripped
!*
!****************************************************************************
!* Change the 440 to an 83X (only way to preserve the second indicator)
!* Must use '440##' instead of '440 #' (odd bug in the system)
1 440##              FIRST CHANGE-FIELD                   83X
!* A safety measure just in case (some pipes in first ind in db)
1 83X##                    CHANGE-FIRST-IND               #, 
!* Create copy of field to preserve subfields
1 83X##                    COPY-FIELD                     44X  ,L
!* Create new 49X with placeholder subfield 'q'
1 83X##                    ADD-FIELD                      49X1 ,L,$$qfoo
!* Adding subfields one at a time to maintain order (another bug)
1 49X1#                    CONCATENATE-FIELDS             44X##,6
1 49X1#                    CONCATENATE-FIELDS             44X##,a
1 49X1#                    CONCATENATE-FIELDS             44X##,n
1 49X1#                    CONCATENATE-FIELDS             44X##,p
! Get rid of wrong punctuation, put a comma before subfied x
1 49X1#                    CONCATENATE-FIELDS             44X##,x
1 49X1#                    REPLACE-STRING-GENERAL         /$$x/,$$x
1 49X1#                    REPLACE-STRING-GENERAL         /.,$$x/,$$x
1 49X1#                    REPLACE-STRING-GENERAL         /;,$$x/,$$x 
1 49X1#                    REPLACE-STRING-GENERAL         /:,$$x/,$$x
1 49X1#                    REPLACE-STRING-GENERAL         /,,$$x/,$$x
1 49X1#                    REPLACE-STRING-GENERAL         / ,$$x/,$$x
! Get rid of wrong punctuation, put a space and semicolon before subfied v
1 49X1#                    CONCATENATE-FIELDS             44X##,v
1 49X1#                    REPLACE-STRING                 $$v, ;$$v
1 49X1#                    REPLACE-STRING                 . ;$$v, ;$$v
1 49X1#                    REPLACE-STRING                 ; ;$$v, ;$$v
1 49X1#                    REPLACE-STRING                 : ;$$v, ;$$v
1 49X1#                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
1 49X1#                    REPLACE-STRING                   ;$$v, ;$$v
!* Eliminate punctuation after subfield v
1 49X1#                    ADD-SUBFIELD                   q,baz
1 49X1#                    REPLACE-STRING                 ;$$qbaz,$$qbaz
1 49X1#                    REPLACE-STRING-GENERAL         /,$$qbaz/$$qbaz
1 49X1#                    REPLACE-STRING                 :$$qbaz,$$qbaz
1 49X1#                    REPLACE-STRING                  $$qbaz,$$qbaz
!* Delete all the placeholders
1 49X1#                    DELETE-SUBFIELD                q
1 49X1#                    DELETE-SUBFIELD-DELIMITER      n
1 49X1#                    DELETE-SUBFIELD-DELIMITER      p
!* Finished with the 490 - change 49X1 to 4901
1 49X1#                    CHANGE-FIELD                   490
!* Add a placeholder to the 83X so we don't lose the whole field
1 83X##                    ADD-SUBFIELD                   q,bar
!* Strip everything so we can rebuild it according to protocol
1 83X##                    DELETE-SUBFIELD                a
1 83X##                    DELETE-SUBFIELD                h
1 83X##                    DELETE-SUBFIELD                n
1 83X##                    DELETE-SUBFIELD                p
1 83X##                    DELETE-SUBFIELD                v
1 83X##                    DELETE-SUBFIELD                w
1 83X##                    DELETE-SUBFIELD                x
1 83X##                    DELETE-SUBFIELD                0
1 83X##                    DELETE-SUBFIELD                3
1 83X##                    DELETE-SUBFIELD                6
1 83X##                    DELETE-SUBFIELD                8
!* Add proper fields from 44X
1 83X##                    CONCATENATE-FIELDS             44X##,6
1 83X##                    CONCATENATE-FIELDS             44X##,a
1 83X##                    CONCATENATE-FIELDS             44X##,n
1 83X##                    CONCATENATE-FIELDS             44X##,p
!* Get rid of wrong punctuation, put a space and semicolon before subfield v
1 83X##                    CONCATENATE-FIELDS             44X##,v
1 83X##                    REPLACE-STRING                 $$v, ;$$v
1 83X##                    REPLACE-STRING                 . ;$$v, ;$$v
1 83X##                    REPLACE-STRING                 ; ;$$v, ;$$v
1 83X##                    REPLACE-STRING                 : ;$$v, ;$$v
1 83X##                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
1 83X##                    REPLACE-STRING                   ;$$v, ;$$v
!* Add a period to the end, wherever we happen to be
1 83X##                    ADD-SUBFIELD                   q,baz.
1 83X##                    REPLACE-STRING                 ;$$qbaz.,$$qbaz.
1 83X##                    REPLACE-STRING-GENERAL         /,$$qbaz./$$qbaz.
1 83X##                    REPLACE-STRING                 :$$qbaz.,$$qbaz.
1 83X##                    REPLACE-STRING                  $$qbaz.,$$qbaz.
1 83X##                    REPLACE-STRING                 $$qbaz.,.
!* Get rid of wrong punctuation, put a period before subfield x
1 83X##                    CONCATENATE-FIELDS             44X##,x
1 83X##                    REPLACE-STRING                 $$x,.$$x
1 83X##                    REPLACE-STRING                 ..$$x,.$$x
1 83X##                    REPLACE-STRING-GENERAL         /,.$$x/.$$x
1 83X##                    REPLACE-STRING                 ;.$$x,.$$x 
1 83X##                    REPLACE-STRING                 :.$$x,.$$x
1 83X##                    REPLACE-STRING                  .$$x,.$$x
!* Eliminate punctuation after subfield x
1 83X##                    ADD-SUBFIELD                   q,bop
1 83X##                    REPLACE-STRING                 ;$$qbop,$$qbop
1 83X##                    REPLACE-STRING-GENERAL         /,$$qbop/$$qbop
1 83X##                    REPLACE-STRING                 :$$qbop,$$qbop
1 83X##                    REPLACE-STRING                  $$qbop,$$qbop
!* Make sure we have two digits in the $$6 (handled by batch in db)
! 1 83X##                    REPLACE-STRING                 $$61$$,$$601$$
! 1 83X##                    REPLACE-STRING                 $$62$$,$$602$$
! 1 83X##                    REPLACE-STRING                 $$63$$,$$603$$
! 1 83X##                    REPLACE-STRING                 $$64$$,$$604$$
! 1 83X##                    REPLACE-STRING                 $$65$$,$$605$$
! 1 83X##                    REPLACE-STRING                 $$66$$,$$606$$
! 1 83X##                    REPLACE-STRING                 $$67$$,$$607$$
! 1 83X##                    REPLACE-STRING                 $$68$$,$$608$$
! 1 83X##                    REPLACE-STRING                 $$69$$,$$609$$
!* Change the first digit of whatever is in 83X $$6: 0>5 1>6 2>7 3>8 4>9
1 83X##                    REPLACE-STRING                 $$60,$$65
1 83X##                    REPLACE-STRING                 $$61,$$66
1 83X##                    REPLACE-STRING                 $$62,$$67
1 83X##                    REPLACE-STRING                 $$63,$$68
1 83X##                    REPLACE-STRING                 $$64,$$69
!* Clean up
1 83X##                    DELETE-SUBFIELD                q
1 44X##                    DELETE-FIELD
!* Finished with the 83X, change it to an 830
1 83X##                    CHANGE-FIELD                   830
!*
!* Iterations two through eight
!*
2 440##              FIRST CHANGE-FIELD                   83X
2 83X##                    CHANGE-FIRST-IND               #, 
2 83X##                    COPY-FIELD                     44X  ,L
2 83X##                    ADD-FIELD                      49X1 ,L,$$qfoo
2 49X1#                    CONCATENATE-FIELDS             44X##,6
2 49X1#                    CONCATENATE-FIELDS             44X##,a
2 49X1#                    CONCATENATE-FIELDS             44X##,n
2 49X1#                    CONCATENATE-FIELDS             44X##,p
2 49X1#                    CONCATENATE-FIELDS             44X##,x
2 49X1#                    REPLACE-STRING-GENERAL         /$$x/,$$x
2 49X1#                    REPLACE-STRING-GENERAL         /.,$$x/,$$x
2 49X1#                    REPLACE-STRING-GENERAL         /;,$$x/,$$x 
2 49X1#                    REPLACE-STRING-GENERAL         /:,$$x/,$$x
2 49X1#                    REPLACE-STRING-GENERAL         /,,$$x/,$$x
2 49X1#                    REPLACE-STRING-GENERAL         / ,$$x/,$$x
2 49X1#                    CONCATENATE-FIELDS             44X##,v
2 49X1#                    REPLACE-STRING                 $$v, ;$$v
2 49X1#                    REPLACE-STRING                 . ;$$v, ;$$v
2 49X1#                    REPLACE-STRING                 ; ;$$v, ;$$v
2 49X1#                    REPLACE-STRING                 : ;$$v, ;$$v
2 49X1#                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
2 49X1#                    REPLACE-STRING                   ;$$v, ;$$v
2 49X1#                    ADD-SUBFIELD                   q,baz
2 49X1#                    REPLACE-STRING                 ;$$qbaz,$$qbaz
2 49X1#                    REPLACE-STRING-GENERAL         /,$$qbaz/$$qbaz
2 49X1#                    REPLACE-STRING                 :$$qbaz,$$qbaz
2 49X1#                    REPLACE-STRING                  $$qbaz,$$qbaz
2 49X1#                    DELETE-SUBFIELD                q
2 49X1#                    DELETE-SUBFIELD-DELIMITER      n
2 49X1#                    DELETE-SUBFIELD-DELIMITER      p
2 49X1#                    CHANGE-FIELD                   490
2 83X##                    ADD-SUBFIELD                   q,bar
2 83X##                    DELETE-SUBFIELD                a
2 83X##                    DELETE-SUBFIELD                h
2 83X##                    DELETE-SUBFIELD                n
2 83X##                    DELETE-SUBFIELD                p
2 83X##                    DELETE-SUBFIELD                v
2 83X##                    DELETE-SUBFIELD                w
2 83X##                    DELETE-SUBFIELD                x
2 83X##                    DELETE-SUBFIELD                0
2 83X##                    DELETE-SUBFIELD                3
2 83X##                    DELETE-SUBFIELD                6
2 83X##                    DELETE-SUBFIELD                8
2 83X##                    CONCATENATE-FIELDS             44X##,6
2 83X##                    CONCATENATE-FIELDS             44X##,a
2 83X##                    CONCATENATE-FIELDS             44X##,n
2 83X##                    CONCATENATE-FIELDS             44X##,p
2 83X##                    CONCATENATE-FIELDS             44X##,v
2 83X##                    REPLACE-STRING                 $$v, ;$$v
2 83X##                    REPLACE-STRING                 . ;$$v, ;$$v
2 83X##                    REPLACE-STRING                 ; ;$$v, ;$$v
2 83X##                    REPLACE-STRING                 : ;$$v, ;$$v
2 83X##                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
2 83X##                    REPLACE-STRING                   ;$$v, ;$$v
2 83X##                    ADD-SUBFIELD                   q,baz.
2 83X##                    REPLACE-STRING                 ;$$qbaz.,$$qbaz.
2 83X##                    REPLACE-STRING-GENERAL         /,$$qbaz./$$qbaz.
2 83X##                    REPLACE-STRING                 :$$qbaz.,$$qbaz.
2 83X##                    REPLACE-STRING                  $$qbaz.,$$qbaz.
2 83X##                    REPLACE-STRING                 $$qbaz.,.
2 83X##                    CONCATENATE-FIELDS             44X##,x
2 83X##                    REPLACE-STRING                 $$x,.$$x
2 83X##                    REPLACE-STRING                 ..$$x,.$$x
2 83X##                    REPLACE-STRING-GENERAL         /,.$$x/.$$x
2 83X##                    REPLACE-STRING                 ;.$$x,.$$x 
2 83X##                    REPLACE-STRING                 :.$$x,.$$x
2 83X##                    REPLACE-STRING                  .$$x,.$$x
2 83X##                    ADD-SUBFIELD                   q,bop
2 83X##                    REPLACE-STRING                 ;$$qbop,$$qbop
2 83X##                    REPLACE-STRING-GENERAL         /,$$qbop/$$qbop
2 83X##                    REPLACE-STRING                 :$$qbop,$$qbop
2 83X##                    REPLACE-STRING                  $$qbop,$$qbop
2 83X##                    REPLACE-STRING                 $$60,$$65
2 83X##                    REPLACE-STRING                 $$61,$$66
2 83X##                    REPLACE-STRING                 $$62,$$67
2 83X##                    REPLACE-STRING                 $$63,$$68
2 83X##                    REPLACE-STRING                 $$64,$$69
2 83X##                    DELETE-SUBFIELD                q
2 44X##                    DELETE-FIELD
2 83X##                    CHANGE-FIELD                   830
!*
3 440##              FIRST CHANGE-FIELD                   83X
3 83X##                    CHANGE-FIRST-IND               #, 
3 83X##                    COPY-FIELD                     44X  ,L
3 83X##                    ADD-FIELD                      49X1 ,L,$$qfoo
3 49X1#                    CONCATENATE-FIELDS             44X##,6
3 49X1#                    CONCATENATE-FIELDS             44X##,a
3 49X1#                    CONCATENATE-FIELDS             44X##,n
3 49X1#                    CONCATENATE-FIELDS             44X##,p
3 49X1#                    CONCATENATE-FIELDS             44X##,x
3 49X1#                    REPLACE-STRING-GENERAL         /$$x/,$$x
3 49X1#                    REPLACE-STRING-GENERAL         /.,$$x/,$$x
3 49X1#                    REPLACE-STRING-GENERAL         /;,$$x/,$$x 
3 49X1#                    REPLACE-STRING-GENERAL         /:,$$x/,$$x
3 49X1#                    REPLACE-STRING-GENERAL         /,,$$x/,$$x
3 49X1#                    REPLACE-STRING-GENERAL         / ,$$x/,$$x
3 49X1#                    CONCATENATE-FIELDS             44X##,v
3 49X1#                    REPLACE-STRING                 $$v, ;$$v
3 49X1#                    REPLACE-STRING                 . ;$$v, ;$$v
3 49X1#                    REPLACE-STRING                 ; ;$$v, ;$$v
3 49X1#                    REPLACE-STRING                 : ;$$v, ;$$v
3 49X1#                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
3 49X1#                    REPLACE-STRING                   ;$$v, ;$$v
3 49X1#                    ADD-SUBFIELD                   q,baz
3 49X1#                    REPLACE-STRING                 ;$$qbaz,$$qbaz
3 49X1#                    REPLACE-STRING-GENERAL         /,$$qbaz/$$qbaz
3 49X1#                    REPLACE-STRING                 :$$qbaz,$$qbaz
3 49X1#                    REPLACE-STRING                  $$qbaz,$$qbaz
3 49X1#                    DELETE-SUBFIELD                q
3 49X1#                    DELETE-SUBFIELD-DELIMITER      n
3 49X1#                    DELETE-SUBFIELD-DELIMITER      p
3 49X1#                    CHANGE-FIELD                   490
3 83X##                    ADD-SUBFIELD                   q,bar
3 83X##                    DELETE-SUBFIELD                a
3 83X##                    DELETE-SUBFIELD                h
3 83X##                    DELETE-SUBFIELD                n
3 83X##                    DELETE-SUBFIELD                p
3 83X##                    DELETE-SUBFIELD                v
3 83X##                    DELETE-SUBFIELD                w
3 83X##                    DELETE-SUBFIELD                x
3 83X##                    DELETE-SUBFIELD                0
3 83X##                    DELETE-SUBFIELD                3
3 83X##                    DELETE-SUBFIELD                6
3 83X##                    DELETE-SUBFIELD                8
3 83X##                    CONCATENATE-FIELDS             44X##,6
3 83X##                    CONCATENATE-FIELDS             44X##,a
3 83X##                    CONCATENATE-FIELDS             44X##,n
3 83X##                    CONCATENATE-FIELDS             44X##,p
3 83X##                    CONCATENATE-FIELDS             44X##,v
3 83X##                    REPLACE-STRING                 $$v, ;$$v
3 83X##                    REPLACE-STRING                 . ;$$v, ;$$v
3 83X##                    REPLACE-STRING                 ; ;$$v, ;$$v
3 83X##                    REPLACE-STRING                 : ;$$v, ;$$v
3 83X##                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
3 83X##                    REPLACE-STRING                   ;$$v, ;$$v
3 83X##                    ADD-SUBFIELD                   q,baz.
3 83X##                    REPLACE-STRING                 ;$$qbaz.,$$qbaz.
3 83X##                    REPLACE-STRING-GENERAL         /,$$qbaz./$$qbaz.
3 83X##                    REPLACE-STRING                 :$$qbaz.,$$qbaz.
3 83X##                    REPLACE-STRING                  $$qbaz.,$$qbaz.
3 83X##                    REPLACE-STRING                 $$qbaz.,.
3 83X##                    CONCATENATE-FIELDS             44X##,x
3 83X##                    REPLACE-STRING                 $$x,.$$x
3 83X##                    REPLACE-STRING                 ..$$x,.$$x
3 83X##                    REPLACE-STRING-GENERAL         /,.$$x/.$$x
3 83X##                    REPLACE-STRING                 ;.$$x,.$$x 
3 83X##                    REPLACE-STRING                 :.$$x,.$$x
3 83X##                    REPLACE-STRING                  .$$x,.$$x
3 83X##                    ADD-SUBFIELD                   q,bop
3 83X##                    REPLACE-STRING                 ;$$qbop,$$qbop
3 83X##                    REPLACE-STRING-GENERAL         /,$$qbop/$$qbop
3 83X##                    REPLACE-STRING                 :$$qbop,$$qbop
3 83X##                    REPLACE-STRING                  $$qbop,$$qbop
3 83X##                    REPLACE-STRING                 $$60,$$65
3 83X##                    REPLACE-STRING                 $$61,$$66
3 83X##                    REPLACE-STRING                 $$62,$$67
3 83X##                    REPLACE-STRING                 $$63,$$68
3 83X##                    REPLACE-STRING                 $$64,$$69
3 83X##                    DELETE-SUBFIELD                q
3 44X##                    DELETE-FIELD
3 83X##                    CHANGE-FIELD                   830
!*
4 440##              FIRST CHANGE-FIELD                   83X
4 83X##                    CHANGE-FIRST-IND               #, 
4 83X##                    COPY-FIELD                     44X  ,L
4 83X##                    ADD-FIELD                      49X1 ,L,$$qfoo
4 49X1#                    CONCATENATE-FIELDS             44X##,6
4 49X1#                    CONCATENATE-FIELDS             44X##,a
4 49X1#                    CONCATENATE-FIELDS             44X##,n
4 49X1#                    CONCATENATE-FIELDS             44X##,p
4 49X1#                    CONCATENATE-FIELDS             44X##,x
4 49X1#                    REPLACE-STRING-GENERAL         /$$x/,$$x
4 49X1#                    REPLACE-STRING-GENERAL         /.,$$x/,$$x
4 49X1#                    REPLACE-STRING-GENERAL         /;,$$x/,$$x 
4 49X1#                    REPLACE-STRING-GENERAL         /:,$$x/,$$x
4 49X1#                    REPLACE-STRING-GENERAL         /,,$$x/,$$x
4 49X1#                    REPLACE-STRING-GENERAL         / ,$$x/,$$x
4 49X1#                    CONCATENATE-FIELDS             44X##,v
4 49X1#                    REPLACE-STRING                 $$v, ;$$v
4 49X1#                    REPLACE-STRING                 . ;$$v, ;$$v
4 49X1#                    REPLACE-STRING                 ; ;$$v, ;$$v
4 49X1#                    REPLACE-STRING                 : ;$$v, ;$$v
4 49X1#                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
4 49X1#                    REPLACE-STRING                   ;$$v, ;$$v
4 49X1#                    ADD-SUBFIELD                   q,baz
4 49X1#                    REPLACE-STRING                 ;$$qbaz,$$qbaz
4 49X1#                    REPLACE-STRING-GENERAL         /,$$qbaz/$$qbaz
4 49X1#                    REPLACE-STRING                 :$$qbaz,$$qbaz
4 49X1#                    REPLACE-STRING                  $$qbaz,$$qbaz
4 49X1#                    DELETE-SUBFIELD                q
4 49X1#                    DELETE-SUBFIELD-DELIMITER      n
4 49X1#                    DELETE-SUBFIELD-DELIMITER      p
4 49X1#                    CHANGE-FIELD                   490
4 83X##                    ADD-SUBFIELD                   q,bar
4 83X##                    DELETE-SUBFIELD                a
4 83X##                    DELETE-SUBFIELD                h
4 83X##                    DELETE-SUBFIELD                n
4 83X##                    DELETE-SUBFIELD                p
4 83X##                    DELETE-SUBFIELD                v
4 83X##                    DELETE-SUBFIELD                w
4 83X##                    DELETE-SUBFIELD                x
4 83X##                    DELETE-SUBFIELD                0
4 83X##                    DELETE-SUBFIELD                3
4 83X##                    DELETE-SUBFIELD                6
4 83X##                    DELETE-SUBFIELD                8
4 83X##                    CONCATENATE-FIELDS             44X##,6
4 83X##                    CONCATENATE-FIELDS             44X##,a
4 83X##                    CONCATENATE-FIELDS             44X##,n
4 83X##                    CONCATENATE-FIELDS             44X##,p
4 83X##                    CONCATENATE-FIELDS             44X##,v
4 83X##                    REPLACE-STRING                 $$v, ;$$v
4 83X##                    REPLACE-STRING                 . ;$$v, ;$$v
4 83X##                    REPLACE-STRING                 ; ;$$v, ;$$v
4 83X##                    REPLACE-STRING                 : ;$$v, ;$$v
4 83X##                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
4 83X##                    REPLACE-STRING                   ;$$v, ;$$v
4 83X##                    ADD-SUBFIELD                   q,baz.
4 83X##                    REPLACE-STRING                 ;$$qbaz.,$$qbaz.
4 83X##                    REPLACE-STRING-GENERAL         /,$$qbaz./$$qbaz.
4 83X##                    REPLACE-STRING                 :$$qbaz.,$$qbaz.
4 83X##                    REPLACE-STRING                  $$qbaz.,$$qbaz.
4 83X##                    REPLACE-STRING                 $$qbaz.,.
4 83X##                    CONCATENATE-FIELDS             44X##,x
4 83X##                    REPLACE-STRING                 $$x,.$$x
4 83X##                    REPLACE-STRING                 ..$$x,.$$x
4 83X##                    REPLACE-STRING-GENERAL         /,.$$x/.$$x
4 83X##                    REPLACE-STRING                 ;.$$x,.$$x 
4 83X##                    REPLACE-STRING                 :.$$x,.$$x
4 83X##                    REPLACE-STRING                  .$$x,.$$x
4 83X##                    ADD-SUBFIELD                   q,bop
4 83X##                    REPLACE-STRING                 ;$$qbop,$$qbop
4 83X##                    REPLACE-STRING-GENERAL         /,$$qbop/$$qbop
4 83X##                    REPLACE-STRING                 :$$qbop,$$qbop
4 83X##                    REPLACE-STRING                  $$qbop,$$qbop
4 83X##                    REPLACE-STRING                 $$60,$$65
4 83X##                    REPLACE-STRING                 $$61,$$66
4 83X##                    REPLACE-STRING                 $$62,$$67
4 83X##                    REPLACE-STRING                 $$63,$$68
4 83X##                    REPLACE-STRING                 $$64,$$69
4 83X##                    DELETE-SUBFIELD                q
4 44X##                    DELETE-FIELD
4 83X##                    CHANGE-FIELD                   830
!*
5 440##              FIRST CHANGE-FIELD                   83X
5 83X##                    CHANGE-FIRST-IND               #, 
5 83X##                    COPY-FIELD                     44X  ,L
5 83X##                    ADD-FIELD                      49X1 ,L,$$qfoo
5 49X1#                    CONCATENATE-FIELDS             44X##,6
5 49X1#                    CONCATENATE-FIELDS             44X##,a
5 49X1#                    CONCATENATE-FIELDS             44X##,n
5 49X1#                    CONCATENATE-FIELDS             44X##,p
5 49X1#                    CONCATENATE-FIELDS             44X##,x
5 49X1#                    REPLACE-STRING-GENERAL         /$$x/,$$x
5 49X1#                    REPLACE-STRING-GENERAL         /.,$$x/,$$x
5 49X1#                    REPLACE-STRING-GENERAL         /;,$$x/,$$x 
5 49X1#                    REPLACE-STRING-GENERAL         /:,$$x/,$$x
5 49X1#                    REPLACE-STRING-GENERAL         /,,$$x/,$$x
5 49X1#                    REPLACE-STRING-GENERAL         / ,$$x/,$$x
5 49X1#                    CONCATENATE-FIELDS             44X##,v
5 49X1#                    REPLACE-STRING                 $$v, ;$$v
5 49X1#                    REPLACE-STRING                 . ;$$v, ;$$v
5 49X1#                    REPLACE-STRING                 ; ;$$v, ;$$v
5 49X1#                    REPLACE-STRING                 : ;$$v, ;$$v
5 49X1#                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
5 49X1#                    REPLACE-STRING                   ;$$v, ;$$v
5 49X1#                    ADD-SUBFIELD                   q,baz
5 49X1#                    REPLACE-STRING                 ;$$qbaz,$$qbaz
5 49X1#                    REPLACE-STRING-GENERAL         /,$$qbaz/$$qbaz
5 49X1#                    REPLACE-STRING                 :$$qbaz,$$qbaz
5 49X1#                    REPLACE-STRING                  $$qbaz,$$qbaz
5 49X1#                    DELETE-SUBFIELD                q
5 49X1#                    DELETE-SUBFIELD-DELIMITER      n
5 49X1#                    DELETE-SUBFIELD-DELIMITER      p
5 49X1#                    CHANGE-FIELD                   490
5 83X##                    ADD-SUBFIELD                   q,bar
5 83X##                    DELETE-SUBFIELD                a
5 83X##                    DELETE-SUBFIELD                h
5 83X##                    DELETE-SUBFIELD                n
5 83X##                    DELETE-SUBFIELD                p
5 83X##                    DELETE-SUBFIELD                v
5 83X##                    DELETE-SUBFIELD                w
5 83X##                    DELETE-SUBFIELD                x
5 83X##                    DELETE-SUBFIELD                0
5 83X##                    DELETE-SUBFIELD                3
5 83X##                    DELETE-SUBFIELD                6
5 83X##                    DELETE-SUBFIELD                8
5 83X##                    CONCATENATE-FIELDS             44X##,6
5 83X##                    CONCATENATE-FIELDS             44X##,a
5 83X##                    CONCATENATE-FIELDS             44X##,n
5 83X##                    CONCATENATE-FIELDS             44X##,p
5 83X##                    CONCATENATE-FIELDS             44X##,v
5 83X##                    REPLACE-STRING                 $$v, ;$$v
5 83X##                    REPLACE-STRING                 . ;$$v, ;$$v
5 83X##                    REPLACE-STRING                 ; ;$$v, ;$$v
5 83X##                    REPLACE-STRING                 : ;$$v, ;$$v
5 83X##                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
5 83X##                    REPLACE-STRING                   ;$$v, ;$$v
5 83X##                    ADD-SUBFIELD                   q,baz.
5 83X##                    REPLACE-STRING                 ;$$qbaz.,$$qbaz.
5 83X##                    REPLACE-STRING-GENERAL         /,$$qbaz./$$qbaz.
5 83X##                    REPLACE-STRING                 :$$qbaz.,$$qbaz.
5 83X##                    REPLACE-STRING                  $$qbaz.,$$qbaz.
5 83X##                    REPLACE-STRING                 $$qbaz.,.
5 83X##                    CONCATENATE-FIELDS             44X##,x
5 83X##                    REPLACE-STRING                 $$x,.$$x
5 83X##                    REPLACE-STRING                 ..$$x,.$$x
5 83X##                    REPLACE-STRING-GENERAL         /,.$$x/.$$x
5 83X##                    REPLACE-STRING                 ;.$$x,.$$x 
5 83X##                    REPLACE-STRING                 :.$$x,.$$x
5 83X##                    REPLACE-STRING                  .$$x,.$$x
5 83X##                    ADD-SUBFIELD                   q,bop
5 83X##                    REPLACE-STRING                 ;$$qbop,$$qbop
5 83X##                    REPLACE-STRING-GENERAL         /,$$qbop/$$qbop
5 83X##                    REPLACE-STRING                 :$$qbop,$$qbop
5 83X##                    REPLACE-STRING                  $$qbop,$$qbop
5 83X##                    REPLACE-STRING                 $$60,$$65
5 83X##                    REPLACE-STRING                 $$61,$$66
5 83X##                    REPLACE-STRING                 $$62,$$67
5 83X##                    REPLACE-STRING                 $$63,$$68
5 83X##                    REPLACE-STRING                 $$64,$$69
5 83X##                    DELETE-SUBFIELD                q
5 44X##                    DELETE-FIELD
5 83X##                    CHANGE-FIELD                   830
!*
6 440##              FIRST CHANGE-FIELD                   83X
6 83X##                    CHANGE-FIRST-IND               #, 
6 83X##                    COPY-FIELD                     44X  ,L
6 83X##                    ADD-FIELD                      49X1 ,L,$$qfoo
6 49X1#                    CONCATENATE-FIELDS             44X##,6
6 49X1#                    CONCATENATE-FIELDS             44X##,a
6 49X1#                    CONCATENATE-FIELDS             44X##,n
6 49X1#                    CONCATENATE-FIELDS             44X##,p
6 49X1#                    CONCATENATE-FIELDS             44X##,x
6 49X1#                    REPLACE-STRING-GENERAL         /$$x/,$$x
6 49X1#                    REPLACE-STRING-GENERAL         /.,$$x/,$$x
6 49X1#                    REPLACE-STRING-GENERAL         /;,$$x/,$$x 
6 49X1#                    REPLACE-STRING-GENERAL         /:,$$x/,$$x
6 49X1#                    REPLACE-STRING-GENERAL         /,,$$x/,$$x
6 49X1#                    REPLACE-STRING-GENERAL         / ,$$x/,$$x
6 49X1#                    CONCATENATE-FIELDS             44X##,v
6 49X1#                    REPLACE-STRING                 $$v, ;$$v
6 49X1#                    REPLACE-STRING                 . ;$$v, ;$$v
6 49X1#                    REPLACE-STRING                 ; ;$$v, ;$$v
6 49X1#                    REPLACE-STRING                 : ;$$v, ;$$v
6 49X1#                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
6 49X1#                    REPLACE-STRING                   ;$$v, ;$$v
6 49X1#                    ADD-SUBFIELD                   q,baz
6 49X1#                    REPLACE-STRING                 ;$$qbaz,$$qbaz
6 49X1#                    REPLACE-STRING-GENERAL         /,$$qbaz/$$qbaz
6 49X1#                    REPLACE-STRING                 :$$qbaz,$$qbaz
6 49X1#                    REPLACE-STRING                  $$qbaz,$$qbaz
6 49X1#                    DELETE-SUBFIELD                q
6 49X1#                    DELETE-SUBFIELD-DELIMITER      n
6 49X1#                    DELETE-SUBFIELD-DELIMITER      p
6 49X1#                    CHANGE-FIELD                   490
6 83X##                    ADD-SUBFIELD                   q,bar
6 83X##                    DELETE-SUBFIELD                a
6 83X##                    DELETE-SUBFIELD                h
6 83X##                    DELETE-SUBFIELD                n
6 83X##                    DELETE-SUBFIELD                p
6 83X##                    DELETE-SUBFIELD                v
6 83X##                    DELETE-SUBFIELD                w
6 83X##                    DELETE-SUBFIELD                x
6 83X##                    DELETE-SUBFIELD                0
6 83X##                    DELETE-SUBFIELD                3
6 83X##                    DELETE-SUBFIELD                6
6 83X##                    DELETE-SUBFIELD                8
6 83X##                    CONCATENATE-FIELDS             44X##,6
6 83X##                    CONCATENATE-FIELDS             44X##,a
6 83X##                    CONCATENATE-FIELDS             44X##,n
6 83X##                    CONCATENATE-FIELDS             44X##,p
6 83X##                    CONCATENATE-FIELDS             44X##,v
6 83X##                    REPLACE-STRING                 $$v, ;$$v
6 83X##                    REPLACE-STRING                 . ;$$v, ;$$v
6 83X##                    REPLACE-STRING                 ; ;$$v, ;$$v
6 83X##                    REPLACE-STRING                 : ;$$v, ;$$v
6 83X##                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
6 83X##                    REPLACE-STRING                   ;$$v, ;$$v
6 83X##                    ADD-SUBFIELD                   q,baz.
6 83X##                    REPLACE-STRING                 ;$$qbaz.,$$qbaz.
6 83X##                    REPLACE-STRING-GENERAL         /,$$qbaz./$$qbaz.
6 83X##                    REPLACE-STRING                 :$$qbaz.,$$qbaz.
6 83X##                    REPLACE-STRING                  $$qbaz.,$$qbaz.
6 83X##                    REPLACE-STRING                 $$qbaz.,.
6 83X##                    CONCATENATE-FIELDS             44X##,x
6 83X##                    REPLACE-STRING                 $$x,.$$x
6 83X##                    REPLACE-STRING                 ..$$x,.$$x
6 83X##                    REPLACE-STRING-GENERAL         /,.$$x/.$$x
6 83X##                    REPLACE-STRING                 ;.$$x,.$$x 
6 83X##                    REPLACE-STRING                 :.$$x,.$$x
6 83X##                    REPLACE-STRING                  .$$x,.$$x
6 83X##                    ADD-SUBFIELD                   q,bop
6 83X##                    REPLACE-STRING                 ;$$qbop,$$qbop
6 83X##                    REPLACE-STRING-GENERAL         /,$$qbop/$$qbop
6 83X##                    REPLACE-STRING                 :$$qbop,$$qbop
6 83X##                    REPLACE-STRING                  $$qbop,$$qbop
6 83X##                    REPLACE-STRING                 $$60,$$65
6 83X##                    REPLACE-STRING                 $$61,$$66
6 83X##                    REPLACE-STRING                 $$62,$$67
6 83X##                    REPLACE-STRING                 $$63,$$68
6 83X##                    REPLACE-STRING                 $$64,$$69
6 83X##                    DELETE-SUBFIELD                q
6 44X##                    DELETE-FIELD
6 83X##                    CHANGE-FIELD                   830
!*
7 440##              FIRST CHANGE-FIELD                   83X
7 83X##                    CHANGE-FIRST-IND               #, 
7 83X##                    COPY-FIELD                     44X  ,L
7 83X##                    ADD-FIELD                      49X1 ,L,$$qfoo
7 49X1#                    CONCATENATE-FIELDS             44X##,6
7 49X1#                    CONCATENATE-FIELDS             44X##,a
7 49X1#                    CONCATENATE-FIELDS             44X##,n
7 49X1#                    CONCATENATE-FIELDS             44X##,p
7 49X1#                    CONCATENATE-FIELDS             44X##,x
7 49X1#                    REPLACE-STRING-GENERAL         /$$x/,$$x
7 49X1#                    REPLACE-STRING-GENERAL         /.,$$x/,$$x
7 49X1#                    REPLACE-STRING-GENERAL         /;,$$x/,$$x 
7 49X1#                    REPLACE-STRING-GENERAL         /:,$$x/,$$x
7 49X1#                    REPLACE-STRING-GENERAL         /,,$$x/,$$x
7 49X1#                    REPLACE-STRING-GENERAL         / ,$$x/,$$x
7 49X1#                    CONCATENATE-FIELDS             44X##,v
7 49X1#                    REPLACE-STRING                 $$v, ;$$v
7 49X1#                    REPLACE-STRING                 . ;$$v, ;$$v
7 49X1#                    REPLACE-STRING                 ; ;$$v, ;$$v
7 49X1#                    REPLACE-STRING                 : ;$$v, ;$$v
7 49X1#                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
7 49X1#                    REPLACE-STRING                   ;$$v, ;$$v
7 49X1#                    ADD-SUBFIELD                   q,baz
7 49X1#                    REPLACE-STRING                 ;$$qbaz,$$qbaz
7 49X1#                    REPLACE-STRING-GENERAL         /,$$qbaz/$$qbaz
7 49X1#                    REPLACE-STRING                 :$$qbaz,$$qbaz
7 49X1#                    REPLACE-STRING                  $$qbaz,$$qbaz
7 49X1#                    DELETE-SUBFIELD                q
7 49X1#                    DELETE-SUBFIELD-DELIMITER      n
7 49X1#                    DELETE-SUBFIELD-DELIMITER      p
7 49X1#                    CHANGE-FIELD                   490
7 83X##                    ADD-SUBFIELD                   q,bar
7 83X##                    DELETE-SUBFIELD                a
7 83X##                    DELETE-SUBFIELD                h
7 83X##                    DELETE-SUBFIELD                n
7 83X##                    DELETE-SUBFIELD                p
7 83X##                    DELETE-SUBFIELD                v
7 83X##                    DELETE-SUBFIELD                w
7 83X##                    DELETE-SUBFIELD                x
7 83X##                    DELETE-SUBFIELD                0
7 83X##                    DELETE-SUBFIELD                3
7 83X##                    DELETE-SUBFIELD                6
7 83X##                    DELETE-SUBFIELD                8
7 83X##                    CONCATENATE-FIELDS             44X##,6
7 83X##                    CONCATENATE-FIELDS             44X##,a
7 83X##                    CONCATENATE-FIELDS             44X##,n
7 83X##                    CONCATENATE-FIELDS             44X##,p
7 83X##                    CONCATENATE-FIELDS             44X##,v
7 83X##                    REPLACE-STRING                 $$v, ;$$v
7 83X##                    REPLACE-STRING                 . ;$$v, ;$$v
7 83X##                    REPLACE-STRING                 ; ;$$v, ;$$v
7 83X##                    REPLACE-STRING                 : ;$$v, ;$$v
7 83X##                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
7 83X##                    REPLACE-STRING                   ;$$v, ;$$v
7 83X##                    ADD-SUBFIELD                   q,baz.
7 83X##                    REPLACE-STRING                 ;$$qbaz.,$$qbaz.
7 83X##                    REPLACE-STRING-GENERAL         /,$$qbaz./$$qbaz.
7 83X##                    REPLACE-STRING                 :$$qbaz.,$$qbaz.
7 83X##                    REPLACE-STRING                  $$qbaz.,$$qbaz.
7 83X##                    REPLACE-STRING                 $$qbaz.,.
7 83X##                    CONCATENATE-FIELDS             44X##,x
7 83X##                    REPLACE-STRING                 $$x,.$$x
7 83X##                    REPLACE-STRING                 ..$$x,.$$x
7 83X##                    REPLACE-STRING-GENERAL         /,.$$x/.$$x
7 83X##                    REPLACE-STRING                 ;.$$x,.$$x 
7 83X##                    REPLACE-STRING                 :.$$x,.$$x
7 83X##                    REPLACE-STRING                  .$$x,.$$x
7 83X##                    ADD-SUBFIELD                   q,bop
7 83X##                    REPLACE-STRING                 ;$$qbop,$$qbop
7 83X##                    REPLACE-STRING-GENERAL         /,$$qbop/$$qbop
7 83X##                    REPLACE-STRING                 :$$qbop,$$qbop
7 83X##                    REPLACE-STRING                  $$qbop,$$qbop
7 83X##                    REPLACE-STRING                 $$60,$$65
7 83X##                    REPLACE-STRING                 $$61,$$66
7 83X##                    REPLACE-STRING                 $$62,$$67
7 83X##                    REPLACE-STRING                 $$63,$$68
7 83X##                    REPLACE-STRING                 $$64,$$69
7 83X##                    DELETE-SUBFIELD                q
7 44X##                    DELETE-FIELD
7 83X##                    CHANGE-FIELD                   830
!*
8 440##              FIRST CHANGE-FIELD                   83X
8 83X##                    CHANGE-FIRST-IND               #, 
8 83X##                    COPY-FIELD                     44X  ,L
8 83X##                    ADD-FIELD                      49X1 ,L,$$qfoo
8 49X1#                    CONCATENATE-FIELDS             44X##,6
8 49X1#                    CONCATENATE-FIELDS             44X##,a
8 49X1#                    CONCATENATE-FIELDS             44X##,n
8 49X1#                    CONCATENATE-FIELDS             44X##,p
8 49X1#                    CONCATENATE-FIELDS             44X##,x
8 49X1#                    REPLACE-STRING-GENERAL         /$$x/,$$x
8 49X1#                    REPLACE-STRING-GENERAL         /.,$$x/,$$x
8 49X1#                    REPLACE-STRING-GENERAL         /;,$$x/,$$x 
8 49X1#                    REPLACE-STRING-GENERAL         /:,$$x/,$$x
8 49X1#                    REPLACE-STRING-GENERAL         /,,$$x/,$$x
8 49X1#                    REPLACE-STRING-GENERAL         / ,$$x/,$$x
8 49X1#                    CONCATENATE-FIELDS             44X##,v
8 49X1#                    REPLACE-STRING                 $$v, ;$$v
8 49X1#                    REPLACE-STRING                 . ;$$v, ;$$v
8 49X1#                    REPLACE-STRING                 ; ;$$v, ;$$v
8 49X1#                    REPLACE-STRING                 : ;$$v, ;$$v
8 49X1#                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
8 49X1#                    REPLACE-STRING                   ;$$v, ;$$v
8 49X1#                    ADD-SUBFIELD                   q,baz
8 49X1#                    REPLACE-STRING                 ;$$qbaz,$$qbaz
8 49X1#                    REPLACE-STRING-GENERAL         /,$$qbaz/$$qbaz
8 49X1#                    REPLACE-STRING                 :$$qbaz,$$qbaz
8 49X1#                    REPLACE-STRING                  $$qbaz,$$qbaz
8 49X1#                    DELETE-SUBFIELD                q
8 49X1#                    DELETE-SUBFIELD-DELIMITER      n
8 49X1#                    DELETE-SUBFIELD-DELIMITER      p
8 49X1#                    CHANGE-FIELD                   490
8 83X##                    ADD-SUBFIELD                   q,bar
8 83X##                    DELETE-SUBFIELD                a
8 83X##                    DELETE-SUBFIELD                h
8 83X##                    DELETE-SUBFIELD                n
8 83X##                    DELETE-SUBFIELD                p
8 83X##                    DELETE-SUBFIELD                v
8 83X##                    DELETE-SUBFIELD                w
8 83X##                    DELETE-SUBFIELD                x
8 83X##                    DELETE-SUBFIELD                0
8 83X##                    DELETE-SUBFIELD                3
8 83X##                    DELETE-SUBFIELD                6
8 83X##                    DELETE-SUBFIELD                8
8 83X##                    CONCATENATE-FIELDS             44X##,6
8 83X##                    CONCATENATE-FIELDS             44X##,a
8 83X##                    CONCATENATE-FIELDS             44X##,n
8 83X##                    CONCATENATE-FIELDS             44X##,p
8 83X##                    CONCATENATE-FIELDS             44X##,v
8 83X##                    REPLACE-STRING                 $$v, ;$$v
8 83X##                    REPLACE-STRING                 . ;$$v, ;$$v
8 83X##                    REPLACE-STRING                 ; ;$$v, ;$$v
8 83X##                    REPLACE-STRING                 : ;$$v, ;$$v
8 83X##                    REPLACE-STRING-GENERAL         /, ;$$v/ ;$$v
8 83X##                    REPLACE-STRING                   ;$$v, ;$$v
8 83X##                    ADD-SUBFIELD                   q,baz.
8 83X##                    REPLACE-STRING                 ;$$qbaz.,$$qbaz.
8 83X##                    REPLACE-STRING-GENERAL         /,$$qbaz./$$qbaz.
8 83X##                    REPLACE-STRING                 :$$qbaz.,$$qbaz.
8 83X##                    REPLACE-STRING                  $$qbaz.,$$qbaz.
8 83X##                    REPLACE-STRING                 $$qbaz.,.
8 83X##                    CONCATENATE-FIELDS             44X##,x
8 83X##                    REPLACE-STRING                 $$x,.$$x
8 83X##                    REPLACE-STRING                 ..$$x,.$$x
8 83X##                    REPLACE-STRING-GENERAL         /,.$$x/.$$x
8 83X##                    REPLACE-STRING                 ;.$$x,.$$x 
8 83X##                    REPLACE-STRING                 :.$$x,.$$x
8 83X##                    REPLACE-STRING                  .$$x,.$$x
8 83X##                    ADD-SUBFIELD                   q,bop
8 83X##                    REPLACE-STRING                 ;$$qbop,$$qbop
8 83X##                    REPLACE-STRING-GENERAL         /,$$qbop/$$qbop
8 83X##                    REPLACE-STRING                 :$$qbop,$$qbop
8 83X##                    REPLACE-STRING                  $$qbop,$$qbop
8 83X##                    REPLACE-STRING                 $$60,$$65
8 83X##                    REPLACE-STRING                 $$61,$$66
8 83X##                    REPLACE-STRING                 $$62,$$67
8 83X##                    REPLACE-STRING                 $$63,$$68
8 83X##                    REPLACE-STRING                 $$64,$$69
8 83X##                    DELETE-SUBFIELD                q
8 44X##                    DELETE-FIELD
8 83X##                    CHANGE-FIELD                   830
!*
9 LDR                      SORT-FIELDS