Home > Ask the Data management / BI Experts > Questions & Answers > Simulating the VSAM START command
Ask The Data Management Expert: Questions & Answers
EMAIL THIS

Simulating the VSAM START command

Craig Mullins, Years 2005-2006 EXPERT RESPONSE FROM: Craig Mullins, Years 2005-2006

Pose a Question
Other Data Management Categories
Meet all Data Management Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 22 June 2004
Is there a standard approach to simulating the VSAM START command using SQL/DB2? Especially with "START - NOT LESS THAN."

Concatenation is too expensive, and I've been told that redesign is not an option for the project, just convert.

>
Well, if redesign is not an option, then you are probably staring into the abyss of an unsuccessful project. VSAM is not DB2 -- and DB2 is not VSAM. A straight conversion of VSAM files to DB2 tables and then VSAM read to DB2 selects will likely result in a poorly performing, badly designed DB2 database and application.

With DB2 and SQL, the best approach to optimizing performance is to put the work into the SQL statements. If you are comparing three VSAM master files in an application, you are likely going through each one in key sequence and looking for matches. This is not the best approach in DB2 -- where a three-table SQL join would out-perform a row-by-row comparison.

Be that as it may, from what I can glean from my dusty old VSAM books, the START statement is a way of telling VSAM where to start reading in the file. This doesn't really translate to DB2 SQL. Instead, each SQL statement would have the criterion built into the WHERE clause. So, for example, consider a VSAM START statement like this:

START filename
 KEY IS GREATER THAN 75

This means that the next VSAM read will begin with keys greater than 75.

In SQL, you would build this into your SELECT statement. For example:

SELECT col1, col2, ... colx 
FROM   tablename
WHERE  KEY > 75
AND    ... other conditions ...;

Of course, I do not recommend that you just dive into this conversion until you get adequate training on DB2, SQL and the differences between flat/VSAM files and relational tables.

Good luck.

Editor's note: Do you agree with this expert's response? If you have more to share, post it in one of our discussion forums.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
IBM DB2 management
How to select an MPP database: DB2 vs. Teradata
What are the top database management systems (DBMS)?
Are there benefits to using both Teradata and a DB2 database?
Tips for evaluating top database management systems and choosing a small DBMS
Exec explains IBM's Information On Demand (IOD) initiative
IBM DB2 9 Fundamentals certification (Exam 730): Sample questions about tables, Part 7
IBM DB2 9 Fundamentals certification (Exam 730): Sample questions about tables, Part 6
IBM DB2 9 Fundamentals certification (Exam 730): Sample questions about tables, Part 5
DB2 basics
IBM DB2 basics

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts