Scripts can be Parsed on the Linux platform at the command line or using a shell script inheriting the working directory and other previously established environmental settings.
- Parse, at the command line, an engine script named DB2TOHDFS that will perform near real-time replication to Hadoop HDFS.
sqdparse ./ENGINE/DB2TOHDFS.sqd ./ENGINE/DB2TOHDFS.prc ENGINE=DB2TOHDFS SHOST=MVS21 SPORT=2626 PUBNM=DB2TOHDFS THOST=localhost TPORT=9000 2>&1 | tee DB2TOHDFS.prt
Note: The last part of the command, "2>&1 | tee DB2TOHDFS.prt" causes a copy of the parser report to be displayed on the screen and also written to a file. - Shell scripts can be used to invoke the Parser in the UNIX and Linux Multiplatform environment. Shell scripts are useful for automating the Parser processing and/or for parsing several scripts within the same command. The following shell script named Parse DB2TOHDFS.sh uses the same command line from the previous example.
#!/bin/sh sqdparse ./ENGINE/DB2TOHDFS.sqd ./ENGINE/DB2TOHDFS.prc ENGINE=DB2TOHDFS SHOST=MVS21 SPORT=2626 PUBNM=DB2TOHDFS THOST=localhost TPORT=9000 2>&1 | tee DB2TOHDFS.prt
Note: The shell scripts used to parse and run Apply Engines are usually stored in what was previously described as the <SQDATA_VAR_DIR>/<your_hierarchy_here> directory, making this the "Working Directory" then allows for the relative paths to be specified for the Engine script file ./ENGINE/DB2TOHDFS.sqd, etc.