1752337 Members
5674 Online
108787 Solutions
New Discussion юеВ

dcl coding error

 
adarsh_4
Frequent Advisor

dcl coding error

i have just recently started working with vms. i have written a dcl program but it given a error, can someone please help me here.
$ SET PROC/PRIV=ALL
$ SET NOON
$ GET_NAME:
$!
$ INQUIRE NAME "Enter Username Or Exit =>"
$ IF NAME .EQS. "EXIT" THEN GOTO END_LOOP
$!
$ MC AUTHORIZE
$ MODIFY/FLAGS=DISPWDHIS 'NAME'
$ MODIFY/FLAGS=DISPWDDIC 'NAME'
$!
$ GOTO GET_NAME
$!
$ END_LOOP:
$ WRITE SYS$OUTPUT "WELL DONE"
$ EXIT

I cant seem to change the flag
3 REPLIES 3
Steven Schweda
Honored Contributor

Re: dcl coding error

> $ SET PROC/PRIV=ALL

> $ INQUIRE [...]

Not a good combination:

http://h71000.www7.hp.com/wizard/wiz_2216.html

Using READ on SYS$COMMAND is safer.

> $ MC AUTHORIZE
> $ MODIFY/FLAGS=DISPWDHIS 'NAME'
> $ MODIFY/FLAGS=DISPWDDIC 'NAME'

I'd expect some error messages here, which
you ought to have included.

"$ MODIFY" is treated as a separate command.
Remove the "$" to let AUTHORIZE read it.

But that won't work as you wish, because DCL
will not substitute 'NAME' that way.

You could say things like:

$ MCR AUTHORIZE MODIFY/FLAGS=DISPWDHIS 'NAME'

DCL will substitute 'NAME' that way.

Many other things are possible, too, like
writing a temporary file with the "MCR
AUTHORIZE" command and the actual AUTHORIZE
commands (like MODIFY) in it.
adarsh_4
Frequent Advisor

Re: dcl coding error

thanks man, it worked out. thanks once again. this forum is good
Hein van den Heuvel
Honored Contributor

Re: dcl coding error

So give some HP 'points'.
He loves to hate them. :-)
And consider 'closing the topic'.

btw... OpenVMS users don't do exit/bye/quit.
And they most certainly can not be bothered with uppercase/lowercase.
They just hit ^Z (control-Z) or

So at least change to:
$ IF NAME.EQS."" .OR. F$EDIT(NAME,"UPCASE").EQS."EXIT"....

Be sure check out READ/END and ON ERROR

Add don;t just SET PROC/PRIV without restting.
Check ot $HELP LEXI F$SETPRV return_value

Other then that it is just fine... :-)

Cheers,
Hein

( 0 points for this! )