

Datasets and Parameters › Datasets › Read Operating System Values into Dataset Variables › Sample Scripts for Reading Operating System Values into Dataset Variables
Sample Scripts for Reading Operating System Values into Dataset Variables
A process can use UNIX script, VBScript, or PerlScript to read operating system variables into operator dataset variables. Each script reads lines from a text file that specifies a host name, a single space, and the operating system running on the host. For example:
JAMES Windows
INDUS Linux
NILE Windows
AMAZON UNIX
YANGTZE Solaris
GILA UNIX
The three scripts save the host names to an indexed field named HostList and the operating system names to an indexed field named OSList.
The process incorporates the following steps:
- The UNIX or Windows module passes a text file name. The module gets the file name from a parameter on the appropriate Process tab of the script operator properties.
- The UNIX or Windows module creates and initializes the C2OSVD environment variable with a path to a unique folder.
One instance of a script operator uses the folder that the C2OSVD environment variable specifies. The instance is not repeated or overwritten by any subsequent instance of that or any other script operator.
- The UNIX or Windows module creates the folder that the C2OSVD environment variable references.
- The script creates folders named HostList and OSList in the folder that the C2OSVD environment variable references.
- The script reads each line of the text file and takes the following actions:
- The script writes the host names to sequentially numbered files in the %C2OSVD%\HostList folder.
- The script writes the operating system names to sequentially numbered files in the %C2OSVD%\OSList folder.
These files generate two indexed operator dataset variables HostList and OSList.
- The script writes the number of lines it read to the files to a file named %C2OSVD%/NumRowsRead.
This file generates an operator dataset variable named NumRowsRead.
Copyright © 2014 CA.
All rights reserved.
 
|
|