A variety of constructs may be used in preprocessing that enable such constructs as comments, IF-ELSE statements, Includes and set statements. These are described in this section.
Comments - A block of COMMENTS can be placed anywhere. Any text within a comment is not written to the output.
((COMMENT)) comment ((ENDCOMMENT))
Example:
((COMMENT))
This is the command and will not be written out
((ENDCOMMENT))
An alternate form for a comment is:
((! comment ))
Example:
((!This is a command and will not be written out))
Includes
Job content can be redirected to another job using the following syntax.
((INCLUDE name_to_include_from [arg1] [arg2] ... [arg9]))
((INCLUDEFILE file_to_include [arg1] [arg2]... [arg9]))
The specified name is passed to the provide routine for evaluation. The entire line on which this statement appears is replace by allthe contents of the specified file (or object). The INCLUDE statement should appear on a line by itself.
During the include processing the special character sequences %%n%% are replaced by the corresponding ARGn value, if present.
For example:
((INCLUDE job1 11 bb))
In job1 the following substitutions are made:
%%1%% is replaced by 11
%%2%% is replaced by bb
IF Statement - An IF section can delineate conditional statements.
The variations are:
((IF_BLANK variable)) ... ((ELSE)) ... ((ENDIF))
((IF_NOT_BLANK variable)) ... ((ELSE)) ... ((ENDIF))
((IF_ZERO variable)) ... ((ELSE)) ... ((ENDIF))
((IF_NOT_ZERO variable)) ... ((ELSE)) ... ((ENDIF))
((IF_EQUAL variable variable)) ... ((ELSE)) ... ((ENDIF))
((IF_NOT_EQUAL variable variable)) ... ((ELSE)) ... ((ENDIF))
In all places where the word variable appears above an expression can alternately be used. For example:
((IF_ZERO ABC-1))ABC is actually a 1((ENDIF))
In this example, the words "All finished" be written to the output file only if the count is zero.
Example:
((IF_ZERO COUNT))All finished((ENDIF))
Example:
(( IF_NOT_BLANK /MASTER/FILE_NAME *))
EXEPROC ((/MASTER/FILE_NAME))
(( ELSE *))
ECHO No master file specified!
(( ENDIF *))
In the EQUAL conditions the variable can be either a symbol name or a string constant as in "ssss".
Example:
((IF_EQUAL MODE "TEST_MODE")) Skipping the job ((ENDIF))
SET Command - A SET command will create or modify a local variable. Local variables only exist for the duration of the preprocessing.
((SET variable value))
Example:
((SET CONTROL_FLAG "START_NOW" *))
This will set a variable and the "*" will prevent this line from creating a blank line in the output.
Preset DO loop - A DO section repeats the number of times indicated by the control variable.
((DO max_count_variable)) ... ((ENDDO))
Example:
((DO 4))X((ENDDO))
This example will result in the string "XXXX" to be written out.
((SET A_0000 "ONE"))
((SET A_0001 "TWO"))
((DO 2))
((A_!4ZL))
((ENDDO)
This simple example produces the following result:
ONE
TWO
Dates - A date can be inserted directly without referencing a Date Expression variable as follows:
((DATE [date_expression] [date_format]))
Example:
((DATE "TODAY" "DD/NN/YY")) or ((DATE))
The Date expression can be a variable name or a string constant that follows the rules for either absolute or delta time expressions.
Frequently used data formats are:
"DD/NN/YY" 1/10/09
"DD-MMMMMMMMM-YYYY" 1-October-2016
"MMMMMMMMMBDD,YYYY" October 1, 2016
"WWWWWWWWWW" Wednesday"
"TTTTTTTT" 12:04:45
"WWWWWWWWWWBTTTTT" Wednesday 12:04
((include [default]protoi_banner_variable_check))
$ vfm=f$verify(1) ! 'f$verify(0)'
$! THESE COMMANDS WILL ENABLE A USER TO RUN A Pro C PROGRAM. THE PARAMETERS $! FROM THE JOB ARE FED INTO THE JOB PROMPTS IN BATCH MODE.
$!
((if_blank TESTMODE))((set T ""))((else))((set T "!"))((endif*))
$!
((if_blank DATABASE_NAME*))
$! You are pointed to the Database "TEST".
((else*))
$! You are pointed to the Database "((DATABASE_NAME))".
((endif*))
$!
$((T))@((ORA_PATH))ORAUSER ((if_blank DATABASE_NAME))TEST((else))((DATABASE_NAME))((endif))
$!
$!
$ DO_PROC:
$((T)) IF F$SEARCH("((EXE_PATH))FURAPAY.EXE") .NES. ""
$((T)) THEN
$!
$ ((if_not_blank T)) TYPE SYS$INPUT /OUT=NL: ((else)) ((RUNPROC)) ((EXE_PATH))FURAPAY ((USERNAME))/((PASSWORD))((endif))
$!
$((T)) ELSE
((if_blank T))$! ****** Unable to find executable for ((SC_NAME)) ******
((endif*))
$((T)) ENDIF