1. Functionality FAQ

This section explains what the freeware ASC Flat Text File Data Batcher can do for your WinTel batch applications and NT servers that collect or maintain data via CGI or ASP.

Feel free to mail your comments to me at: rog@NOSPAM_rs-freeware.org.

Return to the global table of contents
Frames mode, or No frames


1:  What does "ADB" stand for?

2:   So, if I read your last answer correctly, the "DB" in "ADB" really means "Database," correct?  It's amazing that you have all of SQL built into this 130K executable!  Not to mention a fully-featured "idiot proof" GUI interface!

3:   Well, almost everyone wants a GUI interface for everything.  Furthermore, hardly anyone will use a non-GUI interface for anything.  GUI is the modern way.  Anything else is obsolete.

4:  So what's missing from SQL?

5:   You mean I can only write one output file for the records that are in one of the input files (but not the other)?  And only one output file for the records that match on a key between the two input files?  Kinda restrictive, ain't it?

6:  What about forms?

7:  Other than the generic commas-n'-quotes interface, is there support for Excel?  And what about specific DBMSs, such as Access, FoxPro, or Paradox?

8:  It looks like I'll have to learn Awk to really get the most out of ADB.  And I'll have little Awk scripts all over the place, right?

9:  I think I grasp the purpose of this program.  Do I have to read all this documentation?

10:  If I correctly understand your answers to the previous questions, there's no (built-in) report generation, no forms-based entry, no GUI interface, and no support for SQL.  I can't imagine why you wasted your time writing this.  Is there any way in which ADB can best a traditional DBMS such as Access, FoxPro, Paradox, etc.?

11:   So, with ADB, I can throw away my compilers and my standard DMBSs?

12:  What about an interface for C++ and/or VB instead of Awk?  And have you considered porting ADB to Unix?


1:  What does "ADB" stand for?

It means [A]SC text file [D]ata [B]atcher.

ADB's a simple program that lets you store data in "flat files" which can be manipulated in a manner that has something in common with a traditional DBMS.

With ADB's Awk interface, you can also code "full featured" C-like functions that can perform elaborate computations on the data.

Because ADB's file stucture is "open," you can also integrate your own executable code into the processing "jobstream," as needed.

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

2:   So, if I read your last answer correctly, the "DB" in "ADB" really means "Database," correct?  It's amazing that you have all of SQL built into this 130K executable!  Not to mention a fully-featured "idiot proof" GUI interface!

Sorry, no SQL.  The whole idea here is to have something that can be used by technical people who may not know the ins, outs, and pitfalls of SQL, as well as by programmers who "just want something simple" to handle file "set difference" operations as well as "intersections" (joins) based on a key.

There's also no GUI interface.  Everything's stored and maintained as plain text (including the file structures).

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

3:   Well, almost everyone wants a GUI interface for everything.  Furthermore, hardly anyone will use a non-GUI interface for anything.  GUI is the modern way.  Anything else is obsolete.

You may feel that this is so, but my sense is that many programmers and other technically-oriented people have a higher rate of productivity with "plain text" interfaces.

It's interesting to observe that no one has yet offered (or even attempted to develop) a 100% GUI interface for typing "code" in a standard programming language.

Note also that most good web designers tend to eschew fully automated interfaces.

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

4:  So what's missing from SQL?

Everything.

"All" you can do with ADB is to match two files on a key and declare how the output format for: (1) records in the first file that aren't in the second (based on the key); and (2) records in the second that aren't in the first, and (3) records in both.

Prior to matching, you can "massage" the data in either input file with an Awk script (Awk, as used in the ADB context, can be roughly viewed as the intersection of C and JavaScript).

Your input Awk script can also select a subset of input records based on their field values, and/or any global data you might have made available (there are several ways to import "global" data, such as a sales tax rate).  Awk scripts are also handy for "table look-ups."

Each record in the output file may also be "massaged" by an Awk script--in fact, the final resulting output need not resemble the output file at all (it could be a report, or some kind of summary file).

Both input files and output files can be sorted, with optional removal of duplicates.  Input files can be imported from standard DBMS in "commas-n'-quotes" format, and output files can be exported back into a standard DMBS in "commas-n'-quotes" format.

You need not have two input files (just one is enough for certain kinds of data conversion operations).

Nor need you have all three types of output files.

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

5:   You mean I can only write one output file for the records that are in one of the input files (but not the other)?  And only one output file for the records that match on a key between the two input files?  Kinda restrictive, ain't it?

ADB comes with a utility called FileMux ("file multiplexor") that takes one input file and can create mutilple output files, based on a field in the input file.  It's trivial to use.

So, for example, you could take a list of invoices and a list of customer master records . . . and generate several reports and several output files from the invoices which were successfully matched to a customer master record (based on customer number).

There's even a utility called FileStat which will return a nonzero value if a file is of nonzero length (FileStat can do many other things, but in this example, you could "bomb the job" if there were invoices that didn't have corresponding customer master records.)

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

6:  What about forms?

ADB has no user forms entry interface.  While the "D" doesn't mean "database," the "B" definitely does mean batch.  Your traditional DBMS can always be used for forms entry, or you can collect data on the web via a CGI process which dumps it into a file.

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

7:  Other than the generic commas-n'-quotes interface, is there support for Excel?  And what about specific DBMSs, such as Access, FoxPro, or Paradox?

To process an Excel file, you do have to paste it into a Windows WordPad window and save it as "MS DOS text."  From there on, ADB's Excel.Awk utility will convert it to commas-n'-quotes format, and you can then run it thorugh ADB.

Access and FoxPro as well as quite a number of other DBMSs are are handed via MS's "ODBC" interface.

In plain English, if you have a file called OSQL.Exe on your machine, that means that you can issue SELECT queries to whatever DBMS you please.

ADB has two utilities that work together to reformat that output of OSQL and turn it into commas-n'-quotes format.  That means you can write a DOS batch file to issue SELECTs (queries) against the DBMS and funnel the data directly to ADB . . . without the need to do any "pointing and clicking," or to write code that directly accesses the DBMS (and which runs the risk of causing injury to the data's integrity).

ADB's OSQL interface will even automatically generate the definitions needed to run the data through ADB, using the very same field names that are inside your DBMS.

There's no support for any other specific DBMS at the moment.

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

8:  It looks like I'll have to learn Awk to really get the most out of ADB.  And I'll have little Awk scripts all over the place, right?

Despite Awk's undeserved reputation (the joke is that "Awk" is short for "awkard"), I've personally found it to be extremely simple and flexible.

(There's a nice Awk book available, by Brian Kernighan, one of the people who developed C.  You can order it from the good folks at the Free Software Foundation: http://www.gnu.org/order/order.html).

However, with ADB's ADBAWKLIB environmental variable, you can put your shared Awk functions in one file that will always be used--in addition to the Awk functions which are specific to a particular ADB job step.

As I said earlier, Awk is essentially the intersection of C and JavaScript, so anyone who knows either language should find Awk very easy to understand.

(JavaScript programmers who don't know C will have to learn how to code C-style "[s]printf" statements.  I have a short tutorial on that in this documentation.)

Note also that ADB includes a nice utility called StrRepl that lets you design your DOS batch files in such a way that your Awk scripts' code is physically included in those DOS batch files.  This keeps things "neat", since all the code for a complex process is in one text file.

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

9:  I think I grasp the purpose of this program.  Do I have to read all this documentation?

No.

Please read the install section, follow the instructions, and then view the "cheat sheet" section.  The latter consists of just the on-line help screens.  You might also want to scan the second section ("critical facts & preview").

ADB will print its help screens into a text file if any of the command line arguments contains a question mark.  E.g., any of the following formats will work:


ADB ?
ADB /?
ADB -?

I still believe that you'll save the most time in the end by "RTFM" (reading the "fine" manual.)  If you aren't familiar with DOS, I suggest you read my DOS batch files primer and the section on ADB's utilities.

If you don't wish to do that, I hope you'll at least get through the rest of this FAQ (you're almost done).

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

10:  If I correctly understand your answers to the previous questions, there's no (built-in) report generation, no forms-based entry, no GUI interface, and no support for SQL.  I can't imagine why you wasted your time writing this.  Is there any way in which ADB can best a traditional DBMS such as Access, FoxPro, Paradox, etc.?

Yes.  Here are the "top 10."

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

11:   So, with ADB, I can throw away my compilers and my standard DMBSs?

On the contrary.

The whole point of ADB is to have a very simple interface that can help you manage the basic operations of sorting, matching, duplicate removal, and the simple "massaging" of fields.

These deceptively straightforward tasks often take up a disproportionately large amount of code in most complex applications systems.

The trick to getting the most out of ADB is to try to use the "right approach for the right (part of the) job."

Think of a traditional compiled programming language as an elaborate machine shop.  Even if you're comfortable with the machines and can run them yourself, you don't want to "go there" if all you need is a set of hand tools to change a spark plug.

Think of a DBMS as a bit like going to your friendly local automobile dealer.  There are a lot of factors that aren't under your control.  Unexpected surprises can result which could take large amounts of time to disentangle.  But if you have to have their expertise, then . . . you gotta have it!

Specifically: for those rare applications that require the full power of SQL, or for generating user forms, you might just want to stick with your DBMS.  That's why ADB has a convenient import/export facility for commas-n'-quotes format.

The same goes for reports: some DMBSs or report generating packages have wonderfully clean and elegant interfaces for building reports.  ADB could help you with some initial massaging, but perhaps your DBMS or report generator could do a better job of handling the processing needed to "break" and/or compute subtotals on several different fields.

For the parts of a complex application that require "true" random access (i.e. where you really do need to "set cursors" and/or move backwards and forwards in files), or where you need intricate and I/O-intensive processing that's done most efficiently with many input and output files being simultaneouly present . . . then you can and should continue to write code in a standard compiled language (or "4GL").

ADB and its companion utilities can handle a surprising number of your small and medium sized jobs in a clean and efficient manner all by themselves (with a little help from GNU Awk).

And by integrating ADB into your larger systems, you can simplify the design and minimize the amount of SQL and/or compiled code that you need to write, which in turn makes these systems faster and easier to debug and develop, as well as simpler to maintain.

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

12:  What about an interface for C++ and/or VB instead of Awk?  And have you considered porting ADB to Unix?

Yes, I've considered writing an interface for [V]C++--actually it wouldn't take much work to print out C-style record layouts and build a few include files with standard functions.

While I'm not a huge fan of VB, I might consider supporting it on request.

(Personally, I think VB is a woefully inefficient language by comparison to the C variants, particularly when it comes to data-intensive applications.  And the size of VB executables is often measured in the megabytes or tens of megabytes, as opposed to the corresponding C modules, which might be tens of K.  This puts tremendous unnecessary stress on WinTel OSs.  And then there's the fact that the user needs hundreds of megabytes of DLLs because new VB versions are released annually.  Although VB is faster to develop than C, it's just that what you get from the development process burns up execessive amounts of resources, which is especially bad news for NT server applications.)

A Unix port would be tricky because the FIELDWIDTHS variable in GNU Awk is nonstandard, but it's definitely the most intriguing option at this stage.

If anything, Unix users might be more receptive to ADB than WinTel users, for at least two reasons.

First, they're already familiar with Awk, but even more importantly: virtually all Unix programmers think in terms of scripts and share the Unix ideal of building complex systems with small, simple, flexible pieces . . . whereas by contrast, typical WinTel programmers have a greater tendency to favor behomoth-sized compiled executables.

Unix also makes a lot more sense for large volume (I/O-intensive) processing, due to the substantially greater underlying efficiency of the OS.

Return to local table of contents
Return to global table of contents
Frames mode, or No frames

Next documentation section