This just isn't going to work the way you are expecting it to. This is what's happening...
When your program first starts it creates a reference to all shared objects in JBCOBJECTLIST. If the subroutine being cataloged is not in any of the shared objects at that point then it will not be seen by the calling program. The only conceivable way this can work is to compile and catalog the subroutine in a separate program and then EXECUTE @IM:'k' to another program that CALLs the subroutine. If the subroutine requires arguments then they will have to be passed in the EXECUTE:@IM:'k' ***. [ *** You didn't mention the jBASE version and EXECUTE:@IM:'k' has different side effects on different major versions. ] Here is a simplistic example (using jBASE 5.2) that illustrates the process; it dynamically compiles and catalogs the subroutine TEST_SUBR. Note that the subroutine is being DECATALOG'd to ensure that it is not in any library at the onset: 0001 PROGRAM TEST_CATALOG 0002 EXECUTE "BASIC bp TEST_SUBR" 0003 EXECUTE "CATALOG bp TEST_SUBR" 0004 EXECUTE @IM:'k':"CALL_SUBR ExecuteValue" 0001 SUBROUTINE TEST_SUBR(VALUE) 0002 CRT "VALUE: ":VALUE 0003 RETURN 0001 PROGRAM CALL_SUBR 0002 CALL TEST_SUBR(SYSTEM(1000)<2>) D:\home>DECATALOG BP TEST_SUBR Object TEST_SUBR decataloged successfully Library D:\home\lib\lib0.dll rebuild okay D:\home>jsh jsh dan ~ -->TEST_CATALOG TEST_SUBR BASIC_1.c Source file TEST_SUBR compiled successfully TEST_SUBR Object TEST_SUBR cataloged successfully Library D:\home\lib\lib0.dll rebuild okay VALUE: ExecuteValue jsh dan ~ --> Dan "I don't always agree with everybody but when I do it's because I'm right." -- Unknown On Fri, Sep 12, 2014 at 10:48 PM, Elixir <[email protected]> wrote: > Hi, > > I tried to write a progrm PGM.A which generate a subroutine SUBR.B and > compile and catalog this subroutine and call this subroutine. > After compiling PGM.A, I directly executed PGM.A and I got error as below. > But executing second time will be success. > Is any possible to execute successfully at first execution? > Is any possible to put subroutine into effect without relogin jsh? > > ** Error [ SUBROUTINE_CALL_FAIL ] ** > Unable to perform CALL to subroutine SUBR.B , Line 66 , Source PGM.A > Press C to continue or Q to quit > Trap from an error message, error message name = SUBROUTINE_CALL_FAIL > 0066 CALL @Y.RTN.NAME(Y.ROUTINE,Y.ID) > > Thanks. > > > -- > -- > IMPORTANT: T24/Globus posts are no longer accepted on this forum. > > To post, send email to [email protected] > To unsubscribe, send email to [email protected] > For more options, visit this group at > http://groups.google.com/group/jBASE?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "jBASE" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- IMPORTANT: T24/Globus posts are no longer accepted on this forum. To post, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jBASE?hl=en --- You received this message because you are subscribed to the Google Groups "jBASE" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
