Abinitio Commands
Abinitio Commands
Abinito provides various m_* commands for performing data manipulation. These commands will be useful for debugging the data problem. Abinito is mostly used in Unix environment all these M_* commands can be used from the command prompt.
m_dump:
Purpose: This command is used to print information about data records, their record format, and the evaluations of expressions. This command can be used to check whether data file is good and is according to dml specified. These commands are very useful to debug the output and reject files directly from the Unix machines without using the Abinitio GDE. m_dump command without any options will not be useful for a huge file, instead using the start and end option to got to a specific record will be useful. Syntax:
This command displays records starting from 5th row to 9th row in xyz.dat file:
$ m_dump xyz.dml xyz.dat -start 5 -end 9
m_eval:
Purpose: This command is used to evaluate DML expressions and displays their derived types. This command can be executed from Shell or used inside the GDE for validation purpose. Syntax:
"20041130"
m_wc:
Purpose: This command is used to count number of records from one or more data files/multi files. Syntax:
m_env:
Purpose: This command is used to obtain all the Ab Initio configuration variable settings in an environment. This command will be useful to get Abi environment variable values. Syntax:
m_env [-describe]
Examples:
m_env Current Configuration Variable Settings for Ab Initio: Variable Set Value or Resulting Action -------------------- --- -------------------------------------------AB_AIR_BRANCH <unset> AB_WORK_DIR * /var (from environment)
m_kill:
Purpose:
This command is used to kill a running job. The command blocks until it can verify that the job is killed or after AB_TIMEOUT seconds, whichever comes first. This command will be useful incases when jobs were started accidentally. Syntax:
Output: Failed opening recovery file /a1004/home/test/LVLTdw/f2c/bin/f_so_line_work_F2CMART.rec: No such file or directory [1] + Done(4) nohup f_so_line_work_F2CMART.ksh &
m_rollback:
Purpose: This command is used perform a manual rollback incase of any Abinito job failure. It may not always be possible for the Co>Operating System to restore the system to an earlier state. For example, a failure could occur because a host or its native operating system crashed. In this case, it is not possible to cleanly shut down flow or file operations, or to roll back file operations performed in the current phase. In fact, it is likely that stray files (intermediate temporaries) will be left lying around. Syntax:
Create the data and partitions directory to keep the data and control files. Execute the m_mkfs command from the data directory to create the multifile system.
m_mkfs
Purpose: This command is used to create a multifile system. Multifile system consists of Control file directory along with the partitions directory. Control file resides in the $APPL_DATA/mdata directory and data files in partitions directories. Depending upon number of partitions multifile system will be created. Syntax:
Examples: This command will create a multifile system with 5 way partitions.
m_mkfs $/EXPORT/HOME/TEST/DATA/mdata \ $/EXPORT/HOME/TEST/DATA/partitions/0 $/EXPORT/HOME/TEST/DATA/partitions/1 $/EXPORT/HOME/TEST/DATA/partitions/2 $/EXPORT/HOME/TEST/DATA/partitions/3 $/EXPORT/HOME/TEST/DATA/partitions/4 \ \ \ \
Multifile Commands:
Working with multifiles will be similar to regular files, by adding a prefix of m_<command> most of the regular operations can be carried out. Following are the frequently used commands used with the multifiles.
Command m_mv m_rmfs m_rm m_chmod m_touch m_cp Syntax m_mv source_path1.. dest_path m_rmfs path m_rm url [url ...] m_chmod mode url [url ...] m_touch url [url ...] m_cp source_file_url1.. dest_url Purpose Similar to unix move commad to move files from one location to other To remove the multifile system Similar to Unix rm command to removes multifiles or files. Similar to Unix chmod to provide permissions to multifiles Similar to Unix touch command to create a empty multifiles Similar to Unix Copy command to create copies of multifiles
m_db
This command is used for performing database operation from the command prompt. Following are the various m_db commands that are used frequently.
Command Syntax Purpose To Unloads data from database table, select or expression to stdout. Eg: m_db unload mydb.dbc -table 'fred.mytable' To truncate a table. Used to generate appropriate metadata(dml) for the table/insert/select or expression. This is very useful command for generating dynamic dml. Eg: m_db gendml mydb.dbc -table 'fred.mytable' Used to generate a load control file based on the DML supplied Runs diagnostic tests against your database for the dbc file specified. This command can be used to check db connections from wrapper scripts Loads data to a database table or insert statement from st
m_db unload dbc_file -table tablename m_db truncate dbc_file -table tablename
m_db gendml
m_db gendml dbc_file -table tablename m_db genctl dbc-name\ -dml 'metadata-string' -table tablename \ -component name
m_db genctl
m_db test dbc_file m_db load dbc_file -dml 'metadata-string' -table tablename