Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: AUTLCMP2

AUTLCMP2.m

Go to the documentation of this file.
AUTLCMP2 ;IHS/OIT/FBD - COMPARE ISO 639-2 LANGUAGE CODES TO TEXT FILE
 ;;98.1;IHS DICTIONARIES (POINTERS);**26**;FEB 9,2011;Build 6
 ;
 ;IHS/OIT/FBD - UTILITY TO COMPARE THE CONTENTS OF A TEXT FILE CONTAINING
 ;THE ISO 639-2 LANGUAGE CODE SET AGAINST CURRENT ENTRIES IN THE RPMS
 ;LANGUAGES FILE (FILE #9999999.99) AND IDENTIFY THE FOLLOWING:
 ; - ENTRIES IN THE TEXT FILE NOT MATCHED AGAINST THE LANGUAGES; THESE
 ;   REPRESENT POTENTIAL NEW ENTRIES WHICH NEED TO BE EVALUATED FOR 
 ;   ADDITION TO THE LANGUAGES FILE.
 ; - ENTRIES IN THE LANGUAGES FILE WHICH DO NOT HAVE A CORRESPONDING
 ;   TEXT FILE ENTRY; THESE REPRESENT POTENTIALLY OBSOLETE OR ERRONEOUS
 ;   LANGUAGES FILE ENTRIES.
 ;
 ;THE TEXT FILE SHOULD BE NAMED 'ISO-639-2_utf-8.txt' AND RESIDE IN THE
 ;DIRECTORY SPECIFIED IN THE FILE IMPORT PATH FIELD OF THE RPMS SITE FILE.
 ;THE SOURCE FOR THE TEXT FILE CAN BE FOUND AT THE FOLLOWING URL:
 ;http://www.loc.gov/standards/iso639-2/ascii_8bits.html
 ;THE FILE'S DATA WILL BE ARRANGED IN THE FOLLOWING FORMAT, WITH FIELDS
 ;SEPARATED BY PIPE CHARACTERS (|):
 ;
 ;ISO 639-2 Code B|ISO 639-2 Code T|ISO 639-1 Code|English Language name|French Language name
 ;
 ;THE FRENCH LANGUAGE NAME FIELD IS NOT USED BY RPMS; IT IS INCLUDED
 ;SOLELY TO DOCUMENT ITS PRESENCE IN THE LIBRARY OF CONGRESS TABLES.
 ;ITS INCLUSION MAY BE CONSIDERED OPTIONAL.
 ;
 ;SOME LANGUAGES HAVE TWO ISO 639-2 CODES REFLECTING BIBLIOGRAPHIC USAGE
 ;VERSUS TERMINOLOGY USAGE; THESE LANGUAGES WILL HAVE BOTH THE ISO 639-2
 ;Code B AND ISO 639-2 Code T FIELDS POPULATED.  THE VAST MAJORITY OF
 ;LANGUAGES WILL HAVE ONLY A SINGLE CODE, IN WHICH CASE ONLY THE
 ;ISO 639-2 Code B FIELD WILL BE POPULATED.
 ;
 ;
 D INIT
 D:'AUTEXIT MAIN
 D CLEANUP
 Q
 ;
INIT ;PRIMARY MODULE INITIALIZATION
 S AUTEXIT=0
 S AUTDIR=$P(^AUTTSITE(1,1),U,1)  ;RPMS SITE/FILE IMPORT PATH DIRECTORY
 S AUTFILE="ISO-639-2_utf-8.txt"  ;IMPORT FILE NAME
 S AUTFS="|"  ;TEXT FILE'S FIELD SEPARATOR
 K AUTMATCH S AUTMATCH=0  ;ARRAY TO LOG MATCHED CODES FROM TEXT FILE
 K AUTMISS S AUTMISS=0  ;ARRAY TO LOG UNMATCHED CODES FROM TEXT FILE
 ;
 S IOP="HFS"
 S %ZIS("HFSNAME")=AUTDIR_AUTFILE
 S %ZIS("HFSMODE")="R"
 D ^%ZIS
 I POP D  Q
 .W !!,"JOB ABORTED - FILE ",AUTFILE," NOT FOUND IN ",AUTDIR," IMPORT DIRECTORY.",!
 .S AUTEXIT=1
 Q
 ;
MAIN ;PRIMARY MODULE EXECUTION DRIVER
 F  D  Q:AUTEXIT
 .U IO
 .R AUTRCD:0
 .I AUTRCD="" D ^%ZISC S AUTEXIT=1 Q
 .D EXTRACT
 .U IO(0) W !,AUTISO2," - ",AUTISO2T," - ",AUTISO1," - ",AUTLANG  ;DEBUG
 .D EVAL
 Q
 ;
EXTRACT ;EXTRACT DATA FROM INPUT RECORD
 S AUTISO2=$P(AUTISO,AUTFS,1)  ;ISO 639-2 CODE
 S AUTISO2T=$P(AUTISO,AUTFS,2)  ;ISO 639-2 TERMINOLOGY CODE (IF PRESENT)
 S AUTISO1=$P(AUTISO,AUTFS,3)  ;ISO 639-1 CODE (IF PRESENT)
 S AUTLANG=$P(AUTISO,AUTFS,4)  ;ENGLISH NAME FOR LANGUAGE
 Q
 ;
EVAL ;EVALUATE EXTRACTED CODE(S)
 
 Q
 ;
CLEANUP ;POST-EXECUTION PARTITION CLEANUP
 ;K AUTDIR,AUTEXIT,AUTFILE,AUTFS,AUTRCD
 ;K AUTISO1,AUTISO2,AUTISO2T,AUTLANG
 Q