OSI/MHS Management Programming Manual

Examples
OSI/MHS Management Programming Manual424824-001
C-24
SPI Example in TAL
? PAGE "zMHS Example"
-------------------------------------------------------------
--
-- Main - main program
-- Open terminal file
-- Process startup sequence
-- Open $ZNET process
-- Get user input of the MHS manager name
-- ADD MTA #MTAX, ... object with valid attributes ..
-- LISTOBJECTS NULL
-- Close all the opened files
--
-------------------------------------------------------------
PROC zMHS^Example MAIN;
BEGIN
-- Get terminal name and open terminal.
CALL MyTerm ( Term^Name );
CALL Open ( Term^Name, Term^Fn );
IF <> THEN CALL Abend;
-- Process the startup sequence.
CALL Startup;
-- Open SCP as the management process.
FS^Error := Open^SCP;
IF (FS^Error = 0) THEN
BEGIN
-- Get OSI/MHS manager name from terminal.
CALL Get^MHSMGR^Name;
-- ADD MTA object
RetCode := Add^MTA;
IF (RetCode = zCom^Err^OK) THEN
-- LISTOBJECTS NULL
RetCode := ListObj^Null;
END;
-- Close $ZNET.
CALL Close ( SCP^Fn );
-- Close the terminal file.
CALL Close ( Term^Fn );
-- Inform the user of overall success
IF RetCode = zCom^Err^OK THEN
BEGIN
Write^Term ( "Progam successfully completed" );
END
ELSE
BEGIN
Write^Term^With^Num ( "Program encountered error", RetCode );
END;
END; -- proc zMHS^Example