source: WorldVistAEHR/trunk/r/TOOLKIT-AWCM-XD-XIN-XPAR-XQAB-XT-XUC-XUR-ZIN-ZTED/XTLATSET.m@ 1150

Last change on this file since 1150 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.1 KB
RevLine 
[613]1XTLATSET ;SF/RWF - BUILD SITE LT_LOAD.COM, LTPROT, and LT_PTR.DAT FILEs ;07/28/2005 16:41
2 ;;7.3;TOOLKIT;**11,75,90**;Apr 25, 1995
3A ;This routine sets up the files for LAT device setup
4 N EXIT,OS,DIR,XTWHEN,TX,XFIO,NODE,PORT,SPEED,Q,Y,DA,XTRM,DEV,FN,VAH
5 N CMDFN,DI,I,QUE,T,XTIO
6 I '$D(DT) S DT=$$DT^XLFDT
7 S EXIT=1 D
8 . S OS=^%ZOSF("OS")
9 . I OS["DSM" S EXIT=0 Q
10 . I OS["OpenM",$$OS^%ZOSV["VMS" S EXIT=0 Q
11 . I OS["GT.M",OS["VMS" S EXIT=0 Q
12 . Q
13 I EXIT W !!,"Not running on a VAX. Not a valid routine to run." G EXIT
14 ;
15 W !!,"This routine will build new LT_LOAD.COM, LT_PTR.DAT, TSC_LOAD.COM files"
16 S DIR(0)="Y",DIR("A")="Want to proceed",DIR("A",1)="Do not use unless you are in the startup account",DIR("A",2)="where the correct VMS files are present!",DIR("B")="No",DIR("?")="See option description"
17 D ^DIR G EXIT:Y'=1!$D(DIRUT)
18 S IO=$I,U="^",X=$S($D(DUZ)[0:"Unknown",$D(^VA(200,DUZ,0)):$P(^(0),U,1),1:"Unknown"),XTWHEN="$! This version made on "_$$NOW^XLFDT()_", by "_X
19 D GETENV^%ZOSV S VAH=$P(Y,"^",1) ;Get UCI name
20 ;Open files
21 F X=1,2,4 S FN=$P($T(OP+X),";;",2) D
22 . I VAH'="VAH" S FN=$P(FN,"]",1)_"]"_VAH_"_"_$P(FN,"]",2)
23 . S XFIO(X)=FN,TX="TX"_X
24 . D OPEN(XFIO(X))
25 . U IO
26 . D TX
27 ;Build files
28 S XTIO="_"
29 F DI=0:0 S XTIO=$O(^%ZIS(1,"C",XTIO)) Q:XTIO="" D
30 . F DA=0:0 S DA=$O(^%ZIS(1,"C",XTIO,DA)) D:DA>0 Q:DA'>0
31 . . S X=$S($D(^%ZIS(1,DA,0)):^(0),1:""),Y=$S($D(^("VMS")):^("VMS"),1:"")
32 . . I $D(^%ZIS(1,DA,90)),^(90)>0,DT'>^(90) Q ;OutOfService
33 . . D FILE
34 . . Q
35 . Q
36 ;Finish up and close
37 U 0 W !!,"The following files have been updated:",!!
38 F X=1,2,4 D
39 .W !?2,XFIO(X)
40 .D @("CL"_X)
41 .X "C XFIO(X)"
42 W !!,"To update the VMS configuration, the following COM"
43 W !,"procedures must be run on your cluster:"
44 W !!?2,"DO @"_XFIO(1) ; SYS$MANAGER:[VAH_]LT_LOAD.COM
45 W !?2,"DO @SYS$MANAGER:SYSPRINT.COM",!
46 S DIR(0)="Y",DIR("A")="Want to run them now",DIR("B")="Yes" D ^DIR
47 I Y=1 D RUN
48 ;
49EXIT K DIR,XTWHEN,TX,XFIO,NODE,PORT,SPEED,Q,Y,DA,XTRM,DEV,OS Q
50 ;
51RUN ;Run the com files
52 S CMDFN="SYS$MANAGER:LT_EXECUTE.COM" D OPEN(CMDFN)
53 U CMDFN
54 W "$! Run LT_LOAD and SYSPRINT on the cluster"
55 W !,"MCR SYSMAN"
56 W !,"SET E/C"
57 W !,"DO @"_XFIO(1) ; SYS$MANAGER:[VAH_]LT_LOAD.COM
58 W !,"DO @SYS$MANAGER:SYSPRINT.COM"
59 W !,"EXIT"
60 W !,"$EXIT",!
61 X "C CMDFN"
62 D DOCMD("PURGE "_CMDFN) ;Purge the COM file
63 D DOCMD("@"_CMDFN) ;Run the COM file
64 Q
65 ;
66OPEN(FN) ;Open file for write
67 I OS["DSM" X "O FN:NEWVERSION"
68 I OS["OpenM" X "O FN:(""NWS""):1"
69 I OS["GT.M" X "O FN:(newversion)"
70 Q
71DOCMD(CMD) ;Do a VMS command
72 W !,"Execute command: "_CMD
73 I OS["OpenM" X "S X=$ZF(-1,CMD)" Q
74 I OS["DSM" X "S X=$ZC(%SPAWN,CMD)" Q
75 I OS["GT.M" X "ZSYSTEM CMD" Q
76 Q
77 ;
78FILE ;write data for this device
79 S DEV=$P(X,U,2),NODE=$P(Y,U,1),PORT=$P(Y,U,2),SPEED=$S($P(Y,U,4)]"":$P(Y,U,4),1:9600)
80 Q:(NODE="")!(PORT="") U IO W !," setup "_$P(X,U)
81 S QUE=$S($P(Y,U,3)]"":$P(Y,U,3),1:"n")
82 S XTRM=$S($D(^%ZIS(1,DA,"SUBTYPE")):^("SUBTYPE"),1:0),XTRM=$S($D(^%ZIS(2,+XTRM,1)):+^(1),1:80) ;Get value from TT file
83 S XTRM=$S(XTRM<1:80,XTRM>511:511,1:XTRM),XTRM=$E(1000+XTRM,2,4) ;Check range 80-511
84 S XTRM=255 ;Force value
851 ;Write to LT_LOAD
86 U XFIO(1) W "create port "_DEV_" /nolog ! "_$P(X,U),!
87 W "set port "_DEV_" /app /queue /nolog /node="_NODE_" /port="_PORT,!
882 ;Write to LT_PTR
89 U XFIO(2) W QUE_XTRM_$E(DEV_" ",1,9)_$E(SPEED_" ",1,5)_" ! "_$P(X,U),!
903 ;U XFIO(3) W "$ prot "_$P(X,U,2),!
914 ;TSC_LOAD
92 U XFIO(4) W "@PR "_NODE_" "_PORT_" "_SPEED,!
93 S DA=0 Q ;Force end of loop on DA
94 ;
95OP ;File names to open
96 ;;SYS$COMMON:[SYSMGR]LT_LOAD.COM
97 ;;SYS$COMMON:[SYSMGR]LT_PTR.DAT
98 ;;place holder
99 ;;SYS$COMMON:[DECSERVER]TSC_LOAD.COM
100CL1 U XFIO(1) W "exit",!,"$ EXIT 1" Q
101CL2 U XFIO(2) W "$ EXIT" Q
102CL3 U XFIO(3) W "$ EXIT" Q
103CL4 U XFIO(4) W "$ EXIT" Q
104 ;
105TX U XFIO(X) W XTWHEN,! F I=0:1 S T=$T(@TX+I),T=$P(T,";;",2,9) Q:T="" W T,!
106 Q
107TX1 ;;$! Create and set DECserver ports
108 ;;$ SET NOON
109 ;;$ RUN SYS$SYSTEM:LATCP
110 ;;
111TX2 ;;$ This file is used as input to SYSPRINT.com
112 ;;
113TX3 ;;$ prot:= set prot=(O:rwlp,G:rwlp,W:rwlp)/device/owner=[100,1]/nolog
114 ;;$! set device protection
115 ;;
116TX4 ;;$! Create file to set DECservers for printers
117 ;;$ tsc:= run DS5CFG
118 ;;
Note: See TracBrowser for help on using the repository browser.