8. Parms, DOS Environmental Variables, Return Codes, and Files.

This section describes ADB's command-line parameters, DOS environmental variables, files and file naming conventions, return codes, and the other miscellaneous information that one might expect to see in a Unix-style man entry.

All of this information has already been presented in other parts of the documentation, and virtually all of it is listed in ADB's on-line cheat sheet.

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:  DOS Environmental Variables

2:  Command-line parms (arguments) that are associated with files

3:  Command-line parms (arguments) that are NOT associated with files

4:  Relationship between data files in the definitions, and those on the command line

5:  The special "-OUTDFLT" parm

6:  ADB system files

7:  ADB return codes and warnings

8:  Redundant note on control panel settings


1:  DOS Environmental Variables

Only ADBPROJ is required; the rest are optional.)

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

2:  Command-line parms (arguments) that are associated with files

Most of ADB's command line parameters are associated with files.

All ADB's parameter names are processed case-INsensitively.

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

3:  Command-line parms (arguments) that are NOT associated with files

There are only three of these.

Code "-P" on the command line if you want to "pretty print" the field layouts to the log file.

Code "-Q" on the command line if you want to eliminate the "echoing" of all log file info. to standard error.  This is useful for batch files that will be run by "end-users."  That way, their attention span is used sparingly, and they'll be more likely to notice your error messages.

Code "-LAXPRE" if you want "basic" preprocessing (in which fields are aligned and any DOS Control-Z is stripped) to also pad "short" records in input files with spaces.

You do need to make absolutely sure that you have the correct input file names; ADB has no way of knowing that a file has precisely the layout that you've designated (other than by validating record lengths.)

ADB always issues a warning message whenever -LAXPRE is coded.  That means that the return code is always 1.

As with the other command line arguments, the names of these arguments are processed case-INsensitively.

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

4:  Relationship between data files in the definitions, and those on the command line

Each input or output data file has an "intuitively obvious" relationship to the specifications in the definitions files.

If you code the -M-T parm, the master input file must also be specified on the command line.  It's okay if there's no trans file.

If you code the -T-M parm, the master input file must also be specified on the command line. &nbps;It's okay if there's no master file.

If you code -M&T, then both the master and trans file must be specified on the command line.

It's illegal to code either -MAST or -TRANS on the command line without at least one output data file parm (-M-T, -T-M, or -M&T).

If a particular data file is coded on the command line, the specification for it must exist in the layout files.

However the reverse isn't true: you're merely warned if an input or output data file is described in layout files, but not specified on the command line.

It's legal to have no data files specified on the command line; this is useful for printing the file layouts with the -P parm, or simply for validating them to ensure that you have the proper syntax.

In fact, you can run ADB with no command line parms whatsoever if you just want to do a "syntax check" on the file layouts in the global definitions file.  Careful programmers may wish to include such a step at the beginning of every ADB job.

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

5:  The special "-OUTDFLT" parm

The -OUTDFLT parm can save you a lot of coding.

If a field in the output file is not in the master file or the transaction file, then this field will be filled with the default.  If the field is a character or special field, it'll be initialized to spaces.  If it's a numeric field, it'll be set to zero.

If a field appears in the master file, but not the transaction file, it will be initialized with the master file value ... for the M-T or M&T output files.

If the field appears in the transaction file, but not the master file, it will be initialized with the transaction file value ... for the T-M or M&T output files.

If a field appears in both files, it will be initialized with the master file value, for the M&T output file.

The effect of the -OUTDFLT parm can be overridden (on a per-field basis) in your I/O layouts: it's just available to you, in the event that you wish to make your code shorter.

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

6:  ADB system files

These are the files that are automatically created and/or maintained by ADB.

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

7:  ADB return codes and warnings

ADB returns 0 for a successful execution, 1 if there are warnings, or 2 for catastrophic errors (i.e. the job "bombed").

ADB issues warnings only in three cases:

1. An input field is being moved into a shorter output field.

2. You've coded "-LAXPRE" and/or short records have actually been padded with spaces.

3. An output file exists already, and is being overwritten.

In certain rare situations, warnings of the first and second type are "normal."  There's currently no way to suppress them, however.

There's no reason why you should get a warning of the third variety, if you're using the utility FileStat.

When ADB bombs the job on a catastrophic error, it doesn't "clean up" any temporary files which are currently in use.

This allows you to inspect the files' contents in order to track down the source of error messages. You can also use this facility to test your Awk scripts (by deliberately introducing a syntax error).

If ADB ends with a catastrophic error, it will print the error message on the screen and into both the log and error files.

Normally catastrophic errors are described in the log file as:


USER ERROR

If you see this, the next few lines will explain why ADB felt that the error wasn't its fault.

If you get an error that ADB describes as:


INTERNAL ERROR
in the log file, then then please write to me at:
rog@NOSPAM_rs-freeware.org.

(Internal errors indicate that there's a bug in the code, and/or in the way in which errors are being detected and/or processed.)

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

8:  Redundant note on control panel settings

(I already explained this in the install, but I want to make sure it's not neglected.)

For Windows 9x, 2000, and NT PCs, go to the system icon in your control panel, and click on the performance tab.

Click on advanced settings, and then the troubleshooting tab.

Check on the box that says "disable write-behind caching for all drives".

(Note: I'm not 100% sure that this step is necessary, but I've seen DOS batch applications behave oddly without this setting on some versions of 95.)

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

Next documentation section