Background of the Invention
The present invention generally relates to a method for converting data field lengths in computer program files. More particularly, the present invention relates to a computer-implemented method for converting data field lengths in computer program files and/or databases for compliance with the next century.
Presently, many businesses rely upon computer programs that generate and utilize date-specific data. Such computer programs include, for example, programs for maintaining a database of insurance claims and dates on which such claims were made, and software used for tracking telephone calls in computing billing records. Because most of these computer programs have only used data fields having two characters reserved for the year (i.e., Dec. 31, 1995), these computer programs assume that the year occurs in the twentieth century and thus, will not be able to distinguish between dates occurring in this century and those occurring in the next century. For example, if the computer program generates or accesses an invoice due date of "Jan. 1, 2000," the program will assume a due date of Jan. 1, 1900, even though Jan. 1, 2000, was intended, and will incorrectly designate the account as overdue and compute interest due on the account starting from the Jan. 1, 1900, date. Thus, it may be crucial for businesses to modify their existing computer programs for compliance with the next century.
Although these computer programs could be modified manually by going through each line of code of the programs and each segment of data in a database to make the necessary changes for compliance with the next century, such manual revision is tedious, very time consuming, and costly and is subject to human error. Given the number of computer programs presently used by businesses and the number of lines of code in such programs, there exists a need for an automated process for making necessary modifications in a computer program for compliance with the next century.
The assignee of the present invention has developed a set of computer-implemented tools for automatically converting the field length of data relating to dates. These tools are used to convert all of one's non-compliant program files and data files into files that are century compliant. However, it may not always be desirable to convert all of one's non-compliant program files and/or data files. For example, one may wish to use a new, upgraded, or converted century compliant program to operate on non-compliant data without having to permanently convert the data. Conversely, one may not want to permanently convert a non-compliant program to work with compliant data. Therefore, there exists a need for a bridging tool set that may be called from within a compliant or non-compliant client program in order to allow non-compliant program codes or data fields to be used with compliant program codes or data fields without requiring the non-compliant components to be permanently converted.
Summary of the Invention
Accordingly, the present invention has been made to overcome the above problems. One aspect of the present invention is to provide a method for automatically converting the data field lengths in a non-compliant component of a computer program corresponding to the year from two characters to four characters and to insert or delete "19", "20", "00", or "99" into/from dates read from existing databases where appropriate for use with compliant components. Another aspect of the present invention is to provide a computer-implemented process that may be called from within a compliant program to temporarily convert non-compliant data for use by the calling compliant program. Yet another aspect of the present invention is to provide a computer-implemented method that may be called from within a non-compliant program to temporarily convert data from a compliant data file into non-compliant so that it may be read and manipulated by the non-compliant program.
A further aspect of the present invention is to provide a system for automatically converting data representing a specified item of data, such as a date, telephone number, zip code, social security number, etc., that may be found in program or data files.
To achieve these and additional aspects and advantages, the method of the present invention automatically converts field lengths of data fields in a data file that are accessed by a computer program and correspond to a date. The method comprises the steps of providing a control program including parameters and commands for converting the field length of a data field corresponding to date-related data, inserting codes in the computer program file including a subroutine calling command such that the control program will be called and executed as a subroutine from within the computer program file, executing the computer program file, and executing the control program when the computer program executes the subroutine calling command. When executed, the control program automatically converts the field length of a date-related data field identified by the computer program in order to allow either inclusion or exclusion of the century in a portion of the data field indicating the year prior to manipulation of the date-related by the computer program. The control program may be executed on-line or in batch when the computer program executes the subroutine calling command. The step of providing the control program includes inserting file conversion parameters into a model control program to generate a control program file, and compiling the control program file to generate the control program.
If the computer program is century compliant and must interact with non-compliant data files, a temporary data record is created, the identified date-related data is copied from the non-compliant data file into temporary data record, the control program increases the field length of the date-related data field in the temporary data record and then automatically inserts century data into the expanded date-related data field prior to manipulation thereof by the computer program. On the other hand, if the computer program is not century compliant and must interact with compliant data files, the identified date-related data is copied into a temporary data record and the control program automatically deletes the existing century data from the identified date-related data field in the temporary data record. The temporary data record is not written back into the pre-existing data file unless the computer program has altered the date-related data or created new date-related data that must be written into the pre-existing data file. When data that is changed or created by the computer program is to be written back into the pre-existing data file, the control program converts the data into either compliant or non-compliant data by adding or deleting the century depending upon whether the pre-existing data file is compliant or non-compliant.
The features and advantages of the invention may be realized and obtained by means of the instrumentalities and combinations particularly pointed out in the written description and claims hereof, as well as the appended drawings.
Brief Description of the Drawings
The accompanying drawings, which are incorporated in, and constitute a part of, this specification, illustrate several embodiments of the invention and together with the description, serve to explain the objects, advantages, and principles of the invention. In the drawings:
FIG. 1 is a block diagram illustrating the construction of a conventional personal computer in which the present invention may be utilized;
FIG. 2 is a flow diagram illustrating an overview of the sequence of operations performed in accordance with the methodology of a first embodiment of the present invention; and
FIG. 3 is a flow diagram illustrating an overview of the sequence of operations performed in accordance with the methodology of a first embodiment of the present invention.
Detailed Description of Preferred Embodiments
As mentioned above, the present invention relates to computer software embodying a method for automatically converting existing computer program files and any associated data files for compliance with the next century. The computer software of the present invention may be utilized in a conventional mid-size computer or a main-frame computer. A general overview of the construction of a conventional computer 10 is illustrated in FIG. 1. PC 10 includes a central processing unit (CPU) 15 connected to a bus 17 to control the overall operation of computer 10. Computer 10 further includes a read only memory (ROM) 20, a random access memory (RAM) 22, a hard drive 24, a video driver 26 connected to a display monitor 28, and a first I/O interface 30 connected to a keyboard 32. Also, computer 10 may optionally include a second I/O interface 36 and/or a modem 42. Preferably, RAM 22 is 8 MB or more and CPU 15 includes a processor having a speed greater than an Intel 386 processor.
The computer program files in which the present invention will convert its data field lengths and code for compliance with the next century, may take several forms and/or include date-specific data in many different formats and locations. Such computer programs may include various combinations of copybooks; job control language (JCL) Job Libraries; libraries of procedures invoked by JCL (PROC Libraries); Source Libraries, which may be written in COBOL, TELON, Assembler, PL/I, or other languages; Copylib Libraries; and COBOL Source Panvalet or partitioned data set (PDS) files. As will be explained in more detail below, the COBOL Source Panvalet or PDS files may include Panexec Load Libraries, Panvalet Source Libraries and PDS Load Libraries, Panvalet Backup Source, Panvalet Test/Prod Source, COBOL PDS Source, and COBOL Panvalet Source. The "Panvalet" and "Panexec" files are those created and associated with the PANVALET and PANEXEC products marketed by Pansothic Corporation. Other product files similar to the PANVALET and PANEXEC files are ENDEAVOR- or LIBRARLAN-type libraries. The computer programs to be converted may also include customer information communication services (CICS), which is an on-line product by IBM that supports multiple terminal interaction. The programs that run in this environment can be TELON, Assembler, PL/I, or COBOL. The CICS environment needs to know the names of the programs that are allowed to run in CICS, the names of the transaction codes, and what programs to execute when the transaction is typed in and what files are allowed to be updated. This information for CICS is stored in system tables including program process tables (PPT), program control tables (PCT), and file control tables (FCT).
The system of the present invention includes a computer hardware used to implement specific functions. As noted above, these functions may be executed on a main-frame computer or mid-size computer. As discussed in more detail below, the system preferably includes means for generating a control program including parameters and commands for converting the data field length of date-related data in a data file, and means for executing the control program when a computer program executes a subroutine calling command that has been inserted within the computer program file. The control program including means for automatically converting the data field length of date-related data identified by the computer program in order to allow either inclusion or exclusion of the century in a portion of the data field indicating the year prior to manipulation of the date-related data by the computer program. In accordance with a first embodiment, which is described below with respect to FIG. 2, the control program is executed in batch when the computer program executes the subroutine calling command. In accordance with a second embodiment, which is described below with respect to FIG. 3, the control program is executed on-line when the computer program executes the subroutine calling command.
FIG. 2 illustrates an overview of the flow of operations performed in accordance with a first embodiment of the inventive methodology. The first embodiment pertains to the implementation of the present invention with respect to a batch customer program 100. Customer program 100 may be a century-complaint program that interacts with a non-compliant data file, or program 100 may be a non-compliant program that interacts with a compliant data file. To enable the compliant and non-compliant programs and data files to interact, the present invention provides a bridging routine that will present the data read from a non-compliant data file to a compliant program 100 as being compliant data (i.e., including the century in the date) or presents the data read from a compliant data file to a non-compliant program 100 as being non-compliant data.
As described in more detail below, the bridging routines of the present invention are implemented by inserting codes into customer program 100 including a subroutine calling command 160 that calls a control program 150 as a subroutine during the execution of customer program 100. Either control program 150 or the code inserted in customer program 100 copies the date-related data that is requested by customer program 100 from the data file into a temporary data record. The control program 150 then converts the field length of the data fields including any requested date-related data to allow for the inclusion or exclusion of the century from the portion of the date-related data indicating the year. The converted date-related data is then presented to customer program 100 for further manipulation.
Control program 150 is a program that is customized to operate with the particular customer program 100 with which it must interact. Control program 150 is generated by the YEAR3999 control program generator 110, which fits file conversion parameters 115 into the YEAR3000 model program 120 to produce a control program file 130. Control program file 130 is then compiled by a COBOL compiling procedure 140 to produce control program 150.
The customization of control program 150 is enabled by the selection of particular file conversion parameters 115 that will enable control program 150 to either expand date-related data fields in a non-compliant data file for use with a compliant program or to enable control program 150 to decrease the field lengths of date-related data fields read from a compliant data file by a non-compliant program. YEAR3000 model program 120 is provided to allow a programmer creating control program 150 to more easily construct control program 150 in a format that will cooperate with the recommended calling codes that are inserted into customer program 100. In particular, the calling codes inserted into the customer program 100 pass, in linkage, the following items to the bridge between the customer program 100 and the control program 150: the input record; the record size; the record format; the name of the customer's record program that contains the conversion parameters; the code for inserting or swapping back; the return code; and the returned record. If the application program 100 uses tables, the customer would also pass the name of the table that corresponds to the table's specific conversion parameters. Upon return to the customer's program 100, the expanded or swapped-back record is now available to the customer program 100. These calling codes are preferably inserted into both the Working Storage and Procedure Division of customer program 100. Assuming the naming conventions are the same, the Procedure Division logic should be duplicated after each application input/output. In the examples that follow, any names in lowercase need to be named specifically for the customer application. The following code is preferably inserted in the Working Storage of customer program 100 to enable operation of the table bridge utility.
Further, the following logic should preferably be inserted into a program after the the I/O step.
The above examples when in customer program 100 provide the required information outlined above to bridge 160 for use by control program 150. The manner by which control program 150 uses this information to perform the desired conversion is described below following a general overview of the second embodiment of the present invention.
FIG. 3 shows the general operation of the inventive method according to the second embodiment. This embodiment is similar to the first embodiment except that customer program 200 is executed on-line in cooperation with a slightly different control program 250 through bridge 260. Control program 250 is created by inserting file conversion parameters 115 into YEAR3011 model program 220 by YEAR3999 control program generator 110. The resulting control program file 230 is compiled in the same manner by COBOL compiled procedure 140 as in the first embodiment to produce control program 250. The recommended logic code that should be inserted into the working storage of the customer program 200 (which is typically a CICS program) is as follows:
The "BIG-IN" area should preferably be built according to the user's movement of records. It should reflect the size of the record being moved. Redefining BIG-IN-RECORD to smaller size definitions reduces the compiler generation of spacing when moving records to BIG-IN-RECORD. BIG-IN-RECORD and BIG-OUT-RECORD are defined as 10k in the YEAR2030 program.
The following logic is preferably inserted into the Procedure Division of the customer program 200 after the CICS I/O function:
The manner in which the above codes inserted into customer programs 100 or 200 interacts with control program 150 or 250 will now be described. In general, the control program includes certain scripting language including Select (SL) and Swap (SW) Statements, which provide the ability to select records to insert data or to swap data out of records, and Action Commands that define what changes to make to the selected data. SELECT and SWAP have specific. definitions for the scripting language. SELECT, represented by SL Statements, identify records to add century or other data. SWAP, represented by SW Statements, identify records to remove (swap out) century or other data. These statements identify records and assign them to specific Action Groups. Later, Action Commands define the conversion activity to take on these Action Groups.
In the bridging tool of the present invention, SL/SW Statements use two different techniques to identify data. The first technique is a positional select/swap which is the most common SL/SW identification technique. Examples (1), (2), and (3) show positional Select and Swap Statements. They select data based on the values of specific positions in the record. The second technique is a table select/swap which works for on-line and batch bridges. Examples (4) and (5) below show Select and Swap Statements that use the table technique. This statement provides the table or IMS segment name to a bridging control program (150 or 250).
The format of the coding for the exemplary SL/SW Statements are as follows:
The Action Group is provided in the SL/SW Statements to assign the records to these Action Groups. Action Group Codes tie Select Statements to Action Commands. The Action Commands define the changes to make to the record.
The positional statements in positions 8-80 may be coded in three different ways. For a positional Select/Swap (examples 1, 2, and 3), positions 9-14 include a "P" followed by the five position location to begin checking in the data. For example, to begin checking for a value in position 10 of the data record, "P00010" is entered. In positions 15-18 for a positional SL/SW Statement, the values to look for in the position are listed. Such a positional statement (P0001, etc.) followed by the values to check may be repeated up to the length of the 80-byte record. The literal description of the positional statement in examples (1), (2), and (3) are:
(1) Select data and assign it to Action Group 001 when position 1 has a value of 1 or 2 or 3 and position 35 has a value of 2.
(2) Swap data and assign it to Action Group 001 when position 1 has a value of 1 or 2 or 3 and position 37 has a value of 2.
(3) Select data and assign it to Action Group 002 when position 1 has a value of 4 or 5 and position 75 is the starting position for the value NEW YORK.
The positional parameter (P00001, etc.) indicates the beginning position of the search. The selection statement following the positional parameter can be any length up to the end of the 80-position record. For example, in example (3), the positional parameter indicates to search for "NEW YORK" beginning in position 75. This eliminates the need to code each position individually. It is not necessary to check for "N" in 75, "E" in 76, "W" in 77, etc. The start and end of each selection statement preferably begins with a single tick ('), for example, a `12+REC`. The (+) indicates an OR condition. Because the plus sign and the tick have special meaning to this particular scripting language, the selection criteria, itself, should not contain' or +. For a table select/swap (examples (4) and (5)): positions 9-16 of the positional statement are filled with a "T=" followed by the table name and positions 17-80 are left blank. The "T=" identifies this Select or Swap Statement as a Table Command which is followed by the table name. The literal description of the table statements in examples (4) and (5) are:
(4) Select data and assign it to Action Group 003 when the data is associated with a table or IMS segment named TABLENAME.
(5) Select data and assign it to Action Group 003 for swap back when the data is associated with a table or IMS segment named TABLENAME.
Preferably, data is assigned uniquely to Action Groups. A record cannot be assigned to more than one Action Group. It will be assigned to the first SL/SW Statement that identifies the record. However, different SL/SW Statements can assign different records to the same Action Group. When coding positional SL Statements, the positions typically match non-compliant copybooks, whereas when coding SW Statements, the positions typically match compliant copybooks.
As noted above, Action Commands define what changes to make to select data. There are ten different Action Commands. They are:
A) INSERT/DELETE
B) DELETE/INSERT
C) INSERT/DELETE A SINGLE CHARACTER
D) INSERT/DELETE INTO A FIXED RANGE
E) REPLACE CHARACTER STRINGS
F) INSERT/DELETE CENTURY IN PACKED FIELD
G) INSERT/DELETE CENTURY IN BINARY FIELDS
H) INSERT/DELETE CENTURY IN AN OCCURS
I) INSERT/DELETE CENTURY IN AN OCCURS DEPENDING ON
J) USER EXIT FUNCTIONS
Internally, control program (150 or 250) strips off the whole record that is to be accessed by customer program (100 or 200). Then, it builds up (or down) based on the Action Commands. By taking this approach, the scripting language always uses the original location of the data. This simplifies the coding of the Action Commands. For example, after taking one action on a record, it is not necessary to "reposition" the description of the record for subsequent action. Consider a record with a date in position 20 and 30. The first action inserts century in position 20. Everything after the insertion shifts two positions to the right. However, the second action still points to the original position 30, not the "relocated" position 32. Because the control program strips the whole record, it is not necessary to adjust for each Insert/Delete action.
Most Action Commands can both add and delete data. If executed as part of a Select Statement (to add data), it adds data. If executed as part of a Swap Statement (to remove data), it removes that added data. This simplifies the use of this scripting language for bridging. It allows a single set of Action Commands to be stored with their corresponding Select or Swap Statements. A parameter in the JCL indicates whether the control program (150 or 250) should perform the actions based on Select or Swap Statements. Further, it is easy to switch files between their converted and unconverted state with one set of Action Commands. Those Action Commands have a mirror-opposite impact depending on whether they are executed as part of a Select or Swap Statement.
The Insert/Delete Action Command is used to insert and delete data, such as century. For fields that are not dates, the inserted/deleted data can be binary, hex, character, etc. For fields that are dates, the dates should be character (zoned decimal) data. For packed and binary format date fields, the appropriate packed or binary Action Command should be used. For non-date fields, this command inserts/deletes character, packed, and binary data.
The Insert/Delete Action Command inserts data when it matches a SL (select) record. This command deletes data when it matches a swap (SW) record. Note that the same Action Command has a completely different impact on a record, depending on whether it is executed on a Select or a Swap Statement.
The preferred format for an Insert/Delete Action Command is:
There are two commands that may be used in combination with these Action Commands and affect the data that is inserted in positions 21-80. These commands include the Window Command and the Format Command. The Window Command provides the ability to use a logical approach to set the century in data. To use the Window Command, a target year is selected. The control program will then insert "19" when the value of the year field is greater than or equal to the target year and "20" when the year is less than the target year. The Window Command also interrogates the content of the date field and determines if default values apply. If the date field has defaults such as zeros, nines, or blanks, the Window Command inserts zeros, nines, or blanks as appropriate.
The Format Command indicates which date formats apply and whether the data is character (zoned decimal), packed or binary. With packed or binary, the location of the year and century within the date may not be apparent. The Format Command indicates where the year and century are in the date field. The Window and Format Commands are preferably used together. For example, when the date is 010615 that could be Jan. 6, 2015, or Jun. 15, 2001, depending on the date format. Supplying the format allows the Window Command to identify and interrogate the appropriate fields to determine the appropriate value or defaults.
When using the Window and Format Commands in connection with an Insert/Delete Action Command, the following format for columns 21-80 of that Action Command is as follows:
The following shows four examples of this command and the literal description of each command.
(1) When used with SL, for records identified by Action Group 001, the first item to perform is to go out to position 125 and insert the two position character 19. When used with SW, for records identified by Action Group 001, the first item to perform is to go out to position 125 and delete the two position character 19.
(2) When used with SL, for records identified by Action Group 002, the first item to perform is to go out to position 25 and recognize that this is the start of a character date field that currently occupies 6 positions in YYMMDD format. The tool identifies where century should go based on the format. It inserts the two position character 19, except inserts 20 when the year is less than (LT) 45. Additionally, this command inserts zeros, nines or blanks if that is the default value in the date field.
When used with SW, for records identified by Action Group 002, the first item to perform is to go out to position 25 and recognize that is the start of a date field containing character date (zoned decimal, not packed ordinary) occupying 8 positions in CCYYMMDD format. The tool identifies where century is based on the format. It deletes the two position century.
(3) Example 3 has a slight but important difference from example 2. In example 3, the definition is MMDDYY instead of YYMD. The position (in this case 35) still refers to the start of the date field. The tools looks at the format code to determine the location of the year, and where to put century. In example 2, the year and the start of the date field were the same. In example 3, the year and the start of the date field are in different locations. Always refer to the start of the date field. This is not necessarily the location of the year within the date field.
(4) When used with SL, for records identified by Action Group 002, the second item to perform is to go out to position 55 and insert the four position character FRED. The Converter interprets any prior repositioning (such as from sequence 01) so you do not have to change the position of the fields.
When used with SW, for records identified by Action Group 002, the second item to perform is to go out to position 55 and delete the four position character FRED. The Converter interprets any prior repositioning (sequence 01) so you do not have to change the position of the fields.
(5) For SL, for records identified by Action Group 003, the first item to perform is to go out to position 01 and insert the sixty characters displayed. Spaces will be inserted if less than 60 characters are provided. For SW, for records identified by Action Group 003, the first item to perform is to go out to position 01 and delete sixty characters.
The second Action Command is the Delete/Insert Action Command which is used to delete data when used with a Select Statement and to add data when used with a Swap Statement. Sometimes, it is necessary or desirable to convert data without expanding the length of the record. After inserting century, this Delete/Insert Action Command can remove filler from the end of the record to maintain the record length. When executed as part of a Swap Statement, this command inserts the filler data back into the record to maintain the record length. The following is a preferred layout for the Delete/Insert Action Command for use in connection with the inventive program.
Here is an example of this command. We have a 50 byte record with one date located in position 23. There is filler in positions 46-50 represented by the values 12345. The value 1 in the first position identifies the data. We need to write the script to:
Identify this record and assign it to action group 001
Insert 19 in position 23
Delete two positions of filler from the end of the record so it stays 50 bytes.
Ensure the script can swap century out of position 23 for bridging non-compliant programs.
Ensure the converter leaves spaces and not low values on the end of the swapped-back record.
This shows the data and the script to accomplish this. The script looks like this:
The literal description of this script is:
(1) This LV Command tells the converter to leave spaces (not low values) at the end of a record on a swap back.
(2) Identify records for Select Action Group 001 where position one has a value of 1.
(3) Identify records for Swap Action Group 001 where position one has a value of 1.
(4) On a Select, for words identified as Action Group 001, the first thing to do is go out to position 23 and insert the two position value `19`. On a Swap, go out to position 23 and delete the `19`.
(5) On a Select, for records identified as Action Group 001, the second thing to do is go out to position 49 and delete two positions. On a Swap, go out to position 49 and add two positions.
The original, non-compliant data looks like this:
Compare positions 49 and 50 in the original, converted and swapped-back data:
In the original data, it is 12345 to represent five characters of fill.
In the converted data it is 123 to show the impact of the Delete command to keep the 50 position record length unchanged.
In the swapped back data it is 123 . . . to show how this command inserted two spaces when executed as part of a swap. Note that it inserts spaces--it can not restore the original filler data of 45. Also note that it may have left low values instead of spaces if the LV Command was not used.
The third Action Command is the Add/Delete a Character Action Command, which adds (or deletes) a single character to a record. When executed through a Select Statement, this Action Command adds characters. With a Swap Statement, this Action Command deletes characters. The Add/Delete Action Command may add or delete a single character once or up to 999 times. For example, this Action Command can add a single space or up to 999 spaces to a record. All added characters are preferably the same. For example, this Action Command can add (1) or (11) to a record, but in typical use does not add "19" to a record. The preferred format for the Add/Delete a character Action Command is as follows:
Here are several examples of the Add a Character Command and their literal description:
(1) For records identified by Action Group 001, the first item to perform is to go out to position 10 and add 1 in this position.
(2) For records identified by Action Group 001, the second item to perform is to go out to position 11 and add 9 in this position.
(3) For records identified by Action Group 002, the first item to perform is to go out to position 50 and add 222 spaces. Note the "C=" to identify the replacement characters is missing. This is leaves blanks.
(4) For records identified by Action Group 003, the first item to perform is to go out to position 50 and insert the character X 10 times.
The fourth Action Command is the Insert/Delete into a Fixed Range Action Command which is similar to using the combination of the Insert (with zone) and Delete Action Commands. The Insert/Delete into a Fixed Range Action Command will insert century into a range when it is not desirable to expand that range. For example, when a NAME field was reused to hold dates but it was not desirable to expand the NAME from 30 to 32 positions. This command inserts or deletes characters into a range by shifting and dropping data within the range. Data falling outside the range is not displaced. For example, this command inserts/deletes century in positions 10 and 11 without affecting the position of data in positions 90 and 91. Because data at the end of the range is dropped to accommodate the new characters, this particular Action Command should only be used when the characters at the end of the range are filler. The format for this Insert/Delete into a Fixed Range Action Command is as follows:
Positions 49 and subsequent are optional. They apply only when there are multiple actions in the range. They do not apply when there is only one action in the range. This option accommodates up to four separate actions in a range. The inserts may use different date formats. Note that the FORMATS (entered in 48, 54, 60 and 66) are one position numeric format codes.
The fifth Action Command is the Replace Action Command, which is used to replace a 1-10 character string with a 1-20 character string when used with a Select Statement. With a Swap Statement, this Action Command replaces a 1-20 character string with a 1-10 character string. This limitation as to the number of characters is for but one sequence. With multiple sequences, the number of characters is virtually unlimited. Thus, multiple sequences using this command allow replacing as many characters as needed. The Replace Action Command (REPL) changes/expands all records with an individual "item" to another "item." When there is a large series of changes, it may be more efficient to use the Exit Action Command described below. As an example of its use when executed as part of a Select Statement, the Replace Action Command replaces the data in positions 43-52 of the command line by the data in positions 55-74. When executed as part of a Swap Statement, the Replace Action Command replaces the data in positions 55-74 with the data in positions 43-52. The preferred format for the Replace Action Command is as follows:
Here are several examples of the Replace Command and their literal description:
(1) On SL transactions, for records identified by Action Group 001, the first thing to do is go out to position 5 and replace the data "C" with "19". On SW transactions, for records identified by Action Group 001; the first thing to do is go out to position 5 and replace the data "19" with "C".
(2) On SL transactions, for records identified by Action Group 001, the second thing to do is go out to position 10 and replace the data "OLD" with "NEW". On SW transactions, for records identified by Action Group 001, the second thing to do is go out to position 10 and replace the data "NEW" with "OLD".
(3) On SL transactions, for records identified by Action Group 002, the first thing to do is go out to position 10 and replace the data "ABCDEFGHIJ" with "12345". On SW transactions, for records identified by Action Group 002, the first thing to do is go out to position 10 and replace the data "12345" with "ABCDEFGHIJ".
Using Example (3), this reviews the impact of the Replace Command on data. Assume that the data is fifty position fixed format and looks like this:
When executed as part of an SL, the Replace Command goes out to position 10 and replaces "ABCDEFGHIJ" with "12345". After executing this command, the data looks like this:
Note that ABCDEFGHIJ is now 12345. Also note that the record length is now 45 and not 50.
When this same command is executed as part of a SW transaction, the reverse happens. The Replace Command goes out to position 10 and replaces "12345" with "ABCDEFGHIJ" . This returns the data to it's original configuration and data length:
This command replaces character data only. It does not replace hex, packed, etc. However, it can replace character data in records that have non-character data imbedded in it.
Be sure to consider the impact of the REPL Command on the key data for the SL and SW Statements. The following is an example of this situation. The SL statement identifies data by a "C" in position 6. The REPL Command replaces the C with 19. Therefore, the corresponding SW for this data must refer to "19" and not "C" in the key.
In this example, the Action Group 001 for SL looks for "C" in position 6. On a swap (SW) it looks for "19". This is because the REPL Command changed the data used to identify the Action Groups.
The sixth Action Command is the Add/Delete Century to a Packed Field Action Command. This Action Command is used to insert or swap century from a packed (COMP-3) field. This Action Command is preferably formatted to carry the necessary instructions to the control program. In particular, this Action Command includes the length of the COMP-3 field, the format of the date, and a PACKED indicator. The control program adds/deletes the packed century to the appropriate place in the date field and adjusts the field size. The preferred format for the Add/Delete Century to a Packed Field Action Command is as follows:
Here are several examples of the Add Century to a Packed Field Command and their literal description:
(1) We have a packed date field in YYMMDD format. For records identified by Action Group 001, the first item to perform is to go out to position 10 (the start of the date field) and add a two character 19 (add 20 if the year is less than 45). This date field occupies 4 positions packed and is in YYMMDD format.
(2) We have a packed date field in MMDDYY format. For records identified by Action Group 002, the first item to perform is to go out to position 10 (the start of the date field) and add a two character 19 (add 20 if the year is less than 45). This date field occupies 4 positions packed and is in MMDDYY format.
Note the different format in these two examples. Although the date fields start in the same location, the YEAR is located in different relative positions. By providing the format, the File Converter recognizes where to insert the century field. It is not necessary to provide the relative position of the YEAR, just the position of the date and the format. In example (1), the converted date field will be CCYYMMDD. In example (2), the converted date field will be MMDDCCYY
(3) We have a packed year-only field (YY format). For records identified by Action Group 002, the second item to perform is to go out to position 25 (the start of the date field, and also in this case the start of the year) and add a two character 19 (add 20 if the year is less than 45). This date field occupies 2 positions packed and is in YY format. The field increases to a three position packed CCYY.
(4) We have a packed Julian date field (YYDDD format). For records identified by Action Group 003, the first item to perform is to go out to position 10 (the start of the date field) and add a two character 19 (add 20 if the year is less than 45). This date field occupies 3 positions packed and is in YYDDD format. The field increases to a four position packed CCYYDDD.
On a swap (SW), these same Action Cornmands have the opposite effect. On a SW, it will swap out these centuries inserted with the SL.
The seventh Action Command is the Add/Delete Century to Binary and Computational Fields Action Command, which is used to add and delete century to a binary or computational date field. This Action Command carries the necessary instructions to the control program including the length of the binary field, the format of the date, and a BINARY indicator. The control program then adds or deletes the binary century in the appropriate place in the date field while also expanding the binary field length when necessary. The preferred format for this Action Command is as follows:
Here are several examples of the Add/Delete Century to a Binary Field Command and their literal description:
(1) We have a binary date field in YYMMDD format. For records identified by Action group 001 the first item to perform is to go out to position 10 (the start of the date field) and add a two character 19 (add 20 if the year is less than 45). This date field occupies 4 positions, is in binary YYMMDD format.
(2) We have a binary date field in MMDDYY format. For records identified by Action Group 002, the first item to perform is to go out to position 10 (the start ofthe date field) and add a two character 19 (add 20 if the year is less than 45). This date field occupies 4 positions, is in binary MMDDYY format.
(3) We have a binary field in YYMM format. For records identified by Action Group 002, the second item to perform is to go out to position 25 (the start of the date field) and add a two character 19 (add 20 if the year is less than 45). This date field occupies 2 positions, is binary and is in YYMM format. Note that the maximum value of a two position binary field is 32,768. Inserting 19 and 20 into this date field can produce the numbers 199912 and 200012. The size of these numbers requires the binary field to be increased to four positions.
The eighth Action Command is the Add/Delete Century With Occurs Records Action Command, which adds or deletes century when there is a fixed number of Occurs, with a maximum of 999. The file can have fixed or variable records. Within an Occurs, each action should be coded in a sending order. The preferred format for this Action Command is as follows:
The format for the data in these columns follows the same pattern as for the first occurs: Here it is documented based in its relative position rather than the actual column:
The format codes are:
1=YYMMDD TO CCYYMMDD
2=YYMM TO CCYYMM
3=YYDDD TO CCYYDDD
4=MMDDYY TO MMDDCCYY
5=MMYY TO MMCCYY
6=DDMMYY TO DDMMCCYY
7=YY TO CCYY
8=YYWW TO CCYYWW
9=WWYY TO WWCCYY
Here are several examples of the Add/Delete Century with an Occurs and their literal description:
(1) For records identified by Action Group 001, recognize that there is an Occurs clause. The Occurs starts in position 41, there are three occurrences and each occurrence has ten positions. Insert a two character 19 (20 if the year is less than 45) in position 2 where there is a YYMMDD date and again in position 6 where there is another YYMMDD date. Do both of these date inserts for each of the three occurrences.
(2) For records identified by Action Group 002, recognize that there is an Occurs clause. The Occurs starts in position 250, there are seven occurrences and each occurrence has twenty-five positions. Insert a packed 19 (20 if the year is less than 45) in position 1 which is currently the start of a two position packed YY date field.
(3) For records identified by Action Group 003, recognize that there is an Occurs clause. The Occurs starts in position 50, there are three occurrences and each occurrence has twenty positions. Insert the appropriate century value as character data in position 2, where the date field currently is in FORMAT #1--YYMMDD. At position 10 insert the appropriate century value into the binary field four positions with a format of YYMMDD.
The ninth Action Command is the Add/Delete Century With Occurs Depending On Action Command, which adds or deletes century when there is an Occurs Depending On. The "depending on" should be present in the record. Again, the file can have fixed or variable records and each action should be coded in ascending order. The preferred format for this Action Command is as follows:
The format for the data in these columns follows the same pattern as for the first occurs depending on. Here it is documented based in it's relative position rather than the actual column:
The format codes are:
1=YYMMD TO CCYYMMDD
2=YYMM TO CCYYMM
3=YYDDD TO CCYYDDD
4=MMDDYY TO MMDCCYY
5=MMYY TO MMCCYY
6=DDMMYY TO DDMMCCYY
7=YY TO CCYY
8=YYWW TO CCYYWW
9=WWYY TO WWCCYY
The tenth Action Command is the Exit Action Command, which allows customers to invoke their own routines for handling some aspect of a file conversion. The Exit Action Command uses the same general coding technique as the other Action Commands and can be designed to work with both Select and Swap Statements. As noted above, when there are a large series of changes, it may be more efficient to use the Exit Action Command than the Replace Action Command. For example, the Replace Action Command is a great tool when changing ten product codes to ten different codes in a file. However, when changing 10,000 product codes, it may be more efficient to use the Exit Action Command. The Exit Action Command can eliminate the need to code 10,000 individual Replace Action Commands (one for each product).
The preferred format for an Exit Action Command is as follows:
Here are several examples of the Exit Command and their literal description:
(1) On SL transactions, for records identified by Action Group 001, the first thing to do is go out to position 5 and replace the one position of data with two positions of data supplied by the exit program YR2KPGM1. On SW transactions, for records identified by Action Group 001, the first thing to do is go out to position 5 and replace the two positions of data with one position of data supplied by the exit program YR2KPGM1.
(1) On SL and SW transactions, for records identified by Action Group 001, the second thing to do is go out to position 10 and replace the three positions of data with three positions of data supplied by the exit program YR2KPGM3.
Although very specific examples are described above for various statements, parameters, commands, and formats for these statements, parameters, and commands, it will be appreciated by those skilled in the art that various modifications could be made to the formats and that other statements, parameters, or codes may be implemented. The particular formats listed are provided for purposes of example only and are formats that correspond to the statements as used and manipulated by the inventive computer program.
The above description is considered that of the preferred embodiments only. Modifications of the invention will occur to those skilled in the art and to those who make or use the invention. Therefore, it is understood that the embodiments shown in the drawings and described above are merely for illustrative purposes and are not intended to limit the scope of the invention, which is defined by the following claims as interpreted according to the principles of patent law, including the Doctrine of Equivalents.