You're "EXECUTING" PROG1 from TCL, so you can invoke it in any of the
ways that you've documented below.

>From within PROG1, you're "CALLING" PROG2, it's a subroutine, so it has
to be locatable as you've so clearly documented in your example.

If you wanted to have them both run using <4> for security, then you could:
'EXECUTE "PROG2" CAPTURING CMD.CAP' from within PROG1.  If you need to
pass args you're either going to have to store them in named common or
pass them as command line args and parse them out.



On 4/10/2012 4:05 AM, Phil Walker wrote:
> Hi,
> 
> This is a contrived solution, but I have a program file BP1 and another 
> program file BP2. In program file BP1 I have a program PROG1. In program file 
> BP2 I have a program PROG2.
> 
> PROG1 is the following:
> 
>      PROG1
> 0001 PROGRAM PROG1
> 0002 CRT "IN PROGRAM PROG1"
> 0003 CRT "CALLING PROG2"
> 0004 CALL PROG2
> 0005 CRT "BACK IN PROG1"
> 0006 RETURN
> 
> PROG2 is the following:
> 
>      PROG2
> 0001 PROGRAM PROG2
> 0002 CRT "IN PROGRAM PROG2"
> 0003 RETURN
> 
> If I RUN BP1 PROG1 I get the following
> 
>> RUN BP1 PROG1
> IN PROGRAM PROG1
> CALLING PROG2
> Program "PROG1": Line 4, Unable to open the operating system file 
> "BP1.O/PROG2".
> [ENOENT] No such file or directory
> Program "PROG1": Line 4, Unable to load file "PROG2".
> Program "PROG1": Line 4, Unable to load subroutine.
> 
> This is as expected, in that Universe assumes when there is not VOC entry 
> that PROG2 is in the same OBJECT file, BP1.O.
> 
> If I CATALOG BP2 PROG2 LOCAL COMLETE
> 
>> CATALOG BP2 PROG2 LOCAL COMPLETE
> "PROG2" cataloged.
>> CT VOC PROG2
> 
>      PROG2
> 0001 V
> 0002 /tmp/BP2.O/PROG2
> 0003 B
> 0004 BN
> 0005
> 0006
> 0007
> 0008
> 0009 /tmp/BP2.O
> 
> and then RUN BP1 PROG1 I get the following
> 
>> RUN BP1 PROG1
> IN PROGRAM PROG1
> CALLING PROG2
> IN PROGRAM PROG2
> BACK IN PROG1
>>
> 
> If I CATALOG BP1 PROG1 LOCAL COMPLETE
> 
>> CATALOG BP1 PROG1 LOCAL COMPLETE
> "PROG1" cataloged.
>> CT VOC PROG1
> 
>      PROG1
> 0001 V
> 0002 /tmp/BP1.O/PROG1
> 0003 B
> 0004 BN
> 0005
> 0006
> 0007
> 0008
> 0009 /tmp/BP1.O
> 
> and then execute PROG1 I get the following
> 
>> PROG1
> IN PROGRAM PROG1
> CALLING PROG2
> IN PROGRAM PROG2
> BACK IN PROG1
>>
> 
> The same results which is still good. However what I really want to do is add 
> a security routine to both VOC entries PROG1 and PROG2. To do this I copy the 
> VOC entries to PROG1 and PROG2 to the VOCLIB file and change the VOC entries 
> to the following
> 
>      PROG1
> 0001 R
> 0002 VOCLIB
> 0003 PROG1
> 
>      PROG2
> 0001 R
> 0002 VOCLIB
> 0003 PROG2
> 
> I will see if this works first, before adding attribute 4 for the security 
> routine.
> 
>> PROG1
> IN PROGRAM PROG1
> CALLING PROG2
> Program "PROG1": Line 4, Unable to open the operating system file 
> "/tmp/BP1.O/PRO
> G2".
> [ENOENT] No such file or directory
> Program "PROG1": Line 4, Unable to load file "PROG2".
> Program "PROG1": Line 4, Unable to load subroutine.
>>
> 
> As you can see this does not work. It appears that while Universe will use 
> the contents of attribute 2 LOCAL VOC entry (the path to the object code), 
> Universe will not use the contents of  attribute 2 of the REMOTE VOC entry.
> 
> I believe this is a bug...does you agree?
> 
> For further clarification this was in IDEAL flavour.  If I change it to PICK, 
> PIOPEN it still behaves the same.
> 
> Regards
> 
> Phil
> 
> _______________________________________________
> U2-Users mailing list
> U2-Users@listserver.u2ug.org
> http://listserver.u2ug.org/mailman/listinfo/u2-users
> 

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to