| Hi Sunil,
It's not very elegant is it!? This "design" has been in the product for
a long time now, and it's difficult to change it without impacting
existing applications.
The first time it is called as in the ALL-IN-1 sub-process which means
that it can access ALL-IN-1 symbols.
The second time it is called from DCL which means that it can run up
ALL-IN-1 without the /NOCUST parameter.
When I had to write one of these the first few lines were:
$! Get rename user parameters & check that we are being run from ALL-IN-1.
$! The first call is as a subprocess of ALL-IN-1 from sm_rename.scp, and
$! the second call outside of ALL-IN-1 from sm_rename.com.
$!
$! The first call will do the DCL work and collect parameters required
$! for the second call. The second call will invoke ALL-IN-1 without the
$! /NOCUST parameter.
$!
$ on error then continue
$ old_a1_username = ""
$ new_a1_username = ""
$!
$ define sys$error NL:
$ define sys$output NL:
$ write oamailbox "oa get #a1_username"
$ @dclmailbox:
$ deassign sys$error
$ deassign sys$output
$ if "''result'" .eqs. "" then goto second_time
$ old_a1_username := 'result
$!
$ write oamailbox "oa get #new_a1_username"
$ @dclmailbox:
$ if "''result'" .eqs. "" then exit
$ new_a1_username := 'result
...
$second_time:
$!
$! Invoke ALL-IN-1 without the /NOCUST parameter.
$!
$ ALLIN1/USER="''manager'"/NOINITIALIZE/REENTER/LANGUAGE='language'
oa$ini_init
...
HTH
Stuart
|