Date: Tue, 10 Sep 2002 04:05:38 +0000
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paul Dorfman <paul_dorfman@HOTMAIL.COM>
Subject: Re: SAS 2 COBOL
Content-Type: text/plain; format=flowed
>This rule might not hold in the case of access to external databases.
>According to a friend of mine who uses both COBOL and SAS with DB/2,
>there are some cases in which COBOL beats the pants of SAS, due to some
>inefficiencies in the way SAS handles the interface. If SAS allowed
>dynamic WHERE clauses in the data step, some of this problem would go
>away (can code around it, but it's a lot of work).
Funny you cite this kind of situation. Sure you are right that at times
(especially before the LIBNAME to DB2 and DBKEY= option had become
available), a SAS programmer has to exhibit certain ingenuity in order to
use an external database efficiently, utilize existing DB2 indices, etc.
However, in my experience, SAS deficiencies in this respect are more than
offset by the way COBOL programmers are taught to reason programmatically.
In fact, the most outrageous example of SAS beating the pants of COBOL I
think I have mentioned earlier pertained to a COBOL program written to
create something akin to X*Y*Z tables statement in FREQ. X, Y, and Z resided
in three different tables, and for each X, the program would open a cursor
against the table with Y, and if that one was returned SQLRC=0, open a
cursor against Z, and so on, and proceed with convoluted logic incrementing
counters. The program failed to finish in time=1440. Merely dumping the
tables via Pass-Thru into views, merging those, and FREQing the result ran
in less than a minute.
In general, I would say that I cannot fancy a real-world RSBMS access
situation where I would be hard-pressed to use COBOL instead of SAS to
achieve a substantial win in peformance. The reason is simple. If there are
no DB2 indices defined, or more than 10% of the table is accessed via an
index, both SAS or COBOL are bound to read tables sequentially, which sucks
no matter which language is being used because of the very RDBMS nature. If
there are indices, they can be practically always utilized in SAS either via
DBKEY= or by writing a Data step flexcode or macro, which is pretty
straightforward, even though in COBOL, cursor processing does look more
natural. However, I am not sure that all the wordy stuff one has to pile up
on top of it is worth the effort. Of course, COBOL programmers are much
better typists, so for them, it most likely does not matter.
Paul M. Dorfman
Join the world’s largest e-mail service with MSN Hotmail.