+ All Categories
Home > Documents > COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3...

COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3...

Date post: 28-Dec-2015
Category:
Upload: lillian-oconnor
View: 214 times
Download: 2 times
Share this document with a friend
37
COT2180 / Y2K / 1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1 To give you some close contact with some of the Information System problems which use dates (and that’s most of them) 2 To introduce some additional SQL which should give you some insight into the scope of this language 3 To take you through some of the information provided at the Victorian Government Millenium Bug web site and perhaps you will carry some of the concepts into Microsoft’s version of SQL and try them out ?
Transcript
Page 1: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /1

A SLIGHT DIVERSIONWhat’s the fuss about the year 2000 ?

A SLIGHT DIVERSIONWhat’s the fuss about the year 2000 ?

This lecture has 3 objectives:• 1 To give you some close contact with some of the

Information System problems which use dates (and that’s most of them)

• 2 To introduce some additional SQL which should give you some insight into the scope of this language

• 3 To take you through some of the information provided at the Victorian Government Millenium Bug web site

• and perhaps you will carry some of the concepts into Microsoft’s version of SQL and try them out ?

Page 2: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /2

A Bit of Background about DatesA Bit of Background about DatesA Bit of Background about DatesA Bit of Background about Dates

• In computer systems, there are a number of ways of encouraging dates into computer held data - whether this be in file or table form.

• Dates can be expressed in– DEFAULT date format– NUMBER format– CHARACTER format

• There is also a nice feature known as NLS (National Language Support. This is a set-up parameter during installation of software e.g. database.)

Page 3: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /3

Oracle DBMS Date OrganisationOracle DBMS Date Organisation

• Using Oracle, which is (or will be available on the University Server System), will give some specific insight into the Year 2000 conundrum

• Oracle can store dates ranging from January 1, 4712 BC (although there were no computers about then) to December 31, 4712 AD.

• (That should give us plenty of leeway). This is based on the use of the date datatype.

• Other DBMS’s have similar date features

(have you tried Access ?)

Page 4: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /4

Date FormatDate Format

• Oracle stores dates in the format

YYYY-MM-DDHH24:MI:SS - again using the Oracle date datatype

• If the default date format is used, things get a bit different.

• The software must convert from its own internal representation of dates to a readable format on output, and a similar conversion must take place for input date data.

Page 5: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /5

Date HandlingDate Handling

• Oracle provides a wide range of date formats which a programmer can apply using the TO_CHAR() and TO_DATE() functions.

• Let’s look at an example of a date referenced as a string

• select * from EMP where hire_date > ‘13-MAR-1998’.

• In this example, which reflects about 75 to 80% of Oracle SQL code, Oracle uses the default date format to present a result (what does Access do ? )

• The default date format is of the form DD-MMM-YY

Page 6: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /6

Oracle ServerOracle Server

In this discussion, remember that Oracle is a Client device.

It is normally connected to a Server which could be running DB2, Informix, SQLServer, Ingres, CA-Open Ingres or any of the commercial DBMS packages.

Thus any changes to date formats in the Client(Oracle) also need to be known to the Server (Or Servers)

MS-Access is at the low end of Volume DBMS’s

Page 7: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /7

Problems with Dates after 1999.Problems with Dates after 1999.

DD-MMM-YY• The following example, which is based on a fairly typical

order-entry system, will show how things will become confusing in the latter half or 1999.

• The attributes set up for the “order” table include:– Order_id, customer-code, order_date, delivery_date,

terms_of_payment, amount_due

• Let’s insert some ‘1999’ data such as

insert into order values(993172,1001,’15-NOV-99’, ‘03-Jan-00’, 2, 1800.00)

Page 8: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /8

A Possible Year 2000 ProblemA Possible Year 2000 Problem

Those values again ?• 993172,1001,’15-NOV-99’, ‘03-Jan-00’, 2, 1800.00

• The Dispatch or Supply Department will most likely work on a system which produces a report showing those orders which have a delivery date greater than the current date.

• Unfortunately, Order 993172 details will never appear as the year of the date of delivery (00) is less than the current year (99). After Jan 1, 2000, things will improve - but before then there will be a number of unhappy customers.

Page 9: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /9

One SolutionOne Solution

• Change the default date format to a date format which behaves consistently and accurately over the years 1999 and 2000

• What functions does the DBMS offer ? In the case of Oracle the default date format can be altered at the session and instance level.

• This won’t however alter data already in the database - only ‘new’ data being entered.

• The entry : alter session set NLS_date_format = ‘MM/DD/YYY’

will accommodate the 4 digit year on input.

Page 10: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /10

A SolutionA Solution

Using Windows NT Operating System:• Hopefully you know about Windows NT Registry (or

Windows 95 Registry).

• In NT, there needs to be a new key under NLS_DATE_FORMAT under key HKEY_LOCAL_MACHINE,SOFTWARE,ORACLE

This key should have a string value of DD_MMM_YYYY

The same change needs to be made on the Client(s)

Page 11: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /11

A Different SolutionA Different Solution

• One of the less acceptable solutions is the simple change from a YY format to a YYYY format.

• This requires modification to all existing programs, table schemas, reports etc. and also requires much intensive examination (hopefully by software) of the occurrences of ALL dates. As a brief example, a date of birth such as 16-06-58 means 1958, not a build up to 2058.

• There is a means of Displaying (as in our order example) a year 20nn without having to alter all programs.

Page 12: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /12

A Different Solution - cont’dA Different Solution - cont’d

• At the same time however, there needs to be caution applied as you saw from the previous slide .

• Oracle has a format DD_MMM_RR which interprets ‘01-JAN-01’ as January 1, 2001, not as January 1, 1901.

• Any date with a year between 50 and 99 is interpreted as occurring in the 20th Century, and any year between 00 and 49 as occurring in the 21st Century. (01-JAN-00 is interpreted as January 1, 2000 - not exact, but workable).

• Now, back to our example:-

A clever DBA will have set the default date format to DD_MMM_RR by resetting the NLS_DATE_FORMAT

Page 13: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /13

Solution RR Cont’dSolution RR Cont’d

• So using the RR year format we can use the script -

insert into order values(993172,1001,’15-NOV-99’, ‘03-Jan-00’, 2, 1800.00);

and we have overcome the ‘century’ roll-over. Order and dispatch reports will reflect the century change, customer orders will be dispatched, and customer will be happy. And of course the firm(s) will in due course receive payments, and it (they) will be happy potatoes.

Page 14: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /14

Other Methods of Representing DatesOther Methods of Representing Dates

• Dates can be represented as NUMBER or VARCHAR2

• The Oracle ALL_OBJECTS TIMESTAMP in the Data Dictionary is defined as VARCHAR2(75).

There needs to an investigation of tables where such data forms (and data) occurs.

Page 15: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /15

‘Date’ Data Searching and Locating‘Date’ Data Searching and Locating

The following script helps to locate occurrences of dates (or things which look like dates):

SELECT owner,table_name, column_name, data_type

from all_tab_columns

where (column_name like ‘%DATE%’ or column_name like ‘%TIME%’ or column_name like ‘%MON%’ or column_name like ‘%YEAR%’ and date_type != ‘DATE’ and owner != ‘SYS’ order by owner, table_name, column_id;

Page 16: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /16

Solution : Non ‘DATE’ datesSolution : Non ‘DATE’ dates

• The result of the script will a list of ‘suspicious’ attributes which may contain dates, but are not of the standard or default date format. And then …… (many hours of research as to the ‘true meaning and implication’ of the contents of the list).

Page 17: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /17

A Case StudyA Case Study

The study of drugs and their effects (short and long term) is world wide and much data (terabytes) has been collected.

This script is (probably) a good sample of the tables schema

create table drug_study (study_id varchar2(8) not null, study_yr_mon number(4) not null, dosage number (5,2) …. etc….. );

Page 18: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /18

Drug Study Drug Study

• A simple query over the study_yr_mon would reveal ‘dates’

in the form YYMM

select study_yr_mon from drug_study

where study_id = ‘(reference code)’; (say, a/bc/ax)

The result ? Probably this:-

study_yr_mon

9908

9909

9910

Page 19: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /19

Drug Study - contdDrug Study - contd

• In the year 2020, a researcher runs this script _

select study_yr_mon, dosage from

drug_study

where study_id = ‘a/bc/ax’ and study_yr_mon > 9901

• Results for years 2000 onwards will not be revealed because of the 2 digit year.

The solution ? (1) widen the column to support a 4 digit year

or (2) convert to a date datatype

Page 20: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /20

Drug Study - contdDrug Study - contd

What changes do you suspect will be necessary with solution 1 or 2 ?

• Any estimates of personnel costs at say $200 per hour ?• Or process costs at about $2500 per hour ?

• Of course, the supreme optimists might argue that NOBODY would ever want such an analysis and therefore the changes and the costs will not occur.

• One very serious drawback here is FUNDING.

Page 21: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /21

Domains Might HelpDomains Might Help

• A previous example (slide 15) gives a clue as to the use of ‘domains’ - a list of possible constraining terms or values.

• If the application deals with Stocks, Shares, Bonds (monetary or financial applications) it may be advantageous to set up a domain set over ‘ principal terms’ such as MATURITY, EXPIRE in the Where clause - these probably contain dates ( or could).

• The script (in this case) could look like

Page 22: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /22

Domains - How Can They Help ? Domains - How Can They Help ?

• Where column_name like ‘%date%’,

or column_name like ‘%time%’

or column_name like ‘%mon%’ etc for year and day

or column_name like ‘%maturity%’

or column_name like ‘%issue%’

or column_name like ‘%expire%’

or column_name like ‘%first_call%’

and datatype != ‘date’ and owner != ‘sys’;

All of which strongly supports the view that there needs to be an accurate and deep understanding of what data exists and where and how it is used.

Page 23: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /23

An Actual Case Study 1An Actual Case Study 1

• This study, and most of the data, is based on the American Social Security Administration. This organisation has a number of very large database, and of course is responsible for benefits payments, which MUST flow over into the 21st Century.

• There are about 50 million people who receive monthly payments

• Much of the application code for the various forms of processing is in Cobol and Assembler (with various versions).

Page 24: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /24

An Actual Case Study 2An Actual Case Study 2

‘date’ related data exists in such values as• date of birth• date first commenced earnings and value of earnings

(wages are traced back to 1935 - which is well many of you were born)

• dates of start work and stop work• dates of changes in salary• date(s) or marriage• date of birth of children• dates of death of spouse(s), children

Page 25: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /25

An Actual Case Study 3An Actual Case Study 3

Some Considerations:

1. The time constraint (Jan 1, 2000) cannot be extended

2. Much of the application software was written up to 20 years ago

3. Some of the source code is not now available

4. Regular (or even intermittent) clean ups of supposedly non-used code had resulted in some software (mainly non changing utilities) being deleted from the library (but not the application library).

5. Policy for date recognition and handling

e.g. pivot years: 50 - 99 = 19nn

00 - 49 = 20nn

Page 26: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /26

An Actual Case Study 4An Actual Case Study 4

• And, there is no budget increase for additional staff. (sound familiar ?)

• Existing workloads have to be accommodated

• Testing of any and all changes made to programs/database tables

• Processing time availability

• Recognition of legacy legislation - age/payment groupings.

Page 27: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /27

An Actual Case Study 5An Actual Case Study 5

• One Hitachi Data Systems Skyline Series - 72 computer (HDS GX Processor) has been set up with the internal clock set to the 21 Century.

• (You might try this with Access)

• The Administration ‘share’ their data with other agencies so this data and data from these other agencies must conform to a year 2000 standard

Page 28: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /28

Some StatisticsSome Statistics

• Number of people who report wages each year– Approx. 250 million

• Number of cheques per month : 50 million• Requests for new or replacement Social Security cards per

year : 3 million• Volume of data stored : 5 terabytes• Number of Individual programs : 20,000• Lines of Cobol and assembler code : 32 million• Code already modified and in test : ~ 85%• Commencement of year 2000 changes : 1989

Page 29: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /29

Future PlansFuture Plans

• Migration of MVS and CICS mainframe systems to a multi-tier client/server environment as opposed to the existing multi field office LAN ‘dumb’ terminals, with batch data transfer to the SSA central computers which are located in Baltimore with appropriate redundancy

• Movement of its data bases from CA-IDMS to DB2

Page 30: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /30

Some Practical AspectsSome Practical Aspects

• A 400 year old computer in the Liverpool museum predicts the position of planets (how does it accommodate the ‘new’ ones ?) will have to stop working on 31-12-1999. It cannot accept the date 01-01-2000

• Does this explain why Stonehenge is now a tourist attraction rather than a working predictive model ?

• Upgrades from Excel Microsoft Office 95 to Office 97 interpret the 2 digit year differently. Dates must be converted to the 4 digit form or … ??

Page 31: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /31

Some Local InformationSome Local Information

The following is an extract from the Victorian Government Millenium Bug web page which you can see in full at

www.y2k.dsd.vic.gov.au

Q. What is the Millenium Bug ? How was it caused ?

A. The problem results from the practice of ‘fixing’ the first 2 digits of the year component of a date into programs, and making the second 2 digits variable - thus saving 2 digits per date record.

As the year 2000 approaches, programs may interpret ‘00’ as 1900 rather than 2000, or treat ‘00’ as an error.

Page 32: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /32

Some Local InformationSome Local Information

• This can lead to incorrect processing results when any system relies on dates for processing input and control– computer hardware– computer software– systems with embedded chips (lifts, security systems,

……)– An embedded chip is used in many devices to automate

a process. They are commonly used in• production lines• security systems• traffic lights• transport systems• kidney dialysis machines ……...

Page 33: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /33

Some Local InformationSome Local Information

Q. Are there any other ‘nasties’ ?

A1. 1 July 1999 is commonly used as the commencement of the Financial year. Transactions which roll over into the year 2000 may be corrupted

A2. 9 September, 1999 was commonly used to represent a file expiration date (meaning some very high value). It could be that archive systems will delete these files on or after 9-9-1999 (or 9-9-99)

A3. 29 February 2000 is also a leap year, and therefore the date 29-02-2000 is a legitimate date.

Page 34: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /34

What Can/Must be Done ?What Can/Must be Done ?

1. Take a compete inventory of all computer hardware, software and anything else which may be electronically and list these items. Include building services such as power, air conditioning, fire protection, lifts, emergency power, security systems and ventilation fans

Highlight the most important systems and give them priority. List all equipment used to support these systems and decide in what order equipment and software should be checked for the presence of the problem data.

Page 35: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /35

Towards Fixing the ProblemTowards Fixing the Problem

2. Use the inventory to contact the manufacturers and suppliers of the equipment and software to find out what may be affected and what needs to be done to ensure Year 200 compliance

3. Discuss the Millenium Bug with all the other businesses and clients within your supply chain to check if they will be Year 200 compliant.

4. Where Year 2000 problems are identified, assess the effect any failure will have on business operations and prioritise a work schedule to deal with the most critical areas as a matter of urgency

Page 36: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /36

Towards Fixing the ProblemTowards Fixing the Problem

5. Develop an action plan leading to the engagement of professional help where required, implementation of corrective action and a testing schedule which allow sufficient time to test all operations.

6. Set aside time to test computer systems and electronic equipment for Year 2000 compliance. This ,ay take considerable time.

7. Document steps taken to identify and rectify the problem and request certification from manufacturers, suppliers and Year 2000 professionals that the computer systems are Year 2000 compliant.

Page 37: COT2180 / Y2K /1 A SLIGHT DIVERSION What’s the fuss about the year 2000 ? This lecture has 3 objectives: 1To give you some close contact with some of the.

COT2180 / Y2K /37

Towards Fixing the ProblemTowards Fixing the Problem

8. Measure the consequence of failure and develop business continuity contingency plans for areas of the business which may not be fixed in time and/or which may be affected by the failure of clients, suppliers and distributors to fix their own year 2000 problem.

The web site for more on this subject is at :

www.y2k.dsd.vic.gov.au


Recommended