Previous | Contents | Index |
Any alphnumeric string can be used in a variable as long as it is within quotes and doesn't conflict with the date keywords described in Section 3.2.3. When a string is added to another variable element, the two elements are appended. By default the result is a string. Some example of string variable operation:
"Today's Date is " + FORMAT="DD MMMMMMMMMM" (ADATE "today") "XXX" + var1 + "YYY" newvar - "r" |
The commands in a job are run through a pre-processor searching for control instructions and variable replacement expressions before the job is created. This allows the command expressions to read and/or modify aspects of the job before it is submitted. Once this is done, a temporary command file is created and used by the job when it starts.
For example:
copy ((F1)) ((F2)) |
# report ((date today "mm/nn/yy")) 23 # |
((IF_BLANK JOB_DATA_VARIABLE)) rem Job_data_variable not set, will now exit exit ((ENDIF)) |
There are two types of variables available to the preprocessoe: GLOBAL
and LOCAL. There is also a group of built-in local variables. Any
number of additional local variables can be created. Global variables
are any variable created inside EnterpriseSCHEDULE.
3.3.1.1 Job specific local variables
A number of standard job specific local variables are available inside each job. They can be used to refer to details of the job. Some overlap exists between the three types of variables listed below.
Current settings variables - These are the characteristics of the job at the time it is being created.
Example:
$DATE = 20030911 $DAY = 11 $FULL_JOB_NAME = [BTESTDIR]TEST $HOUR = 11 $JOB_NAME = TEST $MINUTE = 27 $MONTH = 9 $P1 = $P2 = $P3 = $P4 = $P5 = $P6 = $P7 = $P8 = $RESTART = FALSE $RESTART_DOWN_COUNT = 0 $SCHEDULE_SET_ID = 100000 $SCHEDULE_SET_PARAMETER = $SCHEDULE_SET_TAG = $SET_ID = 100000 $SET_PARAMETER = $SET_TAG = $STEP = 0 $TIME = 1127 $YEAR = 2003
Current job attribute variables - Current job attribute variables are all the static job data fields for the job being submitted.
Example:
SC_ACCOUNT = SC_AFTER_DELAYED = 0-00:15:00.00 SC_CHARACTERISTICS = SC_CLI = DCL SC_COMMENT = SC_COMMENT_Q = SC_COMPLETED = TESTUSR,Mail SC_CPUTIME = Not set SC_CPU_TIME_LIMIT = Not set SC_DELAYED = TESTUSR,Mail,Broadcast SC_DISK_SPACE = "",0 SC_DISK_SPACE_Q = "",0 SC_DOWN_COUNT = infinite SC_ESTIMATED = 10,60,100 SC_EXECUTE_WINDOW = 0-12:00:00.00 SC_FAILED = TESTUSR,Mail SC_FILE = SC_FILE_Q = SC_FLAGS = Delete,NoHold,Keep,NoPrint,NoRestart,NoRetain SC_GENERAL_FLAGS = OpenVMS,History,Fixed_Set_Id SC_GF_BLOCK_RUN = 0 SC_GF_DELETE_AFTER = 0 SC_GF_FIXED_SET_ID = 1 SC_GF_NOHISTORY = 0 SC_GF_UNIX = 0 SC_GF_WINDOWS = 0 SC_JOB_NAME = SC_JOB_TAG = SC_JOB_TAG_Q = SC_LAST_COMPLETED = 11-SEP-2003 11:27:37.81 SC_LAST_START = 11-SEP-2003 11:27:31.23 SC_LAST_SUBMIT = 11-SEP-2003 11:25:08.22 SC_LOG_FILE = SC_LOG_FILE_Q = SC_MEASURED = 3,173,751,11 SC_METHOD = None SC_NAME = [BTESTDIR]TEST SC_NEXT_SUBMIT = SC_NODE = SC_NTF_COMPLETED_BRC = 0 SC_NTF_COMPLETED_MAIL = 1 SC_NTF_DELAYED_BRC = 1 SC_NTF_DELAYED_MAIL = 1 SC_NTF_FAILED_BRC = 0 SC_NTF_FAILED_MAIL = 1 SC_NTF_STARTED_BRC = 0 SC_NTF_STARTED_MAIL = 0 SC_NTF_SUBMIT_BRC = 0 SC_NTF_SUBMIT_MAIL = 0 SC_OWNER = 00070001 SC_PARAMETER = "","","","","","","","" SC_PARAMETER_Q = "","","","","","","","" SC_PLATFORM = OpenVMS SC_POST_COM_FILE = SC_PRE_COM_FILE = SC_PRINTER = SC_PRIORITY = 0 SC_PROTECTION = S:RWED,O:RWED,G:RWED,W:RWED SC_QUEUE = SYS$BATCH SC_RESIDENT_SIZE = 0 SC_RESTART_COUNT = 0 SC_RSC_445 = 0 SC_RSC_454 = 0 SC_RSC_544 = 0 SC_RSC_FRIDAY = 0 SC_RSC_MONDAY = 0 SC_RSC_MONTH_END = 0 SC_RSC_MONTH_START = 0 SC_RSC_SATURDAY = 0 SC_RSC_SUNDAY = 0 SC_RSC_THURSDAY = 0 SC_RSC_TUESDAY = 0 SC_RSC_WEDNESDAY = 0 SC_RSC_YEAR_END = 0 SC_RSC_YEAR_START = 0 SC_SF_DELETE = 1 SC_SF_ENVIORNMENT = 0 SC_SF_HOLD = 0 SC_SF_KEEP = 1 SC_SF_NOTIFY = 0 SC_SF_PRINT = 0 SC_SF_PROFILE = 0 SC_SF_RESTART = 0 SC_SF_RETAIN = 0 SC_SHELL = DCL SC_SHORT_NAME = TEST SC_STARTED = SC_STARTUP_WINDOW = 0-00:15:00.00 SC_STATUS = %x00030001 SC_SUBMITTED = SC_SUBMIT_FLAGS = Delete,NoHold,Keep,NoPrint,NoRestart,NoRetain SC_UP_COUNT = 13 SC_USER = TESTDIR SC_VERSIONS_OF_LOG = SC_WSDEFAULT = 0 SC_WSEXTENT = 0 SC_WSQUOTA = 0
Controling queue entry variables - These variables originate from the queue entry that is controlling this job.
Example:
SQ_ABORTING = 0 SQ_DELAYED = 0 SQ_ENTERED_ON = 11-SEP-2003 11:27:39.50 SQ_ENTRY = 1742 SQ_HOLD = 0 SQ_INITIATED_ON = 11-SEP-2003 11:27:39.48 SQ_NAME = [BTESTDIR]TEST SQ_PENDING_NEXT = 0 SQ_REMOTE_JOB = 0 SQ_SET_ID = 100000 SQ_SET_PARAMETER = SQ_SET_TAG = SQ_STEP = 0
The command list searches for appropriate tokens to substitute or evaluate. As each line is completed it is output to the command file or script.
Each instruction to be processed is defined as:
(( xxxxx )) |
The "((" and "))" delimit the text that is to be replaced by the token
"xxxxx". The token can be control instructions or values to look up.
The "((" and "))" and all material in between are replaced by the
evaluation.
3.3.2.1 General rules
The general rules of syntax are:
There are two type of variables:
Global - those that are in the EnterpriseSCHEDULE database.
Local - those that are only present for the duration of the pre-processing.
There is also a set of job specific local variables (see Section 3.3.1.1. Additional local variables can be created using the SET command described below.
(( name_of_variable )) |
In a command file this is any variable known to the EnterpriseSCHEDULE system. If it is the same directory as the job, the path portion of the name can be left off.
For example:
(( TEST_VARIABLE_1 )) (( /SYS/FRIDAY )) (( [MASTER]CONTROL_DATE )) (( \SP\START_FLAGS )) (( SC_NAME )) (( $P1 )) |
When creating array variables, the variable name is computed using a DO loop counter and then treated in the same manner as a SINGLE variable.
Example:
(( name_of_variable_in_heap_!4ZL )) |
"_!4ZL" (or any numeric fao formating code can be used) is evaluated using the name string as a formatting string to the fao service with the do counter as the variable.
3.3.5 Job Command Examples
The following examples illustate the syntax for commands within jobs.
((COMMENT)) comment ((ENDCOMMENT)) |
((COMMENT)) This is the headcommand and will not be written out ((ENDCOMMENT)) |
((! comment )) |
((!This is a command and will not be written out)) |
((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)) |
((IF_ZERO COUNT))All finished((ENDIF)) |
(( IF_NOT_BLANK /MASTER/FILE_NAME *)) EXEPROC ((/MASTER/FILE_NAME)) (( ELSE *)) ECHO No master file specified! (( ENDIF *)) |
((IF_EQUAL MODE "TEST_MODE)) Skipping the job ((ENDIF)) |
((SET variable value)) |
((SET CONTROL_FLAG "START_NOW" *)) |
((DO max_count_variable)) ... ((ENDDO)) |
((DO 4))X((ENDDO)) |
((SET A_0000 "ONE")) ((SET A_0001 "TWO")) ((DO 2)) ((A_!4ZL)) ((ENDDO) |
ONE TWO |
((DATE [date_expression] [date_format])) |
((DATE TODAY "DD/NN/YY")) or ((DATE)) |
"DD/NN/YY" 1/10/03 "DD-MMMMMMMMM-YYYY" 1-October-2003 "MMMMMMMMMBDD,YYYY" October 1, 2003 "WWWWWWWWWW" Wednesday" "TTTTTTTT" 12:04:45 "WWWWWWWWWWBTTTTT" Wednesday 12:04 |
Date String | Description |
---|---|
A | Each A is replaced by an alphabetic character from the field's contents. All others are replaced with an asterisk. |
B | The letter B is replaced by a blank at that position. |
D | Each D is replaced by the corresponding digit of the day of the month. DD is recommended. |
E | Each E is replaced by the corresponding digit of the day of the month. Includes leading blanks. |
F | Each F is replaced by the corresponding digit of the day of the month. Includes leading zeros. |
J | Each J is replaced by the corresponding digit of the Julian date. JJJ is recommended. |
L | A L placed at the left of an edit string will cause the field to be left justified. |
M | Each M is replaced by the corresponding letter of the name of the month. An edit string of M(9) prints the entire name of the month. |
N | Each N is replaced by a digit of the number of the month. NN is recommended. |
O | Each O is replaced by a digit of the number of the month. Skip leading blanks. |
Q | Each Q is replaced by a digit of the number of the month. Including leading zeros. |
P | P for PM. Nothing for AM. |
U | Time of day using 12 hour clock. |
Y | Each Y is replaced by the corresponding digit of numeric year. YY or YYYY is recommended. |
T | Each T is replaced by a character of the time. The time is displayed as HH:MM:SS.DD. |
W | Each W is replaced by the corresponding letter from the name of the day of the week. An edit W(9) prints the entire name. |
X | Each X is replaced by one character from the SYS$ASCTIM representation of the date |
, | A comma will be inserted at that position. |
. | A period will be inserted at that position. |
- | A dash will be inserted at that position |
/ | A slash will be inserted at that position. |
((INCLUDE name_to_include_from [a1 ... a9])) |
((INCLUDE MY_CONTROL_JOB 12 xyz)) |
%%argument_number%% |
%%1%% %%2%% |
((INCLUDEFILE file_name_to_include [a1 ... a9])) |
((INCLUDEFILE MYFILE 12 xyz)) |
%%argument_number%% |
%%1%% %%2%% |
((SYMBOLS)) or ((SYMBOLS format_string)) |
((SYMBOLS "$%s == ""%s""")) |
Previous | Next | Contents | Index |