Accessing Data the .NET Way


I must admit that this is probably one of my least favorite topics because it clearly flags the departure from using Job Control Language (JCL). That's right, after all of these years of using JCL on the mainframe for most of your data needs, along comes .NET. So, for the reformed mainframe programmer, .NET is a fond farewell to JCL.

Cross-Reference  

Part Three of this book further explores the topics presented in this section.

This section discusses using .NET to get data in the following ways:

  • Without the help of JCL

  • From a relational data source

  • Described with XML

Getting Data Without the Help of JCL

As you know, on the mainframe JCL is used for many things, not just data access. JCL has been there for us through the years, providing a way to allocate the resources needed by our programs. Nevertheless, in the average mainframe JCL structure (Job), the data definition (DD) statements account for well over half of the JCL statements used. So, I repeat, it is time to say good-bye to JCL. Yes, as part of the package of your reformation away from the mainframe and into the .NET world, JCL is no longer a tool available in your arsenal. Period.

Now, here is the good news: .NET provides several ways to access data (and allocate other resources). Each of the available ways has a specific strength. As you learn about these approaches, you will discover that you will have a preference for one approach or another, depending on your needs. On the mainframe, you used one approach for regular sequential (Queued Sequential Access Method, or QSAM) files and a different approach for Virtual Storage Access Method (VSAM) files. By the way, for you, QSAM and VSAM files have joined JCL on the fond farewell list.

OK, before I upset a few people: Yes, I should have said QSAM and VSAM, as we have known them. First, the text files that you will work with on the Windows platform will remind you of mainframe QSAM files. Second, some vendors have created very useful tools that run on the Win32 platform to create indexed files. These indexed files behave similarly to mainframe VSAM files. For example, Fujitsu Software has a Win32 product called COBOL File Utility that will create an index for your Win32 text file. Granted, with this Win32 index file, you do not have all the power of a traditional mainframe VSAM file, but the Win32 file is indexed.

Cross-Reference  

Chapter 10 introduces a new perspective on data and covers several .NET tools for basic data access.

Obtaining Data from a Relational Data Source

Although a relational data source isn't your only choice for data access, it certainly is one of your choices. As it turns out, using relational databases in Windows and Web applications (and on .NET) is extremely popular. In Chapter 11, I discuss not only the actual coding concerns, but also the use of the SQL Server basic administrative tools.

On a similar note, Microsoft's SQL Server isn't your only choice of relational data source system. There are other good products on the market (e.g., Oracle, Microsoft Access, and so forth). Nevertheless, in this book, you will use Microsoft's SQL Server (currently SQL Server 2000) for your database- related samples.

For those of you who have worked with IBM's DB2 RDBMS on the mainframe, you will feel right at home with Microsoft's SQL Server 2000. Well, sort of. The Structured Query Language, or SQL (now Transact-SQL, or T-SQL), is virtually the same as the SQL used to access DB2. You will realize the learning curve when you start looking around for some of the mainframe tools such as DB2 Interactive (DB2I), SQL Processor Using File Input (SPUFI), and Query Management Facility (QMF).

Working with SQL Server 2000, you will have a new set of tools to learn, namely Query Analyzer and Enterprise Manager. You can be certain that eventually you will need to write a database application. Therefore, time spent mastering these tools is time spent wisely.

Cross-Reference  

I further explore the topic of T-SQL in Chapter 3. Then, to smooth out the learning curve for relational data sources, I discuss SQL Server 2000, along with a new set of related tools, in Chapter 11.

Getting Data Described with XML

As mentioned in Chapter 1 during the discussion of the J4 committee members ' activities, practically every software vendor is using XML in one way or another. Well, so is Microsoft. But to what extent? Let's just say that XML is to .NET as blood is to the human body. Therefore, it is appropriate to use this topic to help answer the question "What is .NET?"

With XML, you will be accessing data. Specifically, you will find yourself describing, reading, and writing data with XML. You will be amazed at the various ways in which XML is used and can be used throughout the .NET platform. Generally, you can look at XML ( especially XML Schemas) as a way to describe your data, much as you would use a mainframe COBOL copybook. Additionally, when you are writing (and reading) data in your .NET application, .NET makes it very convenient to write your data in the format of XML. You will even find that all of your .NET configuration concerns will be addressed using XML. XML truly runs through .NET inside and out. As you dig deeper into .NET (and XML), you will become more comfortable working with XML. You will quickly grow to view it as just another tool/standard to help you with your data concerns.

Cross-Reference  

I expand on the topic of XML in Chapter 4. In Chapter 12, I further discuss XML in the context of describing and handling data.

Whether data is structured with the help of XML or a relational database, or accessed with ADO.NET (or any of .NET's innovative approaches), someone will want to see that data. In fact, a user will typically want to interact with your application and any data that is exposed. I discuss this aspect of .NET in the next section. As you continue through the chapter, perhaps you can appreciate (even more) that defining .NET is a significant undertaking.




COBOL and Visual Basic on .NET
COBOL and Visual Basic on .NET: A Guide for the Reformed Mainframe Programmer
ISBN: 1590590481
EAN: 2147483647
Year: 2003
Pages: 204

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net