Best Approaches Mainframe to UNIX

Teradata Blog

Teradata Blog

Based on this legacy, a significant portion of today’s transactions is still processed by mainframes. Yet, unlike in the beginning of the computer era, big businesses no longer require mainframes to handle large volumes of data quickly and accurately. Today, the largest transactional systems in the world don’t run on mainframes.

Leaders such as Apple and its iTunes and Apps stores, Facebook, Amazon, Google and most leading Telecommunications companies and retailers no longer operate mainframes.
Most importantly, new competitors across all sectors of the economy are challenging incumbents without the handicaps of old mainframe technologies, and therefore benefitting from radically lower costs and far faster response times in launching new service offerings. Refer here detailed migration analysis.

The New York Stock Exchange (NYSE) is migrated to a 1,600 millions of instructions per second (MIPS) mainframe to IBM System p servers running AIX and x86 Hewlett-Packard Co.

Strategies of Migration:

Integration: Moving Part of an Application

Integration involves moving one or more components of an application to the Windows platform. For example, one scenario may be to move executable components, but leave a database shared with other applications on the mainframe. Application components such as reporting job streams, high volume printing, or read-only queries may be separated from the rest of the application and migrated on an individual basis.

Integration will often be the first step an organization takes in migrating an application, because it mitigates costs and risks. However, this strategy may not deliver a sufficient degree of benefit commensurate with the required investment when compared to other available strategies that potentially eliminate the mainframe.

Code Migration: Moving an Entire Application

Code migration involves recompiling or converting the application source code to the new platform. Many third-party tools are available to ease this process, especially for applications written in COBOL. When using this technique, it is important to decide whether to migrate existing bugs associated with the code or fix them as the code is recompiled.

This strategy is an extended and complex process that can easily be underestimated because a large number of different technical components must be migrated. Recompiling code may not adequately address the needs of changed business processes, which may be the real benefit of the new application.

Replacement: Adopting a New Windows Application

The replacement strategy takes advantage of the availability of relatively inexpensive Windows versions of many “off the shelf” software packages. The old application is withdrawn from service and its functionality is replaced by the newly adopted Windows application. The issues in this strategy center on the adaptation of the business processes to the capabilities of the new applications, which are unlikely to exactly duplicate those of the old application.

Evolution: Begin to Develop Applications in the Windows Environment

The evolution strategy advocates using the existing application as a starting functional specification, and then rebuilding the application using modern programming languages and tools. The challenge here is to maintain existing applications and infrastructure as required while creating new applications and infrastructure. This may be an effective strategy to employ when you need a major new application without eliminating the older application.
Gartner Research Mainframe Modernization

More information I will publish in my next post.

5 New Things On DB2 Cursors

UntitledCursors plays prominent role in application programming development. When to use Cursor is most important decision. If we use Cursors un-necessarily, it causes to take more CPU time.

  • Program requires a SELECT statement that returns more than one row, then we need to use cursors. Singleton SELECT cannot be used to return more than one row.
  • We always no need to go for cursor. Cursor takes more CPU time compared to Singleton SELECT. We can use Singletone by coding the program to accept -811 as a successful SQL call and process the returned row.
  • No limitation on number of Cursors declared in a program. We can Open and Declare any number of CURSORS at a given point of time.
  • When commit is issued, all cursors will be closed, except CURSORS with WITH HOLD. However, during ROLLBACK all WITH HOLD cursors also will be closed. WITH HOLD curors will created more problem in CICS that takes more system resources, and difficult to with hold. So better avoid using them.
  • We cannot use Cursor for Update or Delete, when we use the following in Declare SQL

UNION clause

DISTINCT clause

GROUP BY clause

ORDER BY clause

Joins

Subqueries

Correlated subqueries

Tables in read-only mode, ACCESS(RO)

Tables in utility mode, ACCESS(UT)

Read-only views

  • Execution of cursor will start with OPEN cursor, not from Declare cursor. All host variables we need to initialize properly. During OPEN time it validates all host variables.

 

Nested Cursor – DB2

Srinimf-BrandIn DB2 we can use nested cursor. A cursor within the cursor is called nested cursor.

DECLARE Cursor:

We can declare all cursor definitions in working storage section.

OPEN CURSOR

FETCH CURSOR

     When Source=10

               OPEN CURSOR-1

              FETCH CURSOR-1

              Close CURSOR-1

   When Source=20

             OPEN CURSOR-2

              FETCH CURSOR-2

              Close CURSOR-2

CLOSE CURSOR

The above way we can add many cursors, inside a cursor. Steps we need to take care are , we need to close all the cursors properly. Always look for Query performance. Since multiple cursors definitely will take more CPU time. However, in special cases/unavoidable cases we can use nested cursors.

Driverless Cars -Role of IT Professionals

Big data AnalyticsBasics of driverless cars

The Google Self-Driving Car is a project by Google that involves developing technology for autonomous cars, mainly electric cars. The software powering Google’s cars is called Google Chauffeur. Lettering on the side of each car identifies it as a “self-driving car”. The project is currently being led by Google engineer Sebastian Thrun, former director of the Stanford Artificial Intelligence Laboratory and co-inventor of Google Street View.

Robotics knowledge is a main role in developing driverless cars. Skill set for Robotics. Fast growing career options-Robotics and Artificial Intelligence.

Thrun’s team at Stanford created the robotic vehicle Stanley which won the 2005 DARPA Grand Challenge and its US$2 million prize from the United States Department of Defense. The team developing the system consisted of 15 engineers working for Google, including Chris Urmson, Mike Montemerlo, and Anthony Levandowski who had worked on the DARPA Grand and Urban Challenges.

Legislation has been passed in four U.S. states and Washington, D.C. allowing driverless cars. The state of Nevada passed a law on June 29, 2011, permitting the operation of autonomous cars in Nevada, after Google had been lobbying in that state for robotic car laws. The Nevada law went into effect on March 1, 2012, and the Nevada Department of Motor Vehicles issued the first license for an autonomous car in May 2012, to a Toyota Prius modified with Google’s experimental driverless technology. In April 2012, Florida became the second state to allow the testing of autonomous cars on public roads,and California became the third when Governor Jerry Brown signed the bill into law at Google HQ in Mountain View.In December 2013, Michigan became the fourth state to allow testing of driverless cars in public roads. In July 2014, the city of Coeur d’Alene, Idaho adopted a robotics ordinance that includes provisions to allow for self-driving cars.

How driverless cars work?

What could have prevented the accident? The obvious answer is that you could have — by paying attention. But that answer isn’t so simple. Driver error is the most common cause of traffic accidents, and with cell phones, in-car entertainment systems, more traffic and more complicated road systems, it isn’t likely to go away. But if drivers aren’t going to concentrate on the road, who is? If technology continues on its current course, your car will do the concentrating for you. Automakers are developing complex systems that allow cars to drive themselves. They’re also furthering existing technologies such as self-parking and pre-safe systems. You may even be surprised to find out your old clunker already sports some driverless technologies.

Read more here

CICS-ABEND Command and Rules

The ABEND command forces the current task to terminate abnormally. If a HANDLE ABEND command is in effect, control

SRINIMF IT JOBS

SRINIMF IT JOBS

will be transferred to the routine it specifies. Otherwise, control is returned to CICS. An optional storage dump can be produced.

Syntax
EXEC CICS
ABEND [ ABCODE(name) ]
[ CANCEL ]
[ NODUMP ]
END-EXEC.

Options

ABCODE
Specifies that a storage dump should be produced. The name supplied is used to identify the dump, and it should be a 4-character value with no leading spaces. If you omit the name, the dump is identified by ????. If you omit ABCODE, a dump is not produced.

CANCEL
Specifies that any active abend exit set up by a HANDLE ABEND command should be ignored.

NODUMP
Specifies that a dump should not be produced. Since this is the default if ABCODE isn’t coded, you’ll rarely use the NODUM
Exceptional conditions
No exceptional conditions are raised as a result of the ABEND command.

Notes and tips

  1. Don’t start an ABCODE name with the letter A because abend codes starting with A are reserved by CICS.
  2. Storage dumps are written to the CICS dump data sets. You’ll have to determine your installation’s procedures for printing dumps.
  3. Because the ABEND command causes your task to abend, dynamic transaction backout is invoked. As a result, any changes your task made to recoverable resources will be reversed.

Coding example
This example shows how to issue an ABEND command, producing a storage dump identified by the abend code R100.

9000-ABEND-PROGRAM.
*

ABEND ABCODE(‘R100’)
END-EXEC.

Mainframe Ques and Messages

Message queues, and the software that manages them, such as IBM WebSphere MQ for z/OS, enable program-to-program communication.

Messaging means that programs communicate by sending each other messages (data), rather than by calling each other directly.

Queuing means that the messages are placed on queues in storage, so that programs can run independently of each other, at different speeds and times, in different locations, and without having a logical connection between them.

What is Synchronous Communication?

Program A prepares a message and puts it on Queue 1. Program B gets the message from Queue 1 and processes it. Both Program A and Program B use an application programming interface (API) to put messages on a queue and get messages from a queue. The WebSphere MQ API is called the Message Queue Interface (MQI).

When Program A puts a message on Queue 1, Program B might not be running. The queue stores the message safely until Program B starts and is ready to get the message. Likewise, at the time Program B gets the message from Queue 1, Program A might no longer be running. Using this model, there is no requirement for two programs communicating with each other to be executing at the same time.

What is Asynchronous communication?

The asynchronous model is natural for WebSphere MQ. Program A can continue to put messages on Queue 1 and is not blocked by having to wait for a reply to each message. It can continue to put messages on Queue 1 even if Program B fails. If so, Queue 1 stores the messages safely until Program B is restarted.

Role of Que Manager
When an application puts a message on a queue, the queue manager ensures that the message is:

  • Stored safely
  • Is recoverable
  • Is delivered once, and once only, to the receiving application

DB2 Columnar Functions- CAST and DECIMAL

Srinimf IT JOBS

Srinimf IT JOBS

CAST can be used to change the data type of an expression to a different data type or the same data type with a different length, precision, or scale.

SELECT EMPNO, CAST(SALARY AS INTEGER)
FROM   Samples.EMP;

The specified data type if DB2 not supported, DB2 will through an error.

Columnar Functions:

DECIMAL(BONUS) is equal to :-

SELECT EMPNO, CAST(BONUS AS DECIMAL(10,2))
FROM   Samples.EMP;

Passing Data From JCL to COBOL

Just TERADATA

Just TERADATA

From JCL we can pass data into COBOL program many ways. One is through PARM (maximum limit is 100 bytes), second through Input file, third through SYSIN card.

The data that we passed from PARM and SYSIN are passed to LINKAGE SECTION. In LINKAGE section we need to give 2 bytes extra to store length, and next we need to give actual size of the data.

LINKAGE SECTION.

01 PARMDATA.

05 STRINGLEN PIC 9(4) USAGE COMP.

05 STRINGPARM PIC X(80).

PROCEDURE DIVISION USING PARMDATA.

IF STRINGLEN > 0 . . .

The logic tests that if string-len is greater than zero, we can validate the data from JCL.

Simple Way to Write DML SQL in DB2

SQL-n-PLSQL

Start Your Career SQL-n-PLSQL

DML – Data manipulation language commands.

S-I-D-U (The way we can remember as Cricketer name)

SELECT

All queries begin with the SELECT SQL statement, which is an extremely powerful statement that is used to construct a wide variety of queries containing an infinite number of variations (using a finite set of rules). And because the SELECT statement is recursive, a single SELECT statement can derive its output from a successive number of nested SELECT statements (which are known as subqueries). (Earlier, we saw howSELECT statements can be used to provide input to INSERT and UPDATE statements; SELECT statements can be used to provide input to other SELECT statements in a similar manner.)

SELECT * FROM SAMPLES.TEST_1

The same command we can use either for Tables/Views.

INSERT

By using a different form of the INSERT SQL statement, the results of a query can also be used to provide values for one or more columns in a base table. With this form of the INSERT statement, a SELECTstatement (known as a subselect) is provided in place of the VALUES clause (we’ll look at the SELECTstatement shortly), and the results of the subselect are assigned to the appropriate columns. This form of the INSERT statement creates a type of “cut and paste” action in which values are retrieved from one base table or view and copied into another. As you might imagine, the number of values returned by the subselect must match the number of columns provided in the column name list (or the number of columns found in the table if no column name list is provided), and the order of assignment is the same as that used when literal values are provided in a VALUES clause.

INSERT INTO SAMPLES.TEST_1 VALUES(1000,’RAMU’,’HR’,25000);

DELETE

The DELETE statement can either work directly with the table that rows are to be removed from or work with an updatable view that references the table that rows are to be removed from.

DELETE  FROM SAMPLES.TEST_1;

or

DELETE FROM SAMPLES.TEST_1

WHERE ID =1000;

UPDATE

Data residing in a database is rarely static. Over time, the need to change, or even remove, one or more values stored in a table can, and will, arise. In such situations, specific data values can be altered by executing the UPDATE SQL statement.

UPDATE SAMPLES.TEST_1

SET ID=2000

WHERE DEPT=’HR';