[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

5554.0. "How to pass P1,P2,P3,,, to EXPORTER" by WARABI::CHIUANDREW () Wed Sep 01 1993 04:24

    Hi,
    
    Could someone advise how to pass parameters EXPORT function from a DCL
    procedure?
    
    Customer would like to write a DCL command procedure to export 
    network entities where 
    P1=global entity (translan)
    P2=child entity  (line 6)
    P3=exported Rdb database (Mcc_export.rdb)
    P4=begin time
    P5=end time
    P6=export period
    
    Thanks in advance for help!
    
    Andrew
    
    
    I 've tried the following but MCC complaint on LINE argument
    export translan "''p1'" line f$integer('p2') export target "''p3'" -
    ,begin time = 'p4' -
    ,end time = 'p5' -
    ,export period = "''p6'"
    
T.RTitleUserPersonal
Name
DateLines
5554.1create another procedure??CTHQ::WOODCOCKWed Sep 01 1993 09:5877
Hi Andrew,

This is not a direct answer becasue I believe you would like to simply pass
parameters into a MCC process. I don't think this can be done but the 
engineeers can most likely better answer.

But a solution tactic I can provide. I do this kind of stuff all the time for
building the entire system (alarms, records, set speeds, etc...). Example, I
record attributes for 100 circuits. This equates to typing 600 lines of
RECORD commands. No-can-do. If I had to actually do this I'd be in another
business. What I do is have a command procedure WRITE ANOTHER PROCEDURE.
Here's an example. We have a configuration file which lists (line by line)
all the necessary info for creating a command. The procedure will read the
config file, extract the "parameters", then create mcc commands into another
procedure to be run.

Example:

- open config file
loop:
- read a line
- pull out all the elements needed to build command
- open mcc_procedure file
- write mcc command into mcc_procedure file
- goto loop


$ open/write procedure mcc_rpt:start_records.com
$ write procedure "$ set noon"
$ write procedure "$ manage/enter"
$ write procedure "!"
$ close procedure
$!
$ open entities mcc_rpt:mcc_config.dat
$ next_line:
$ read/end_of_file=end_build entities config_line
$ config = f$edit(config_line,"trim")
$ config :='config
$!
$!
$! GET the node name
$!
$ node = f$element(0," ",config)
$!
$!......Get the rest of the elements (circuit, domain, etc..)


$ BUILD_FILES_DNA4:
$!
$!
$!
$ open/append build mcc_rpt:start_records.com
$ write build "record node4 ''node' circ ''circuit' part=counters,-"
$ write build "keep age=14 00:00:00, poll period=1:00, in domain ''domain'"
$ write build "!"
$ write build "spawn wait 0:0:10"
$ write build "record node4 ''node' circ ''circuit' part=characteristics,-"
$ write build "keep age=14 00:00:00, in domain ''domain'"
$ write build "!"
$ write build "spawn wait 0:0:10"
$ write build "record node4 ''node' line ''circuit' part=characteristics,-"
$ write build "keep age=14 00:00:00, in domain ''domain'"
$ write build "!"
$ write build "spawn wait 0:0:10"
$ close build
$!
$ goto next_line
$!
$! etc, etc...


After running this procedure the new file mcc_rpt:start_records.com is created.
This file will enter mcc and execute all the RECORD commands. You might be able
to use this same idea with your customer.

best regards,
brad...
5554.2Another alternativeNSTG::GIUFFRIDAWed Sep 01 1993 14:2973
	Here's the method we used when we did testing for DECmcc.  It
	went something like this if I recall.  It might not be 100%
	correct but you should get the idea anyways.

	We made use of MCC's initialization feature via the MCC
	INIT file and MCC command template files.  We had command
	templates of each of MCC's functions ( ie. export, record, etc. ).

	When we wanted to execute a MCC command we invoked a generic
	EXECUTE command procedure passing it the template to be executed and
	the necessary variable information as parameters.  This 
	procedure would create a MCC initialization file defining the
	variable parameters as MCC symbols in this file and then
	invoke the command template.

	Your particular case might look something like this.

	* SAMPLE EXECUTE COMMAND PROCEDURE *

	$!
	$! EXECUTE.COM
	$!
	$! P1 = COMMAND TEMPLATE
	$! P2 = ENTITY
	$! P3 = EXPORT TARGET
	$! P4 = BEGIN TIME
	$! P5 = END TIME
	$! P6 = EXPORT PERIOD
	$!
	$!
	$! Create MCC initialization file
	$!
	$ Open/Write mccinit mcc.init
	$ Write mccinit "Define ENTITY ''P2'"
	$ Write mccinit "Define DATABASE ''P3'"
	$ Write mccinit "Define BTIME ''P4'"
	$ Write mccinit "Define ETIME ''P5'"
	$ Write mccinit "Define PTIME ''P6'"
	$ Close mccinit
	$!
	$! Copy the template file to a set filename
	$!
	$ Copy/nolog 'P1 template.mcc
	$!
	$! Define MCC init file
	$!
	$ Define/User MCC_INIT mcc.init
	$!
	$! Execute command template
	$!
	$ mcc do template.mcc
	$!
	$! Cleanup & Exit
	$!
	$ Delete/nolog mcc.init;
	$ Delete/nolog template.mcc;
	$ Exit


	* SAMPLE EXPORT TEMPLATE *

	!
	! Contents of EXPORT template file ( EXPORT.TEMPLATE )
	!
	export translan ENTITY export target DATABASE -
	    begin time = BTIME, -
	    end time = ETIME, -
	    export period = PTIME

	Then to export data you simply have to invoke the EXECUTE command
	procedure passing it the necessary information.

5554.3Thanks!WARABI::CHIUANDREWWed Sep 01 1993 20:306
    re .1 and .2 
    
    Thanks and I will try them!
    
    
    Andrew