Operating System - OpenVMS
1748015 Members
4688 Online
108757 Solutions
New Discussion

Very basic question about Inquire in DCL com files

 
SOLVED
Go to solution
stephenbrayshaw
Advisor

Very basic question about Inquire in DCL com files

Hi all,

I am very new to DCL and I have a small command file.

 

The command file does what I want but once it has finished and I am back at the prompt when I go back up to run the file again I do not see what I expect to.

 

I have an inquire in the file and when I go back up I see my input for that instead of the previous command I ran.

 

Example:

 

The file is called b.com and contains:

$ SAY "Have you ensured that the system was placed into Standalone and then Shutdown?"
$ INQUIRE CONT "Continue? [Y/N]"
$ IF .NOT. CONT THEN EXIT

 

I run @b and I enter y.

When I go back through the history I get a line with y on it instead of @b how can I stop this from happening?

7 REPLIES 7
Tom Wetty
Advisor

Re: Very basic question about Inquire in DCL com files

Steve:

 

Your explanation is a bit rough for me to understand you.  However, it sounds like you are trying to recall a previous inputted command however, you are seeing only the LAST command you entered.    Try entering RECALL/ALL on the command line to see the "@B" command if you desire to enter this command instead of the answer to the inquiry.

 

Hope this helps.  Regards,

stephenbrayshaw
Advisor

Re: Very basic question about Inquire in DCL com files

Hi Tom,

 

I am able to see @b at the command prompt but it is that I do not want to see the lines I enter during the execution of the com file when scrolling back up through my history.

Tom Wetty
Advisor

Re: Very basic question about Inquire in DCL com files

Steve:

 

There is no way that I am aware of to prevent the storage of inquiry DCL commands in the command buffer.

Steven Schweda
Honored Contributor

Re: Very basic question about Inquire in DCL com files

> I am very new to DCL [...]

   That may be why you're using INQUIRE.  A Web search for. say:
      DCL INQUIRE
should find many explanations of why this is generally a bad idea
(having nothing to do with command-line recall).  For a generally
better/safer alternative, see:
      HELP READ /PROMPT

MarkOfAus
Valued Contributor
Solution

Re: Very basic question about Inquire in DCL com files

Following on from Steven:

 

$ SAY "Have you ensured that the system was placed into Standalone and then Shutdown?"
$ READ/PROMPT= "Continue? [Y/N]" sys$command CONT
$ IF .NOT. CONT THEN EXIT

 

 

John Gillings
Honored Contributor

Re: Very basic question about Inquire in DCL com files

Stephen,

 

   As they say - this is a "feature". Input into the INQUIRE command is considered command input, and so is stored in the command recall buffer. That means if your command procedure has a loop, you can recall previous inputs into subsequent INQUIRE commands. This is intentional.

 

In contrast, input into the READ command is not stored, so you have a choice as to which behaviour you prefer.

 

 As alluded to by Steven, there are some potential vulnerabilities exposed by INQUIRE. The usual advice is to use READ /PROMPT instead.

A crucible of informative mistakes
Hoff
Honored Contributor

Re: Very basic question about Inquire in DCL com files

INQUIRE is an ill-documented and potentially dangerous hunk of DCL.   INQUIRE allows the user receiving the prompt to execute — yes, execute — certain DCL code.   In the prompt.   The INQUIRE command is best left to very advanced DCL users, and — unless they're intentionally inserting a subtle backdoor — even they will generally avoid this command.    Due to the risks of this command, INQUIRE is explicitly prohibited in certain DCL procedure run-time contexts.   IMNSHO, INQUIRE should have been deprecated decades ago.  Use READ /PROMPT, as mentioned above.