//-------------------------------------------------------------------- // Example of use of VMS System Services and Run Time Library // // This module sets a DCL (CLI) symbol (using Run Time Library call) // then creates a process (using System Services call) //-------------------------------------------------------------------- main module CREATOR use VMSSTUBS // System Services Stubs use VMSTYPES // for System Services and Run Time Library use VMSPROC // for System Services and Run Time Library use SSDEF // System Services status values use RTLSTUBS // Run Time Library stubs use TEXTIO declare Symbol_Descr : descriptor Value_Descr : descriptor RTL_Status : long_integer Image_Descr : descriptor Process_Descr : descriptor Output_Descr : descriptor SYS_Status : long_integer SYS_Status_2 : long_integer My_Group = 8!103 // system is 1 My_member = 8!134 // 4 Message : packed array [1..256] of char Message_Descr : descriptor Message_Length : word_integer enddeclare // Load the string descriptor block Load_string_descriptor (Symbol_Descr, "THIS") Load_string_descriptor (Value_Descr, "REALLY_WORKS") Load_string_descriptor (Image_Descr, "LOOPER.EXE") Load_string_descriptor (Process_Descr, "LOOPER") Load_string_descriptor (Output_Descr, "LOOPER.DAT") Load_string_descriptor (Message_Descr, Message) // ---------- Set a DCL Symbol --------------------------- RTL_Status := LIB'$Set_Symbol ( Symbol_Descr , Value_Descr , LIB'$K_CLI_GLOBAL_SYM) // -------- Create the process ---------------------------- // Note: The UIC is commented out so a subprocess is created // instead of a detached process, which is too // dangerous for general testing. out_line (TTY, "Create the Process") SYS_Status := SYS'$CREPRC ( IMAGE : Image_Descr ,PRCNAM : Process_Descr /// ,UIC : UIC(GROUP :My_group,MEMBER:My_member) ,BASPRI : 4 ,Output : Output_Descr ) // Test for normal completion, print out system error message if not // Caution: VMS does not return an error if their is no such image.. if SYS_Status <> SS'$_Normal do out_line (TTY, "********* ERROR *******************") SYS_Status_2 := SYS'$GETMSG ( MSGID : SYS_Status ,MSGLEN : Message_Length ,BUFADR : Message_Descr) out_line (TTY, Message, Message_Length) otherwise out_line (TTY, "Passed") endif endmodule