Operating System - OpenVMS
1753628 Members
5577 Online
108797 Solutions
New Discussion юеВ

Re: Exiting Command Procedure

 
SOLVED
Go to solution
Joseph Dellwo
Occasional Advisor

Exiting Command Procedure

I'm a newbie so bear with me.
This is probably simple but I can't find the answer anywhere. We run a program called Promis (pcl) which allows users to run .com files but otherwise they don't interact directly with VMS. I've written a Command Procedure that will then run a script back in Promis, ie:
$ pcl @hivac:HIVAC
Now they are back in Promis but my Procedure is still running.
My question is, Is there a way to issue a command and exit the procedure without having to quit Promis and return to DCL to allow the procedure to continue. Leaving it running causes problems later.
I hope this makes sense. I've attached my .com file.

Thanks, Joe
16 REPLIES 16
Aaron Lewis_1
Frequent Advisor

Re: Exiting Command Procedure

Joe, you would need to keep Promis in control of the stream of events, it should execute the DCL, then return. When you re-run the PCL script from DCL, the DCL procedure is in control, and will continue to run until the user exits from Promis, then exits from DCL.

How are calling this from Promis, does it support a 'shell' or 'spawn' command?
Jan van den Ende
Honored Contributor

Re: Exiting Command Procedure

Joe,

As a start, let me elcome you to the VMS Forum!

please rename any attachments to .COM before posting!

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Aaron Lewis_1
Frequent Advisor

Re: Exiting Command Procedure

Jan, I think you meant to say:

Please rename to .TXT before posting.
Arch_Muthiah
Honored Contributor

Re: Exiting Command Procedure

Joe,

No idea about your pcl program.

You have problem with only this .com procedure? or with all com procedure?

In this "$pcl @hivac:HIVAC", is HIVAC your .COM file?, if that is the case, you did not pass the value for P1.

When you run your .com procedure you attached, displayed any message on the terminal?

What is the "status" of your .com procedure which keeps running?

Try running small .com procedure with only one statement like
$ write sys$output f$time()
$ exit

Also I would suggest you to change the
" $ on error then goto xraise" as
" $ on warning then goto xraise"

just trial only, because no idea about your pcl program

Archunan
Regards
Archie
Arch_Muthiah
Honored Contributor

Re: Exiting Command Procedure

Joe,

I think your pcl has been designed only to run DCL procedure only. The purpose of the pcl program design may be to avoid giving direct DCL access to any user.

Btw, does your system shows that .com procedure is in "running" state or "scheduled" state.?

Archunan
Regards
Archie
Joseph Dellwo
Occasional Advisor

Re: Exiting Command Procedure

I've attached it as txt.

Thanks for your quick responses.
I've tried spawn and pipe but back in Promis I lose the command prompt. It acts like I have two things competing for my inputs.

When people login they don't even see VMS, they go straight into Promis (started with pcl). HIVAC.scr is the script which calls this file,implant.com, and passes the P1 to it. The command I mentioned in my first message was to return to Promis and run the script again so folks can select another .com file to run.
----
Just read Archunan's message.
PCL has a menu item to run "user commands" which is how my script calls my DCL Procedure. How do I check the procedure state?
Thanks, Joe
Jan van den Ende
Honored Contributor
Solution

Re: Exiting Command Procedure

Joe,


The command I mentioned in my first message was to return to Promis and run the script again so folks can select another .com file to run.


And now, the real question is, does RETURN actually mean that this CAN be returned to?
ie, is the statement before the return point some incarnation of SPAWN ( CALL LIB$SPAWN maybe?) or is it some kind of chaining (like CALL LIB$DO_COMMAND )?

If SPAWN, then replace
$ pcl @hivac:hivan
by ...
$ LOGOUT

Your description of the symptoms ARE consistent with this scenario.

A quick test would be a
$ SHOW PROC /ALL/ID=

If this shows more than 1 process in the Process Tree, I suspect this is the case.

However, DO inspect the code of the Promis program: it should be able to HANDLE a true RETURN as generated by a subprocess LOGOUT.

DISCLAIMER:
Most of this is speculation based on too little info and too little ( = NO !) knowledge of Promis, so: NO WARRANTY!!


hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Joseph Dellwo
Occasional Advisor

Re: Exiting Command Procedure

It says "There is one process in this job"
If I replace the command with Logout it logs me out of the system.

The problem is when I run this several times I'll get the "command procedures too deeply nested" message. I'm using Set Verify and if I return to Vax I see it spit out the last comands in my file then run the exit handler as many times as my file was run.

I have several points where I'd like my file to exit and run a Promis script. I'll probably have to find a workaround with some extra promis scripts. This little command file replaces about a hundred script so I'll live with this if I have to.

Thanks, Joe
Arch_Muthiah
Honored Contributor

Re: Exiting Command Procedure

Joe,

I hope the "$exit" command in your procedures makes promis to exit.

Could try this one more time, that is...
1. Remove "$exit" from the procedure

that is...
....
$ exit ------- Remove this
$ END:
$ pcl @hivac:HIVAC

and make sure all your other procedures
(@hivac:implant_ENTER2
@hivac:implant_ENTER3
@hivac:implant_ENTER4,,,etc.)
have "$ pcl @hivac:HIVAC" command at the end, and remove any "$exit" statements in these procedures.

Hope this will help to keep promise session alive.

Archunan
Regards
Archie