Knowledge Base > Automation Engine and Target Systems > BS2000 > BS2000 Operating System Command

BS2000 Operating System Command

The creation, forming up and processing of a data sequenceAn internal listing of Console outputs or lines of Variable objects, etc. The lines of a data sequence can be accessed by using a PROCESS loop or the script element GET_PROCESS_LINE. The script elements PREP_PROCESS* generate data sequences. is a complex process whereby scriptA particular Automation Engine object type. functions and statements, as well as special objects, cooperate closely.

The following example shows the necessary definitions for the involved objects and the corresponding script statements and their reference.
The example is kept small and clear to show the principles. It demonstrates how a BS2000 Command is executed from a jobAn Automation Engine object type for a process that runs on a target system. and how the result is written line-by-line to the job's activation reportA report provides more detailed information about a task's execution or a component..

 

Job: SC.PROCESS.BS2000CMD

The script of the job calls the functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… PREP_PROCESS which prepares the processing of the data sequence. The following parameters are passed:

The job EVENT.BS2000CMD will then be started.

 

Job: EVENT.BS2000CMD

This is the job EVENT.BS2000CMD from client 0000 supplied by default.

It is important that in its Attributes tab, the check box "Attribute dialog" is checked. That way, the Include objectAn Automation Engine object type for a script that is frequently used in more than one object. ATTRDIA.BS2000 is read which normally causes the start of the Attribute Dialog.

 

Include: ATTRDIA.BS2000

All attributes listed in the script of the Include can be supplied. The Attribute Dialog is not displayed because passing of the variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. contents is done internally.

 

Job: EVENT.BS2000CMD

Now the job can log on and the console command can execute.

The outfile is transferred to the Automation EngineThis component drives an Automation Engine system and consists of different types of server processes. by using the file transferTransfers files from one computer to another. A particular Automation Engine object type (FileTransfer object). and is then available as a data sequence. The execution of the job EVENT.BS2000CMD is completed.

 

Job: SC.PROCESS.BS2000CMD

The function PREP_PROCESS returns a value which is a handle for information on the data sequence that will be processed.

This value is passed to the statement :PROCESS as a start parameter. :PROCESS and :ENDPROCESS then form a processing loop which in this case, will be cycled until the end of the data sequence is reached. During each iteration, a new line of the data sequence is fetched from the memory. The function GET_PROCESS_LINE can retrieve the contents of the current line by using the current value.

In the example, the current console line is written to the activation protocol.

The :STOP statement interrupts the execution and displays the activation report.

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH