900 Series HP 3000 Computer Systems MPE XL Native Language Programmer's Guide ABCDE HP Part No. 32650-90022 Printed in U.S.A.
The information contained in this document is subject to change without notice. HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable for errors contained herein or use of this material. Hewlett-Packard assumes no responsibility for the use or reliability of its software on equipment that is not furnished by Hewlett-Packard.
Printing History The following table lists the printings of this document, together with the respective release dates for each edition. The software version indicates the version of the software product at the time this document was issued. Many product releases do not require changes to the document. Therefore, do not expect a one-to-one correspondence between product releases and document editions.
Preface The Native Language Programmer's Guide is written for experienced programmers. It provides the HP 3000 programmer with the features necessary to produce localized application programs for end users without reprogramming for each country or language. The following information is contained in this manual: Chapter 1 Introduction introduces the subject matter of this manual. Chapter 2 Supported Native Languages describes the character sets supported and the language-dependent characteristics of each.
Conventions UPPERCASE In a syntax statement, commands and keywords are shown in uppercase characters. The characters must be entered in the order shown; however, you can enter the characters in either uppercase or lowercase. For example, COMMAND can be entered as any of the following: command Command COMMAND It cannot, however, be entered as: comm italics lename In a syntax statement, a word in bold italics represents a parameter that you must replace with the actual value.
COMMAND 8 ON OFF
Conventions [ ] (continued) In a syntax statement, brackets enclose optional elements. In the following example, OPTION can be omitted: COMMAND lename [OPTION] When several elements are stacked within brackets, you can select one or none of the elements. In the following example, you can select OPTION or parameter or neither. The elements cannot be repeated. COMMAND lename [ ...
(parameter)1(parameter) 4 5 4CTRL5character 10 5 indicates a key on the The symbol 4 keyboard. For example, 4RETURN5 represents the carriage return key or 4Shift5 represents the shift key. 4CTRL5character indicates a control character. For example, 4CTRL5Y means that you press the control key and the Y key simultaneously.
Conventions base pre xes (continued) The pre xes %, #, and $ specify the numerical base of the value that follows: %num speci es an octal number. #num speci es a decimal number. $num speci es a hexadecimal number. bits (bit :length ) If no base is speci ed, decimal is assumed.
Contents 1. Introduction 2. Supported Native Languages 3. NLS Components 4. NLS in the Subsystems 5. Accessing NLS Features 6. Implicit Language Choice in Subsystems 7. Application Programs Accessing NLS Why NLS? . . . . . . . . . . . . . . . . . . Scope of Native Language Support . . . . . . . . 8-Bit Character Sets . . . . . . . . . . . . . . Language- Dependent Characteristics . . . . . . . NLS System Utilities . . . . Con guring Native Languages NLS Intrinsics . . . . . . .
2 A. Character Sets B. Collating Sequences C. EBCDIC Mapping D. Converting 7-Bit to 8-Bit Data Language- Dependent Variations Spanish . . . . . . . . . . Danish/Norwegian . . . . . Swedish . . . . . . . . . . Finnish . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 10 11 11 12 Background Data . . . . . . . . . . . . . . . . ROMAN8 to EBCDIC Mapping . . . . . . . . . 1 2 National Substitution Sets . . . . . . . . . . . .
Obtain Language Information from a COBOLII Program . . . . . . . . . . . . . . . . . .
Figures 3-1. 7-1. 7-2. 7-3. 7-4. 7-5. A-1. A-2. A-3. A-4. A-5. A-6. A-7. A-8. A-9. A-10. D-1. D-2. GENCAT Utility Program . . . . . General Application Program Format Application Program Without NLS . Single Language Application . . . . Multilingual Application . . . . . Subsystem Utility Program . . . . USASCII Character Set . . . . . . ROMAN8 Character Set . . . . . KANA8 Character Set . . . . . . ARABIC8 Character Set . . . . . GREEK8 Character Set . . . . . . TURKISH8 Character Set . . . . .
1 Introduction The Hewlett-Packard Native Language Support (NLS) is a feature of the MPE XL system and its associated subsystems. It enables the applications designer/programmer to write applications in the end user's local language. Why NLS? A well-written application program manipulates data and presents it appropriately for its use. Programs written with the intention of providing a friendly user interface often make assumptions about the local customs and language of the end user.
NLS provides the tools for an applications designer/programmer to produce localized applications. These tools may include architecture support, peripheral support, and software facilities within the operating systems and subsystems. NLS addresses the internal functions of a program (for example, sorting) and its user interface (for example, messages and formats).
2 Supported Native Languages Native Language Support (NLS) is based on languages and character sets that are prede ned and built into the operating system. These are referred to as supported languages. Hewlett-Packard has assigned a unique language name and language ID number to each language supported in NLS.
8-Bit Character Sets Within NLS, each supported language is associated with an 8-bit character set. (One character set may support many languages.) Before the introduction of NLS, the only widely supported character set was USASCII, a 128-character set designed to support American English text. USASCII uses only seven bits of an 8-bit byte to encode a character, the eighth or high-order bit is always zero.
LanguageDependent Characteristics For each native language supported by NLS, a number of characteristics are known: Lexical conventions vary from country to country. The collating sequence is a ected by the local alphabet and usage of each language. Upshifting tables maintained by NLS for each supported language contain the result of upshifting any character in the corresponding character set.
3 NLS Components The components of NLS consist of utility programs (LANGINST and NLUTIL), system intrinsics, and an application message facility. NLS System Utilities Configuring Native Languages Note System managers use LANGINST to select and con gure native languages to be supported on their system(s). NLUTIL is used to obtain the details of languages installed on a system. For a full description of the LANGINST and NLUTIL utilities, refer to the MPE XL System Utilities Reference Manual (32650-90081).
NLS Intrinsics Application programs and Hewlett-Packard subsystems call NLS to obtain language-dependent information for any language installed on a system. The following table lists the NLS intrinsics and their functions: Table 3-1. NLS Intrinsic Categories Function Information Retrieving Character Handling Intrinsic Description ALMANAC Returns numeric data information. NLGETLANG Returns the current language. NLINFO Returns language-dependent information.
Table 3-1. NLS Intrinsic Categories (continued) Function Application Message Catalog Intrinsic Description CATCLOSE Closes a message catalog. CATOPEN Opens a message catalog. CATREAD Reads information from a message catalog. NLAPPEND Concatenates a le name and a language number. Refer to the MPE XL Intrinsics Reference Manual (32650-90028) for a complete description of each intrinsic.
Peripheral Support Most Hewlett-Packard peripherals are designed for 8-bit operation. Most peripherals that have been con gured for 7-bit operation can be recon gured for 8-bit operation. (Refer to the System Startup, Con guration, and Shutdown Reference Manual (32650-90042) for procedures.) Limitations and notes are listed for each peripheral. All NLS features are available to users with 7-bit USASCII terminals and printers, provided that the data used contains only USASCII characters.
Application Message Facility A localizable program contains no text (prompts, commands, messages) stored in the code itself. This allows the text to be translated without modifying or recompiling the program source code. The Application Message Facility is an NLS tool that provides a programmer with the exibility needed to create application catalogs for localized applications.
The GENCAT program is used to convert an ASCII source le containing messages into a binary application catalog that can be accessed by the intrinsics. Application programs use the message catalog intrinsics to retrieve messages from it. An application message catalog consists of a le containing character strings (messages), each uniquely identi able by a set number and a message number within a set.
4 NLS in the Subsystems NLS provides MPE XL intrinsic features in COBOL II/XL, FCOPY, IMAGE, KSAM, QUERY, SORT-MERGE, and VPLUS. NLS features in these subsystems provide the tools to design local language applications. The subsystems themselves are not localized. The application end user, not the programmer or subsystem user, sees the localized interface. MPE XL Native Language Support intrinsics provide the means to implement NLS features of the subsystems.
5 Accessing NLS Features On HP 3000 systems using MPE XL and subsystems with NLS features, all NLS features are optional. These features must be requested by the applications programmer through intrinsic calls or interactively by the user of a subsystem program through a LANGUAGE command or keyword. One option for obtaining NLS features from an application program is through calls to speci c NLS intrinsics, primarily in MPE XL.
Commands Commands or keywords that make NLS features available on request have been added to certain subsystems. (For example, entering LANGUAGE=FRENCH within QUERY causes sorted character data of IMAGE types X and U to be sorted, in its output reports, according to the French collating sequence. If the language command is not entered, QUERY performs as it did before the introduction of NLS.
6 Implicit Language Choice in Subsystems Two NLS job control words (JCWs), NLUSERLANG and NLDATALANG, permit the subsystem user to designate a default language other than NATIVE-3000 for the subsystems. Each of the ve subsystem programs (SORT, MERGE, FCOPY, QUERY, and ENTRY) looks at one of these JCWs, and its value is used as a default language by the program. The default can be superseded by a speci c command.
NLGETLANG Intrinsic User-Defined Commands (UDCs) 2 NLUSERLANG and NLDATALANG values are retrieved by the subsystems through calls to the NLGETLANG intrinsic. Application programs can also use this intrinsic. NLGETLANG retrieves the value of the language attribute requested and veri es its installation. If the value is that of an uncon gured or unde ned language, NLGETLANG returns a language ID number of 0 (NATIVE-3000) and an error.
7 Application Programs Accessing NLS The focus of HP 3000 NLS is the application program. Most NLS tools are accessed programmatically from applications according to the requirements of the designer or programmer. Several common application models are possible as illustrated in Figure 7-1 through Figure 7-5. NLS capabilities can be used in single language applications, multilingual applications, in subsystem utility programs, or not at all.
General Application Program The functions language can in uence an application in terms of data manipulation (internals) and user interaction (externals), as illustrated in Figure 7-1. The core application program is anked by functions that can di er according to language and local customs (local date, time, and currency formats). Figure 7-1.
Application Program Without NLS Figure 7-2 shows an application program that does not make use of NLS capabilities. This NATIVE-3000 application makes use of conventional programming techniques and standard MPE and subsystem features to achieve the key language-dependent functions. It cannot be localized without reprogramming and is una ected by the introduction of NLS. Figure 7-2.
Single Language Application French is used as the single language application example in Figure 7-3. The applications designer has determined that only French is required, and has hard-coded its language ID number (langnum ) 7 into the program. The langnum is used as a parameter in calling various native language-dependent intrinsics. In addition, the designer has created IMAGE databases, KSAM les, and VPLUS forms les with the French language attribute, and has expressed all prompts and messages in French.
Multilingual Applications The program in Figure 7-4 shows a localizable or multilingual application. This application can be used in several countries or in multiple languages by di erent users on the same system. The key attribute of this program is that it selects its language(s) at run time. When installing an application on a system, the manager of the application may establish con guration le(s) for that application.
Figure 7-4.
Subsystem Utility Program Figure 7-5 shows a special category of multilingual application, the Hewlett-Packard subsystem utility program. Many of these programs are not typically used by end users, but are used to manipulate end-user data in conjunction with application programs. They determine which language to use at run time through a user-entered keyword or command, or defaults. The user interface in these programs has not been made localizable since many of these programs are not end-user tools.
A Character Sets NLS supports ten character sets containing the following native languages: Table A-1.
The collating sequence table. The ASCII-to-EBCDIC and EBCDIC-to-ASCII translate tables. The long date format (the DATELINE format). The short date format (the custom date format). The time format. The currency symbol (one character). The currency descriptor (up to four characters). The position and spacing of the currency sign. The decimal and thousands separators for numbers. The equivalents of YES and NO (both up to six characters). The full weekday names (up to twelve characters).
Figure A-1.
Figure A-2.
Figure A-3.
Figure A-4.
Figure A-5.
Figure A-6.
Figure A-7.
Figure A-8.
Figure A-9.
Figure A-10.
B Collating Sequences Collating is de ned as arranging character strings into order (usually alphabetic). To do this, a mechanism must be available that, given two character strings, decides which one comes rst. In Native Language Support (NLS) this mechanism is the NLCOLLATE intrinsic. Note This appendix deals with collating or lexical ordering and does not include matching. For matching purposes, there is generally a di erence between A and a.
Table B-1. Collating Sequence Priority Example Priority Explanation Sorted Strings aEb, aEc The third character in each string is di erent. The \b" precedes the \c". a eb,aEb The characters in the two strings are identical, so accent priority determines the order. The \ e" precedes the \E". abc, Abd The last characters in the strings are di erent. The \c" precedes the \d". aBc, abc The characters in the two strings are the same, so the uppercase priority determines the order.
Table B-2.
Table B-2.
Table B-2.
Table B-2.
Table B-2.
Table B-2. Collating Sequence (continued) Character Description Decimal Equivalent 8 Collating Sequences + 43 Plus - 45 Minus 6 254 Plus/Minus 1 4 247 One quarter 1 2 248 One half 179 Degree (ring) % 37 Percent sign * 42 Asterisk .
Table B-2.
Following are the language-dependent variations to the collating sequences for Spanish, Danish/Norwegian, Swedish, and Finnish. LanguageDependent Variations Spanish The CH is considered a separate character, which collates between C and D: C@ CH Ch cH ch D Where @ equals anything; therefore, CH comes after C followed by anything and before D.
Danish/Norwegian The , , and A collate at the end of the alphabet: Table B-4.
Finnish and O collate at the end of the alphabet. is considered The A, A, and V, W, Y, and U are considered the same: the same as O Table B-6.
Table B-6.
C EBCDIC Mapping NLS provides mappings, through NLTRANSLATE and NLINFO, from HP 3000-supported character sets (ROMAN8, KANA8) to the various national versions of the EBCDIC code. This applies to all native languages supported on the HP 3000 and is done di erently for each language. Background Data EBCDIC is an 8-bit code that originally used only 128 of the 256 possible code values. These 128 characters have almost the same graphic representations as the traditional 7-bit, 128-character, USASCII code.
In mapping from ROMAN8 to EBCDIC, characters look the same, or as close as possible, before and after conversion. The majority of the symbols appearing in ROMAN8 also exist in the EBCDIC country extended code pages. In ROMAN8, there are nine characters that have no similar EBCDIC character and six unde ned characters. Since there are no unde ned characters in the EBCDIC country extended code pages, 15 characters in EBCDIC have no look-alikes in ROMAN8.
The mappings can be made available to a program by using NLINFO item =13 or 14. The mappings are used by the NLTRANSLATE intrinsic, which performs the Hewlett-Packard 8-bit to EBCDIC translation or the reverse. The CTRANSLATE intrinsic maps USASCII or JISCII to EBCDIC (and vice versa). For the languages NATIVE-3000 and KATAKANA, there is no di erence between the mappings produced by NLTRANSLATE and CTRANSLATE.
D Converting 7-Bit to 8-Bit Data Many Hewlett-Packard peripherals can be con gured for 7-bit operation with one of the European language national substitution character sets. These peripherals must be converted to 8-bit operation to access Native Language Support (NLS) capability. NLS requires the use of 8-bit character sets that include USASCII and native language characters.
National Substitution Sets Many Hewlett-Packard peripherals support the 7-bit national substitution sets for the following languages. They are listed here as they appear on the terminal con guration menus of the terminals that support them: DANSK/NORSK DEUTSCH ESPANOL ESPANOL M FRANCAIS FRANCAIS M ITALIANO (On a few devices only.
Conversion Utilities Because NLS involves using full 8-bit character sets for all data, customers wanting to use the facility need to con gure their peripherals for 8-bit operation. (This is not possible for the HP 264X terminals.) Several utilities are available to convert existing data that has been input with an HP 262X terminal con gured for 7-bit operation. Refer to Table D-1 for a listing of these utilities.
The conversion utilities convert records or elds from les that are assumed to have been created at an HP 262X terminal con gured for 7-bit operation and for a language other than USASCII. The conversion from the HP 262X implementation of a European 7-bit substitution character set to the 8-bit ROMAN8 character set. This involves converting the values of certain characters stored in the le.
Table D-3 shows the special character conversion for speci ed FRANCAIS M and ESPANOL M characters. If these characters are followed immediately by certain characters, the two-character combination is converted to a single ROMAN8 character, and the eld or record being converted is padded at the end with a blank. Table D-3. Special Character Conversion Language Francais M Character Conversion ^ (94) followed by a, e, i, o, or u is converted to @ (192), ^e (193), ^ (209), o^ (194), or u^ (195).
Conversion Procedure To convert 7-bit substitution data to 8-bit ROMAN8 data, perform the following steps: 1. Determine which les need to be converted. A le must be converted if the data was input from an HP 262X terminal con gured for 7-bit operation or for a national substitution set other than USASCII. 2. Determine the national substitution set (language on the terminal con guration menu) from which the conversion should be done for each le.
:RUN N7MF8CNV.PUB.SYS HP European 7-Bit character sets are: 1. 2. 3. 4. 5. 6. 7. 8. 9. SVENSK/SUOMI DANSK/NORSK FRANCAIS M FRANCAIS DEUTSCH UK ESPANOL M ESPANOL ITALIANO From which character set should conversion be done: 5 File types which can be converted are: 1. MPE text files (each record converted as one field). 2. MPE data files (define fields; only defined fields are converted). 3. Test Conversion.
Please supply one at a time the field to be converted first: Start, Start, Start, Start, Length: Length: Length: Length: 1,12 15,30 61, 6 4Return5 Data file XYZ: fields to be converted are: 1, 15, 61, 12 30 6 Correct? 4Return5 287 records converted in XYZ Name of data file to be converted: 4Return5 File types which can be converted are: 1. MPE text files (each record converted as one field). 2. MPE data files (define fields; only defined fields are converted). 3. Test Conversion.
N7MF8CNV Utility N7MF8CNV converts data in EDIT/XL and other MPE text and data les from a Hewlett-Packard 7-bit national substitution character set to ROMAN8. The user is prompted for language and le type (text or data). For a data le, the user is prompted on each le for the starting position and length of each eld (portion of a record) to be converted. For a text le, each record is converted as one eld. The user is prompted for the name of each le to be converted.
In addition to the text and data options, there is a test conversion option that shows how the conversion algorithm operates. The test conversion option must be run from a terminal con gured for 7-bit operation with the chosen national substitution set. The user is instructed to enter a string, and the result of the conversion is displayed. The user does not have to switch back and forth between 7-bit and 8-bit operation to see the result.
I7DB8CNV Utility I7DB8CNV converts the character data in an IMAGE database from any Hewlett-Packard 7-bit national substitution set to ROMAN8. The program is a special version of the DBLOAD.PUB.SYS program, and the conversion is done as part of a database load. The procedure for running I7DB8CNV is: 1. Enter: RUN DBUNLOAD.PUB.SYS This unloads the database to tape. 2. Enter: RUN DBUTIL.PUB.SYS,ERASE This erases the database data. 3.
I7DB8CNV does not allow 8-bit data (bytes with the high-order bit set) in the data elds it is trying to convert. The utility does not abort, but the eld in question is not converted, and a warning is issued: 8-bit data encountered in item [itemname in DS data set] If the program should abort for any reason during the conversion, the user must log on again to clear the temporary les used during the conversion process before running the program again.
RUN I7DB8CNV.PUB.SYS HP European 7-bit character sets are: 1. 2. 3. 4. 5. 6. 7. 8. 9.
V7FF8CNV Utility V7FF8CNV converts text and literals in VPLUS/XL forms les, from a Hewlett-Packard 7-bit national substitution character set, to ROMAN8. V7FF8CNV is a special version of FORMSPEC.PUB.SYS and is run the same way. Before running this utility back up the forms le (store to tape or SYSGEN), perform the following steps: 1. Con gure your terminal for 8-bit operation. Refer to System Startup, Con guration, and Shutdown Reference Manual (32650-90042) for information on peripheral con guration. 2.
V7FF8CNV and Alternate Character Sets Group 1 - HP 2392A, 2625A, 2627A, 2628A, 2700, and 150 Group 2 - HP 2622A, 2623A, 2626A, and 2382A Hewlett-Packard block mode terminals, which have the capability of handling all or part of ROMAN8, can be divided into two groups. The group di erentiation is based on how they handle alternate character sets when con gured for 8-bit operation.
V7FF8CNV must be run on a terminal supported by VPLUS/XL, which supports display of all characters, enhancements, and alternate character sets used in the forms. If alternate character sets are used, the HP 2392, 2625, 2627, 2628, 2700, or 150 are recommended. V7FF8CNV Operation The V7FF8CNV procedure is: 1. Con gure your terminal type properly for 8-bit operation by using the settings recommended in System Startup, Con guration, and Shutdown Reference Manual (32650-90042). 2. Run V7FF8CNV.PUB.SYS.
E Application Guidelines Currently, six conventional programming languages (SPL, FORTRAN, COBOL II/XL, Pascal, RPG, and BASIC) are supported. General and speci c guidelines for each supported programming language are included in this appendix to aid the programmer in language selection for writing a local language or localizable application. All Programming Languages General guidelines for all languages supported include the following: Create and use message catalogs.
Most Hewlett-Packard and user-written software assumes that numeric characters (0 through 9) are represented by code values 48 through 57 (decimal). In general, this is valid because standard Hewlett-Packard 8-bit character sets are supersets of USASCII. However, some character sets may have di erent or additional characters that should be treated as numeric. Therefore, if at all possible, avoid doing range checks on code values to recognize or process numeric characters.
COBOL II/XL (HP 32233A) FORTRAN (HP 32102B) Speci c guidelines for COBOL II/XL, include the following: Use the character attributes table of the character set being used to determine whether a character is alphabetic or numeric. This table is available through a call to NLINFO itemnum =12. Do not use the COBOL II/XL ALPHABETIC and NUMERIC class tests to determine this (for example, IF data-item IS ALPHABETIC).
SPL (HP 32100A) RPG (HP 32104A) BASIC (HP 32101B) Pascal (HP 32106A) 4 Application Guidelines Speci c guidelines for SPL include the following: To determine whether or not the byte is alphabetic, numeric, or special, consult the character attribute table of the character set used. This table is available through NLINFO item 12. Do not use the "IF xyz = (or <>) ALPHA (or NUMERIC or SPECIAL)" construct to determine this. Do not use the MOVE . . . WHILE construct or the MVBW machine instruction.
F Example Programs The example programs in this appendix demonstrate calls to NLS-related intrinsics from several programming languages. They are not intended to be used as application programs.
Sort from a COBOLII Program This program shows how to sort an input le (formal designator INPTFILE) to an output le (formal designator OUTPFILE) using a COBOLII SORT verb. Lines 3.5 and 4.1 show how to specify the language to determine the collating sequence. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4 4.1 4.2 4.3 4.4 2 Example Programs $CONTROL USLINIT IDENTIFICATION DIVISION. PROGRAM-ID. EXAMPLE.
In the example execution, the input and output les are associated with the terminal ($STDIN and $STDLIST): :FILE INPTFILE=$STDIN :FILE OUTPFILE=$STDLIST :RUN PROGRAM;MAXDATA=12000 character credt DEBIT :EOD credit character DEBIT END OF PROGRAM : Example Programs 3
Sort from a Pascal Program This program shows how to sort an input le (formal designator INPF) to an output le (formal designator OUTF) using the SORTINIT intrinsic call. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 4 Example Programs $USLINIT$ $STANDARD_LEVEL 'HP3000'$ PROGRAM example (inpf,outf); TYPE smallint = -32768 ..
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 WITH keys DO BEGIN position := 1; length := 4; seq_type := 9; END; WITH cseq DO BEGIN array_code:=1; language:= 12; END; WITH inp DO BEGIN RESET (inpf); num_file := FNUM (inpf); num_zero := 0; END; WITH out DO BEGIN REWRITE (outf); num_file := FNUM (outf); num_zero := 0; END; sortinit (inp,out,,reclen,,numkeys,keys,,,,,,,,cseq); sortend; END; BEGIN main; END.
In the example execution, the input and output les are associated with the terminal ($STDIN and $STDLIST): :FILE INPF=$STDIN :FILE OUTF=$STDLIST :RUN PROGRAM;MAXDATA=12000 character credit DEBIT :EOD credit character DEBIT END OF PROGRAM : 6 Example Programs
Sort from a FORTRAN Program This program shows how to sort an input le (formal designator FTN21) to an output le (formal designator FTN22) using the SORTINIT intrinsic call.
The user is asked to enter a language. All date and time formatting and conversion is done by using the language entered by the user. The time and date used in the examples is the current system time obtained by calling the HP 3000 system intrinsics CALENDAR and CLOCK.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 C C C C C C 100 C C 200 C C 300 C C C C 400 C C C C C C C C C C C #"ENTER A LANGUAGE NAME OR NUMBER (MAX. 16 CHARACTERS):" READ (5, 2001) BLANGUAGE NLINFO item 22 returns the corresponding lang number in integer format for this language. CALL NLINFO (22, LANGUAGE, LANGNUM, LERROR) IF (IERROR(1) .EQ. 0) GO TO 400 IF (IERROR(1) .NE.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 10 Example Programs C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C WRITE (6, 1001) BWEEKDAYS (WEEKDAY) Format the machine internal date format into the custom date format (short version). The result will be displayed. CALL NLFMTCUSTDATE (DATE, BCUSTOMDATE, LANGNUM, LERROR) IF (IERROR(1) .NE.
136 137 138 139 140 141 142 C C C WRITE (6,*) "DATE AND TIME FORMAT:" WRITE (6, 1005) BDATE STOP END Executing the program gives the following result: :RUN PROGRAM ENTER A LANGUAGE NAME OR NUMBER (MAX. 16 CHARACTERS): NATIVE-3000 JANUARY TUESDAY CUSTOM DATE: 01/31/84 DATE FORMAT: TUE, JAN 31, 1984 TIME FORMAT: 5:15 PM DATE AND TIME FORMAT: TUE, JAN 31, 1984, 5:15 PM END OF PROGRAM :RUN PROGRAM ENTER A LANGUAGE NAME OR NUMBER (MAX. 16 CHARACTERS): 8 January Dienstag CUSTOM DATE: 31.01.84 DATE FORMAT: Di.
Format Date and Time from an SPL Program The user is asked to enter a language. All date and time formatting and conversion is done by using the language entered by the user. The time and date used in the examples is the current system time obtained by calling the HP 3000 system intrinsics CALENDAR and CLOCK.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 DEFINE WEEKDAY'NAME = B'WEEKDAYS((WEEKDAY - 1) * 12)#, MONTH'NAME = B'MONTHS((MONTH - 1) * 12)#, ERR'CHECK = IF L'ERROR(0) <> 0 THEN QUIT #, CCNE = IF <> THEN QUIT #, DISPLAY = MOVE B'PRINT := #, ON'STDLIST = ,2; @BP'PRINT := TOS; LGTH := LOGICAL(@BP'PRINT) LOGICAL(@B'PRINT); PRINT(L'PRINT, -LGTH, 0) #; INTRINSIC READ, QUIT, PRINT, CLOCK, CALENDAR, ALMANAC,
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 14 Example Programs NLINFO(22,L'LANGUAGE,LANGNUM,L'ERROR); IF L'ERROR(0) <> 0 THEN BEGIN IF L'ERROR(0) = 1 THEN BEGIN DISPLAY "NL/3000 IS NOT INSTALLED" ON'STDLIST; QUIT(1001); END ELSE IF L'ERROR(0) = 2 THEN BEGIN DISPLAY "THIS LANGUAGE IS NOT CONFIGURED" ON'STDLIST; QUIT(1002); END ELSE QUIT (1000 + L'ERROR(0)); END; <<
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 << Format the machine internal date format into the custom date format (short version). The result will be displayed.
184 185 186 187 188 189 190 NLFMTDATE(DATE,TIME,L'DATE,LANGNUM,L'ERROR); ERR'CHECK (10000 + L'ERROR(0)); DISPLAY "DATE AND TIME FORMAT:" ON'STDLIST; DISPLAY B'DATE,(28) ON'STDLIST; END. Executing the program results in the following: :RUN PROGRAM ENTER A LANGUAGE NAME OR NUMBER (MAX. 16 CHARACTERS): GERMAN January Dienstag CUSTOM DATE: 31.01.84 DATE FORMAT: Di., 31. Jan. 1984 TIME FORMAT: 17:12 DATE AND TIME FORMAT: Di., 31. Jan.
Scan and Move Character Strings from a COBOLII Program In this program, there are six di erent calls to NLSCANMOVE. In every call, all parameters are passed to NLSCANMOVE. Since the upshift/downshift table and the character attributes table are optional parameters, they may be omitted. For performance reasons (if NLSCANMOVE is called frequently), they should be passed to the intrinsic after being read in by the appropriate calls to NLINFO. 1 $CONTROL USLINIT 1.1 IDENTIFICATION DIVISION. 1.2 PROGRAM-ID.
5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9 9.1 9.2 9.3 9.4 9.5 9.6 9.7 18 Example Programs * The user is asked to enter a language name or DISPLAY "ENTER A LANGUAGE NAME OR NUMBER (MAX. 16 CHARACTERS):". ACCEPT LANGUAGE. CONVERT-NAME-NUM. * NLINFO item 22 returns the corresponding * lang number in integer format for this language. CALL INTRINSIC "NLINFO" USING 22, LANGUAGE, LANGNUM, ERRORS.
9.8 9.9 10 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 11 11.1 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 12 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 13 13.1 13.2 13.3 13.4 13.5 13.6 13.7 13.8 13.9 14 14.1 14.2 * Obtain the downshift table using NLINFO item 16. CALL INTRINSIC "NLINFO" USING 16 DOWNSHIFT-table, LANGNUM, ERRORS. IF ERR1 NOT EQUAL 0 COMPUTE QUITPARM = 4000 + ERR1 CALL INTRINSIC "QUIT" USING QUITPARM. DISPLAY "THE FOLLOWING STRING IS USED IN ALL EXAMPLES:" DISPLAY INSTRING.
14.3 14.4 14.5 14.6 14.7 14.8 14.9 15 15.1 15.2 15.3 15.4 15.5 15.6 15.7 15.8 15.9 16 16.1 16.2 16.3 16.4 16.5 16.6 16.7 16.8 16.9 17 17.1 17.2 17.3 17.4 17.5 17.6 17.7 17.8 17.9 18 18.1 18.2 18.3 18.4 18.5 18.6 18.7 18.8 18.9 19 20 Example Programs EXAMPLE-1-2. * * The string passed in the array instring should be moved * and upshifted to the array outstring (same as EXAMPLE 1-1). * Set the while flag (bit 11 = 0) and the * (bit 10 = 1).
19.1 19.2 19.3 19.4 19.5 19.6 19.7 19.8 19.9 20 20.1 20.2 20.3 20.4 20.5 20.6 20.7 20.8 20.9 21 21.1 21.2 21.3 21.4 21.5 21.6 21.7 21.8 21.9 22 22.1 22.2 22.3 22.4 22.5 22.6 22.7 22.8 22.9 23 23.1 23.2 23.3 23.4 23.5 23.6 23.7 23.8 23.9 * * * * * Note: The 'until flag' is set and the ending condition set to 'special character'. Therefore, the operation continues until the first special character is found or until the number of characters contained in length is processed. MOVE SPACES TO OUTSTRING.
24 24.1 24.2 24.3 24.4 24.5 24.6 24.7 24.8 24.9 25 25.1 25.2 25.3 25.4 25.5 25.6 25.7 25.8 25.9 26 26.1 26.2 26.3 26.4 26.5 26.6 26.7 26.8 26.9 27 27.1 27.2 27.3 27.4 27.5 27.6 27.7 27.8 27.9 28 28.1 28.2 28.3 28.4 28.5 28.6 28.7 28.8 28.9 29 22 Example Programs CALL INTRINSIC "NLSCANMOVE" USING INSTRING, OUTSTRING, FLAGS, LEN, LANGNUM, ERRORS, CHARSET-table, UPSHIFT-table GIVING NUMCHAR. IF ERR1 NOT EQUAL 0 COMPUTE QUITPARM = 8000 + ERR1 CALL INTRINSIC "QUIT" USING QUITPARM.
29.1 29.2 29.3 29.4 29.5 29.6 29.7 29.8 29.9 30 30.1 30.2 30.3 30.4 30.5 30.6 30.7 30.8 30.9 31 31.1 31.2 31.3 31.4 31.5 31.6 31.7 31.8 31.9 32 32.1 32.2 32.3 32.4 32.5 32.6 32.7 32.8 32.9 33 33.1 33.2 33.3 33.4 33.5 33.6 33.7 IF ERR1 NOT EQUAL TO 0 COMPUTE QUITPARM = 9000 + ERR1 CALL INTRINSIC "QUIT" USING QUITPARM. DISPLAY "SCAN/MOVE/DOWNSHIFT UNTIL NUM. OR SPEC.: DISPLAY OUTSTRING. * * * * * * * * * * * * * * * * * * * (EXAMPLE 3-1)". EXAMPLE-3-2.
33.8 33.9 34 34.1 34.2 DISPLAY "SCAN/MOVE/DOWNSHIFT WHILE ALPHA: DISPLAY OUTSTRING. (EXAMPLE 3-2)". STOP RUN. Executing the program results in the following: :RUN PROGRAM ENTER A LANGUAGE NAME OR NUMBER (MAX.
Scan and Move Character Strings from an SPL Program In this program, there are six di erent calls to NLSCANMOVE. In every call, parameters are passed to NLSCANMOVE. Since the upshift/downshift table and the character attributes table are optional parameters, they may be omitted. For performance reasons (if NLSCANMOVE is called frequently), they should be passed to the intrinsic after being read in by the appropriate calls to NLINFO.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 26 Example Programs ERROR'CHECK = IF L'ERROR(0) <> 0 THEN QUIT #, CCNE = IF <> THEN QUIT #, DISPLAY = MOVE B'PRINT := #, ON'STDLIST = ,2; @BP'PRINT := TOS; LGTH := LOGICAL(@BP'PRINT) LOGICAL(@B'PRINT); PRINT(L'PRINT, -LGTH, 0) #; INTRINSIC READ, QUIT, PRINT, NLINFO, NLSCANMOVE; << Start of main code. Initializing the arrays.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 BEGIN IF L'ERROR(0) = 1 THEN BEGIN DISPLAY "NL/3000 IS NOT INSTALLED" ON'STDLIST; QUIT (1001); END ELSE IF L'ERROR(0) = 2 THEN BEGIN DISPLAY "THIS LANGUAGE IS NOT CONFIGURED" ON'STDLIST; QUIT (1002); END ELSE QUIT (1000 + L'ERROR(0)); END; << Obtain the character attributes table using NLINFO item 12.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 28 Example Programs EXAMPLE'1'1: << The string passed in the array instring is moved and UPSHIFTED to the array outstring. Note: The 'until flag' is set. Therefore, the operation continues until one of the ending criteria is true.
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 EXAMPLE'2'1: << The string contained in instring should be scanned for the first occurrence of a special character. All characters before the first special are moved to outstring. Note: The 'until flag' is set and the ending condition is set to 'special character'.
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 30 Example Programs LOWER'CASE UPPER'CASE SPECIAL'CHAR NUMERIC'CHAR := := := := 1; 1; 0; 1; WHILE'UNTIL UPSHIFT'FLAG := 0; := 0; NUM'CHAR := NLSCANMOVE(B'INSTRING, B'OUTSTRING, FLAGS, LENGTH, LANGNUM, L'ERROR, L'CHARSET, L'UPSHIFT); ERROR'CHECK (8000 + L'ERROR(0)); DISPLAY "SCAN/MOVE WHILE ALPHA OR NUM: (EX
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 EXAMPLE'3'2: << Note: The 'while flag' is set and the ending criteria for uppercase and lowercase characters are set. Therefore, the operation continues while an uppercase or a lowercase character is found. When a special or numeric character is found or the number of characters contained in length is processed, the operation will terminate.
Executing the program results in the following: :RUN PROGRAM ENTER A LANGUAGE NAME OR NUMBER (MAX.
Translate and Relpace Characters from a COBOLII Program The string used in the example is 256 bytes in length and contains all possible byte values from 0 to 255. This string is converted from USASCII to EBCDIC. Then the converted string is taken and translated back to USASCII. This is done according to the ASCII-to-EBCDIC and EBCDIC-to-ASCII translation tables corresponding to the entered language. Afterwards this twice-translated string is displayed.
4.7 4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9 9.1 9.2 9.3 9.4 9.5 34 Example Programs 01 ERRORS. 05 ERR1 PIC S9(4) COMP. 05 ERR2 PIC S9(4) COMP. PROCEDURE DIVISION. START-PGM. * Initialize the instring array with all possible * byte values starting from binary zero until 255. MOVE -1 TO INT-FIELD. PERFORM FILL-INSTRING VARYING IND FROM 1 BY 1 UNTIL IND > 256. GO TO GET-LANGUAGE.
9.6 9.7 9.8 9.9 10 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 11 11.1 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 12 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 13 13.1 13.2 13.3 13.4 13.5 13.6 13.7 13.8 13.9 14 14.1 14.2 14.3 14.4 14.5 14.6 IF ERR1 NOT EQUAL 0 COMPUTE QUITNUM = 3000 + ERR1, CALL INTRINSIC "QUIT" USING QUITNUM. CONVERT-ASC-EBC. * Convert IN-STRING from USASCII into EBCDIC by * using NLTRANSLATE code 2. The converted string will * be in OUT-STRING.
14.7 14.8 14.9 36 Example Programs DISPLAY "IN-STRING:" DISPLAY IN-STRING. STOP RUN.
Compare Character Strings from a COBOLII Program The example shows a new KSAM/3000 le built programmatically with a language attribute. This means that the keys are sorted according to the collating sequence of this language. After building the le, the program writes 15 hard-coded data records into it. Perform a generic FFINDBYKEY with a partial key of length1 containing \E". This positions the KSAM/3000 le pointer to the rst record whose key starts with \E".
4.5 4.6 4.7 4.8 4.9 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9 9.1 9.2 9.3 9.4 38 Example Programs 01 01 01 01 01 05 05 STRINGS. GEN-KEY FILENAME PIC X(4). PIC X(8) VALUE SPACES. 05 05 ERRORS. ERR1 ERR2 PIC S9(4) COMP. PIC S9(4) COMP VALUE 0. 05 05 05 DATA-RECS. DATA-REC1 DATA-REC2 DATA-REC3 PIC X(50). PIC X(50). PIC X(50). DATA-RECS-R REDEFINES DATA-RECS. 05 DATA-RECORD OCCURS 15.
9.5 MOVE 1 TO NUM-OF-KEYS. 9.6 MOVE LANGNUM TO LANGUAGE-NUM. 9.7 MOVE %20 TO FLAGWORD. 9.8 MOVE 0 TO KEY-FILE-SIZ. 9.9 MOVE %10004 TO KEY-DESCR. 10 MOVE 4 TO KEY-LOCATION. 10.1 MOVE %100024 TO DUPL-BLOCK. 10.2 MOVE %4000 TO FOPTIONS. 10.3 MOVE 5 TO AOPTIONS. 10.4 10.5 CALL INTRINSIC "FOPEN" USING FILENAME, 10.6 FOPTIONS, 10.7 AOPTIONS, 10.8 -10, 10.9 \\, 11 KSAM-PARAM 11.1 GIVING FNUM. 11.2 IF CC NOT EQUAL 0 11.3 CALL INTRINSIC "PRINTFILEINFO" USING FNUM, 11.4 CALL INTRINSIC "QUIT" USING 1000. 11.5 11.
14.5 IF CC NOT EQUAL 0 14.6 CALL INTRINSIC "PRINTFILEINFO" USING FNUM, 14.7 CALL INTRINSIC "QUIT" USING 3000. 14.8 14.9 * Read the subsequent entries and check whether an 15 * exact match occurred by using NLKEYCOMPARE. 15.1 * When NLKEYCOMPARE returns 3 as a result, there are no 15.2 * more keys starting with any kind of "E". 15.3 * If an exact match was found the record is printed. 15.4 15.5 DISPLAY 15.6 "THE FOLLOWING RECORDS MATCH GEN-KEY (E) EXACTLY:" 15.7 MOVE 0 TO RESULT. 15.
Executing the program results in the following: :RUN PROGRAM THE FOLLOWING RECORDS MATCH GEN-KEY (E) EXACTLY: 011EZqrzyx 003EaBCXXX 007EdCDxyx END OF PROGRAM : Example Programs 41
Compare Character Strings from an SPL Program The example shows a new KSAM/3000 le built programmatically. This new KSAM/3000 le is built with a language attribute. This means the keys are sorted according to the collating sequence of this language. After building the le, it is lled with 15 hard-coded data records. Perform a generic FFINDBYKEY with a partial key of length1 containing \E". This should position the KSAM/3000 le pointer to the very rst record whose key starts with any kind of \E".
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 LOGICAL ARRAY L'DATA(0:74) := << |key | >> "014hBBeZZZ", "011EZqrzyx", "001ABCDXXX", "007EdCDxyx", "012IzzAzzz", "015iABDYZY", "005eLDFyxy", "002BBCdxxx", "003EaBCXXX", "008\\aaYZZ", "004eABCYYY", "006EabcYYY", "009Ayzz", "010eaxfxyz", "013FGHIzqs"; << << << << << << This is the data, to>> be written to the >> KSAM file.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 44 Example Programs ON'STDLIST = ,2; @BP'PRINT := TOS; LGTH := LOGICAL(@BP'PRINT) LOGICAL(@B'PRINT); PRINT(L'PRINT, -LGTH, 0) #; INTRINSIC FOPEN, FREAD, FWRITE, FCLOSE, FFINDBYKEY, FGETKEYINFO, PRINTFILEINFO, NLINFO, NLKEYCOMPARE, FCLOSE, PRINT, QUIT, READ; << Initializing the arrays.
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 NUM'OF'KEYS := 1; LANGUAGE := LANGNUM; FLAGWORD.
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 << << << << << Read the subsequent entries and check by >> using NLKEYCOMPARE whether an exact match was found.>> When NLKEYCOMPARE returns a 3 as a result, the >> program is beyond the range of valid keys. >> If an exact match was found, the record is printed.
Obtain Language Information from a COBOLII Program This program prints the user interface, data manipulation, system default, KSAM/3000 key sequence, VPLUS/3000 forms le, and IMAGE/3000 database language numbers. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 5 5.1 5.2 5.3 5.4 $CONTROL USLINIT IDENTIFICATION DIVISION. PROGRAM-ID. EXAMPLE.
5.5 5.6 5.7 5.8 5.9 6 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 7 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 8 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 8.9 9 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10 10.1 10.2 10.3 10.4 48 Example Programs 01 PASSWORD PIC X(8). 01 DBMODE PIC S9(4) COMP VALUE 5. 01 STAT. 05 DBSTAT 05 FILLER PIC S9(4) COMP VALUE 0. PIC X(18). 01 DUMMY PIC S9(4) COMP. * --------------------------------------------------PROCEDURE DIVISION. MAIN. PERFORM USER-LANG. PERFORM DATA-LANG. PERFORM SYST-LANG.
10.5 10.6 10.7 10.8 10.9 11 11.1 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 12 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 13 13.1 13.2 13.3 13.4 13.5 13.6 13.7 13.8 13.9 14 14.1 14.2 14.3 14.4 14.5 14.6 14.7 14.8 KSAM-OPEN. CALL INTRINSIC "FOPEN" USING FILENAME 1 GIVING FILENUM. IF CCODE = 0 THEN PERFORM KSAM-INFO ELSE DISPLAY "Error in KSAM file OPEN". KSAM-INFO. CALL INTRINSIC "FGETKEYINFO" USING FILENUM KSAMPARAM KSAMCONTROL. CALL INTRINSIC "FCLOSE" USING FILENUM 0 0.
14.9 BASE-OPEN. 15 DISPLAY "Enter PASSWORD:". 15.1 ACCEPT PASSWORD FREE. 15.2 CALL "DBOPEN" USING DBNAME PASSWORD DBMODE STAT. 15.3 IF DBSTAT = 0 15.4 THEN PERFORM BASE-INFO 15.5 ELSE DISPLAY "Error in Data Base Open:" DBSTAT. 15.6 15.7 BASE-INFO. 15.8 MOVE 901 TO DBMODE. 15.9 CALL "DBINFO" USING DBNAME DUMMY DBMODE STAT LANGUAGE. 16 MOVE 1 TO DBMODE. 16.1 CALL "DBCLOSE" USING DBNAME DUMMY DBMODE STAT. 16.2 MOVE "BASE lang:" TO OPER. 16.3 MOVE LANGUAGE TO LANG. 16.4 DISPLAY RESULT.
Index 7 8 A 7-Bit conversion, 3-4 7-Bit operation Peripherals, 3-4 7-Bit Substitution sets, D-2 7-Bit to 8-Bit conversion, D-1, D-4 Procedure, D-6 8-Bit character sets, 2-2 8-Bit operation Peripherals, 3-4 Accessing programs, 7-1 Algorithm Conversion, D-4 ALMANAC Intrinsic, 3-2 Application catalogs Localized, 3-5 Application message catalog CATCLOSE, 3-3 CATOPEN, 3-3 CATREAD, 3-3 NLAPPEND, 3-3 Application program Multilingual, 7-5, 7-7 Single language, 7-4 Application program guidelines, E-1 Application
C Index-2 Character handling NLCOLLATE, 3-2 NLFINDSTR, 3-2 NLJUDGE, 3-2 NLKEYCOMPARE, 3-2 NLREPCHAR, 3-2 NLSCANMOVE, 3-2 NLSTRANSLATE, 3-2 NLSUBSTR, 3-2 NLSWITCHBUF, 3-2 Characteristics Language-Dependent, 2-3 Character order Collating sequence, B-1 Character set ARABIC8, A-1, A-6 GREEK8, A-1, A-7 JAPAN15, A-1, A-11 KANA8, A-1, A-5 KOREA15, A-1, A-12 PRC15, A-1, A-9 ROC15, A-1, A-10 ROMAN8, A-1, A-4 TURKISH8, A-1, A-8 USASCII, A-1, A-3 Character sets supported, A-1 Character strings Order, B-1 Close messa
Conventional programming, 7-3 Conventions File naming, 7-1 Conversion 7-Bit to 8-Bit, 3-4, D-1, D-4 7-Bit to 8-Bit procedure, D-6 Editor le, D-3 HPWORD le, D-3 IMAGE database, D-3 Non-Text, D-3 Procedure, D-6 Special character, D-5 TDP le, D-3 Text le, D-3 VPLUS forms le, D-3 Conversion algorithm, D-4 Conversion utilities, 3-4, D-3 Convert ASCII source le GENCAT, 3-5, 3-6 Convert custom date format NLCONVCUSTDATE, 3-2 Convert from native to internal NLCONVNUM, 3-3 Convert phonetic to screen order NLSWITCHBU
E F G H I Index-4 EBCDIC Mapping, C-1 Mapping ROMAN8, C-2 EBCDIC to ASCII conversion, 2-3 Editor le conversion, D-3 FCOPY Intrinsic features, 4-1 NLS features, 1-2 File naming conventions, 7-1 Foreign characters, 2-2 Format date NLFMTCALENDAR, 3-2 Format date and time NLFMTDATE, 3-2 Format in custom date format NLFMTCUSTDATE, 3-2 Format in native form NLFMTNUM, 3-3 Format long version date NLFMTLONGCAL, 3-2 Format time NLFMTCLOCK, 3-2 FORTRAN Date/Time Formatting, F-8 SORT, F-7 Functions language, 7-2
NLTRANSLATE, C-1, F-33 Intrinsic features COBOL II/XL, 4-1 FCOPY, 4-1 IMAGE, 4-1 NLS, 4-1 QUERY, 4-1 SORT-MERGE, 4-1 VPLUS, 4-1 J K L JAPAN15 Character set, A-1, A-11 JCW NLDATALANG, 5-2, 6-1, 6-2 NLUSERLANG, 5-2, 6-1, 6-2 KANA8 Character set, A-1, A-5 Keywords NLS speci c, 5-2 KOREA15 Character set, A-1, A-12 KSAM NLS features, 1-2 LANGINST Utility, 3-1 Language Multilingual, 7-5, 7-7 Single application, 7-4 Language choice in subsystems, 6-1 Language data Support features, 3-3 Language-Dependent charac
M N Index-6 Mapping EBCDIC, C-1 ROMAN8 to EBCDIC, C-2 Message catalogs Naming conventions, 7-1 Move and scan character strings NLSCANMOVE, 3-2 Multilingual language application, 7-5 N7MF8CNV utility, D-9 Naming conventions Files, 7-1 Native Language con guration, 3-1 Native language values, 5-1 NLCOLLATE Intrinsic, 3-2 NLCONVCLOCK Intrinsic, 3-2 NLCONVCUSTDATE Intrinsic, 3-2 NLDATALANG JCW, 5-2, 6-1, 6-2 NLFINDSTR Intrinsic, 3-2 NLFMTCALENDAR Intrinsic, 3-2 NLFMTCLOCK Intrinsic, 3-2 NLFMTCUSTDATE Intrins
NLS commands, 5-2 NLS features COBOL II/XL, 1-2 FCOPY, 1-2 IMAGE, 1-2 KSAM, 1-2 QUERY, 1-2 SORT-MERGE, 1-2 VPLUS, 1-2 NLS Features Accessing, 5-1 NLS intrinsic features, 4-1 NLS keywords, 5-2 NLSUBSTR Intrinsic, 3-2 NLSWITCHBUF Intrinsic, 3-2 NLTRANSLATE COBOLII, F-33 Intrinsic, 3-2, C-1 NLUSERLANG JCW, 5-2, 6-1, 6-2 NLUTIL Utility, 3-1 Non-Text conversion, D-3 Number formatting NLCONVNUM, 3-3 NLFMTNUM, 3-3 NLNUMSPEC, 3-3 Numeric data returned ALMANAC, 3-2 O P Obtaining Language Information COBOL II/XL, F
Q R S Index-8 QUERY Intrinsic features, 4-1 NLS features, 1-2 Read message catalog CATREAD, 3-3 Replace nondisplayable characters NLREPCHAR, 3-2 Return a string NLSUBSTR, 3-2 Return conversion information NLNUMSPEC, 3-3 Return format information NLNUMSPEC, 3-3 ROC15 Character set, A-1, A-10 ROMAN8 Character set, A-1, A-4 Search for a string NLFINDSTR, 3-2 Sequence Collating priority, B-2 Sets 7-Bit substitution, D-2 Single language application, 7-4 SORT COBOL II/XL, F-2 FORTRAN, F-7 Pascal, F-4 SORT-MER
T U V TDP le conversion, D-3 Text le conversion, D-3 Time formatting NLCONVCLOCK, 3-2 NLCONVCUSTDATE, 3-2 NLFMTCALENDAR, 3-2 NLFMTCLOCK, 3-2 NLFMTCUSTDATE, 3-2 NLFMTDATE, 3-2 NLFMTLONGCAL, 3-2 Translate string from EBCDIC NLTRANSLATE, 3-2 Translate string to EBCDIC NLTRANSLATE, 3-2 Translation Applications, 3-5 TURKISH8 Character set, A-1, A-8 UDCs Establish native language, 6-2 USASCII Character replacement, D-2 Character set, A-1, A-3 User-De ned commands (UDCs) Establish native language, 6-2 User inte