This Meta-Update script Approves Changes
in Status, Scheduled For Approval.
[Main] declares script arguments and usage.
[Do] introduces an
IdLog=. This is an automatic audit log CSV
of every record read or written during the run. Here, we add two columns
to the file.
[Do]'s
AssignInit decides which section will be
Launched based on the arguments given. It also initializes
a few script variables. It throws an error if no input was given.
[Do] then
Launches only one of three sections:
[Do-inp],
[Do-list], and
[Do-qry].
Each of these have an
AssignPre that sets a few variables and ends
up with a Change Request in the proper Status
in the tag:
Chg.
Each of these then
Launchs
DoUpd to add the records.
Move your mouse round the image for details.
All Meta-Update Sample Scripts have plenty of
comments. Please feel; free to take a copy and edit.
Use the debugger to single-step through the scripts.
[Main] is used to describe arguments,
set up server connections, have initial and terminating assignments,
and give usage information.
Here, we have one required argument so that we can allow the user
to specify the input using different optional arguments:
-go
Required to avoid help — all others are optional
-inp
Specifies a CSV file with a Change ID column
-qry
Specifies some Change Query text
-list
Specifies a list of Change IDs
Move your mouse round the image for details.
All Meta-Update Sample Scripts have plenty of
comments. Feel free to edit.
Use the debugger to single-step through the scripts.
[Main] is used to describe arguments,
set up server connections, do initial and terminating assignments,
and give usage information.
Here, we have one required argument so that we can allow the user
to specify the input using different optional arguments:
-go
Required to avoid help — all others are optional
-inp
Specifies a CSV file with a Change ID column
-qry
Specifies some Change Query text
-list
Specifies a list of Change IDs
Usage examples:
ChgApprov.ini   Do
-inp file_of_change_ids.csv
-NextStage
ChgApprov.ini   Do
-qry "'6' > \"04/12/2016\" and '6' < \"04/11/2016\""
ChgApprov.ini   Do
-list "CRQ_CAL_1000011, CRQ_CAL_1000006"
-NextStage
Do's
AssignInit validates arguments and decides
which section to
Launch.
Do introduces the
IdLog facility.
Move your mouse round the image for details.
[Do] — a Control Section
Before [Do] starts,
AssignInit sections are processed.
Our AssignInit,
[Do-asgInit],
initializes a few script variable in tag
V.
It then validates the arguments, setting a
V, sec to one of the three sections we'll
Launch.
Only one of
[Do]'s
three
Launches can be taken.
Move your mouse round the image for details.
[Do] specifies an
IdLog.
An
IdLog is an automatic
Meta-Update auditing facility which creates a CSV of
all records read and written from all servers and files.
You can customize an
IdLog, adding extra columns or ordering implied columns and
adding assignments.
You can customize an
IdLog, adding extra columns, ordering implied columns,
changing the events logs are produced on —
such as on errors only.
Each
Launcehd section can have new
IdLogs or new assignments to the current
IdLog.
We add 2 columns:
Err and
Msg which we set before every
Abort.