Using conditional parsing in configuration files

You can use conditional parsing in configuration files to specify the utilities that can use the file. Conditional directives allow command parameters to be included or excluded depending on the utility using the file. The File Hiding Utility (dbfhide) can still be used to hide the contents of a configuration file when conditional parsing is used in the file.

Syntax
configuration-file= text...
text : comment | conditional | command-line-option
comment : line starting with # that is not a conditional
conditional :
#if  condition
text
   [ #elif  condition
text
   ] ...
   [ #else
   text
 ] ...
#endif
condition : { tool=utility-name[,utility-name]... | utility-name }

The following values are supported for utility-name:

dbbackup dbinfo dbltm dbstop dbxtract
dbdsn dbinit dbmlsync dbsupport mlsrv11
dbeng11 dblic dbping dbsvc mluser
dberase dblocate dbremote dbunload qaagent
dbfhide dblog dbspawn dbupgrad rteng11
dbhist dblsn dbsrv11 dbvalid
Usage

To be treated as a directive, the first non-whitespace character on a line must be #. When a utility is encountered in an #if or #elif directive, the lines that follow the directive are included until another conditional directive is encountered. The #else directive handles the condition where the utility has not been found in the preceding blocks. The #endif directive completes the conditional directive structure.

Blank spaces are not permitted anywhere within the list of tool names specified by tool=. You can nest conditional directives. If an error occurs while parsing the configuration file, the utility reports that the configuration file cannot be opened.

Example

The following configuration file can be used by dbping, dbstop, and dbvalid.

#if tool=dbping,dbstop,dbvalid
   #always make tools quiet
   -q
   -c "UID=DBA;PWD=sql;ENG=myserver;DBN=mydb"
   #if dbping
      #make a database connection
      -d
   #elif tool=dbstop
      #don't ask
      -y
   #else
      #must be dbvalid
      #use WITH EXPRESS CHECK
      -fx
   #endif
#endif