This is not supported. The Remote Agent does not load job database and script library and so it cannot find your user-defined statement. A workaround is to save your statement as a JAL file and include it on the Remote Agent using @SCRIPT tag, which is sort of "#include" directive in other languages. Each statement should be saved as a separate file. Of course, these JAL files should be created on the Agent. However, this can be inconvenient if you have many statements and/or they have parameters and return values. : I have a job that contains a User Defined Statement. The job runs fine : locally. The User Defined Statement functions properly. However, when I : try to run the job remotely I get "Remote job exit code -1" , : "Remote job Error!. If I comment out the User Defined Statement, the : job runs fine remotely. As a test I added the User Defined Statement to : the remote agent and comfirmed that the same job would run locally on the : remote agent. Is this function not supported remotely? Can you shed some : light on this issue. The following is a copy of the job and User Defined : Statement: //Test Job : Dim Found, boolean : Dim Ret, Number : Dim index1, number : Dim FilePath, String : Set FilePath, "C:\Source\LoadtoProduct.sem" : //FilePath is a parameter : FileExists( FilePath, Found ) : If( Found,Done,Runit) : Runit: //Create file : FileCreate FilePath : //Processing something : //Run( "c:\winnt\notepad.exe", "c:\winnt\", ret ) : ForNext( index1, 1000, 1, -1, END_LOOP ) : END_LOOP: //Delete File : FileDelete( FilePath ) : Done: Exit : //User Defined Statement : Dim file_number, number : Dim line, string : Dim CurDateTime, string : Now(CurDateTime) : Set line, " Job @V"job_name" started on @T"dddd, mmm d, : yyyy" " : Concat line, CurDateTime, line : // Open recipients file for reading line by line : FileOpen( FilePath, "LineMode", "Write", FAlSE, : file_number ) : FileWrite( file_number, line ) : FileClose( file_number ) : Sam Mills : sam_mills@es.adp.com
|