*DECK CSESTS
USETEXT TEXTOV
USETEXT TEXTCS
USETEXT TEXTSS
USETEXT TXTAPSS
USETEXT TXTSMCS
PROC CSESTS;
# TITLE - SEND TERMINAL STATUS #
BEGIN
#
** CSESTS - SEND TERMINAL STATUS.
*
* D.K. ENDO 82/03/16
*
* THIS PROCEDURE FORMATS THE TEXT REPORTING TERMINAL STATUS FROM THE
* INCOMING SM, AND SEND IT OUT.
*
* PROC CSESTS
*
* ENTRY 1. STU/TE/U, STU/TE/N, OR MSG/TE/A SM.
*
* EXIT 1. ENTRY IN CONNECTION QUEUE WITH STATUS TEXT.
* 2. ENTRY IN OPERATOR RESPONSE QUEUE W/STATUS TEXT.
*
#
#
**** PROC CSESTS - XREF LIST BEGINS.
#
XREF
BEGIN
PROC CSESLE; # SEND LOG (FILE) ENTRY #
PROC SSBSBF; # STORE BIT FIELD #
FUNC SSDCAD U; # CONVERT ASCII TO DISPLAY CODE CHARACTER #
PROC SSTAQE; # ADD QUEUE ENTRY #
FUNC XCDD C(10); # CONVERT DECIMAL INTEGER TO DISPLAY CODE #
FUNC XCHD C(10); # CONVERT HEX INTEGER TO DISPLAY CODE #
END
#
****
#
DEF TC$3270 # 18 #; # NUMERICAL VALUE FOR TC OF 3270. THIS #
# IDENTIFIES THE LAST TC BEFORE THE USER#
# TYPE TC-S. #
DEF TC28$DIS # 9 #; # USER TC28 DISPLACEMENT IN TC TABLE #
DEF TMS$TXTL # 60 #; # CHARACTER COUNT OF STATUS MESSAGE TEXT #
DEF UNA$CMDL # 50 #; # CHARACTER COUNT OF UNACTIONED CMD TEXT #
DEF MNS$TXTL # 40 #; # CHARACTER COUNT FOR MSG NOT SENT TEXT #
ITEM CNST1; # CONSTANT ---> 1 #
ITEM CNST2; # CONSTANT ---> 2 #
ITEM CNST3; # CONSTANT ---> 3 #
ITEM I; # LOOP INDUCTION VARIABLE #
#
THIS ARRAY DEFINES THE BUFFER WHERE THE NAME OF THE CURRENT
DEVICE IS SAVED.
#
ARRAY CRNT$TNM [00:00] S(1);
BEGIN
ITEM CRNT$TRM C(00,18,07);
END
#
THIS ARRAY IS USED AS A TEMPORARY FOR CHARACTER STRINGS TO BE
PLACE IN THE TEXT CURRENTLY BEING BUILT.
#
ARRAY CTEMP$WORD [00:00] S(1);
BEGIN
ITEM CTEMP C(00,00,10);
ITEM UTEMP U(00,18,42);
ITEM CTEMP1 C(00,54,01);
ITEM CTEMP2 C(00,48,02);
ITEM CTEMP3 C(00,42,03);
ITEM CTEMP7 C(00,18,07);
END
#
THIS TABLE CONTAINS THE POSSIBLE DT VALUES THAT THE NUMERIC VALUE
WILL MAP INTO.
#
DEF MX$DT # 07 #;
ARRAY DT$TABLE [00:MX$DT] S(1);
BEGIN
ITEM DT$VAL C(00,00,03) = ["CON",
"CR ",
"LP ",
"CP ",
"PL ",
"A-A",
"A-A",
"DT7"
];
END
#
THIS ARRAY DEFINE THE -MESSAGE NOT SENT- TEXT.
#
ARRAY MNS$TXT [00:00] S(4);
BEGIN
ITEM MNS$NPU C(00,00,05) =["NPU: "];
ITEM MNS$NNM C(00,30,07);
ITEM MNS$MNS C(01,12,18) = [", MESSAGE NOT SENT"];
ITEM MNS$ZBYT I(03,00,60) = [0];
END
#
THIS TABLE CONTAINS ALL THE POSSIBLE STATUS THAT A DEVICE CAN HAVE
#
DEF MX$ST # 5 #;
ARRAY ST$TABLE [01:MX$ST] S(1);
BEGIN
ITEM ST$VAL C(00,00,02) = ["NC",
"DI",
"DN",
"EN",
"AC",
];
END
#
THIS TABLE CONTAINS ALL THE POSSIBLE TERMINAL CLASSES A DEVICE CAN
BE.
#
DEF MX$TC # 22 #;
ARRAY TC$TABLE [00:MX$TC] (1);
BEGIN
ITEM TC$VAL C(00,00,05) = ["UNK ",
"M33 ",
"713 ",
"721 ",
"2741 ",
"M40 ",
"H2000",
"X364 ",
"T4014",
"HASP ",
"200UT",
"714X ",
"711 ",
"714 ",
"HPRE ",
"734 ",
"2780 ",
"3780 ",
"3270",
"TC28 ",
"TC29 ",
"TC30 ",
"TC31 "
];
END
#
THIS ARRAY DEFINES THE TEXT OF THE TERMINAL STATUS MESSAGE
FORMATTED BY THIS PROC.
#
ARRAY TMS$TXT [00:05] S(1);
BEGIN
ITEM TMS$TIM C(00,00,10);
ITEM TMS$TRM C(01,00,06) = ["TERM: "];
ITEM TMS$TNM C(01,36,07);
ITEM TMS$C1 C(02,18,01) = [","];
ITEM TMS$ST C(02,24,02);
ITEM TMS$C2 C(02,36,01) = [","];
ITEM TMS$DT C(02,42,03);
ITEM TMS$S1 C(03,00,01) = ["/"];
ITEM TMS$TC C(03,06,05);
ITEM TMS$C3 C(03,36,01) = [","];
ITEM TMS$HN C(03,42,03);
ITEM TMS$C4 C(04,00,01) = [","];
ITEM TMS$LNM C(04,06,07);
ITEM TMS$S2 C(04,48,01) = ["/"];
ITEM TMS$A1 C(04,54,02);
ITEM TMS$S3 C(05,06,01) = ["/"];
ITEM TMS$A2 C(05,12,02);
ITEM TMS$ZBYT U(05,24,36) = [ 0 ];
END
#
THIS ARRAY DEFINES THE TEXT FOR -UNACTIONED COMMAND-.
#
ARRAY UNA$CMD [00:00] S(5);
BEGIN
ITEM UNA$TIM C(00,00,10) = [" "];
ITEM UNA$TRM C(01,00,06) = ["TERM: "];
ITEM UNA$TNM C(01,36,07);
ITEM UNA$TXT C(02,18,20) = [", UNACTIONED COMMAND"];
ITEM UNA$ZBYT2 U(04,18,42) = [ 0 ];
END
CONTROL EJECT;
# #
# CSESTS CODE BEGINS HERE #
# #
#
* BEGIN CONSTRUCTING THE LINE IMAGE FOR THE TERMINAL STATUS. CON-
* VERT THE ASCII TERMINAL NAME TO DISPLAY CODE AND PLACE IT IN THE
* TEXT. CONVERT THE STATUS, DEVICE TYPE, TERMINAL CLASS AND HOST
* I.D. FIELDS AND INSERT THEM INTO THE TEXT. USING THE PORT NUMBER
* AND SOURCE NODE FIELDS, SEARCH FOR THE NAME OF THE LINE SUPPORTING
* THE DEVICE. IF FOUND, INSERT THE NAME INTO THE TEXT, ELSE USE
* -UNKNOWN- AS NAME AND INSERT INTO TEXT. CONVERT THE A1 AND A2
* FIELDS AND INSERT THEM INTO THE TEXT.
#
FOR I=0 STEP 1 UNTIL 6
DO
BEGIN
B<(I*6),6>UTEMP[0] = SSDCAD(B<I*8,8>STUTN[0]);
END
CNST1 = 1;
CNST2 = 36;
CNST3 = 42;
SSBSBF(TMS$TXT,CNST1,CNST2,CNST3,CTEMP$WORD);
CRNT$TRM[0] = CTEMP7[0];
TMS$ST[0] = ST$VAL[STUSTT[0]];
TMS$DT[0] = DT$VAL[STUDT[0]];
IF STUTC[0] LQ TC$3270
THEN
BEGIN
TMS$TC[0] = TC$VAL[STUTC[0]];
END
ELSE
BEGIN
TMS$TC[0] = TC$VAL[STUTC[0] - TC28$DIS];
END
CTEMP[0] = XCDD(1000 + STUHN[0]);# CAUSES LEADING ZEROES #
TMS$HN[0] = CTEMP3[0];
FOR I=0 STEP 1 WHILE NOT(ABHSN[0] EQ LIX$NID[I] AND
STUP[0] EQ LIX$PORT[I]) AND
I LS LIXL
DO
BEGIN
END
IF I LS LIXL
THEN
BEGIN
TMS$LNM[0] = LIX$NAME[I];
END
ELSE
BEGIN
TMS$LNM[0] = "UNKNOWN";
END
CTEMP[0] = XCHD(X"100" + STUA1[0]);
CNST1 = 4;
CNST2 = 54;
CNST3 = 12;
SSBSBF(TMS$TXT[0],CNST1,CNST2,CNST3,CTEMP$WORD);
CTEMP[0] = XCHD(X"100" + STUA2[0]);
TMS$A2[0] = CTEMP2[0];
#
* IF THIS SM IS STU/TE/U, GET THE CURRENT TIME AND APPEND IT TO THE
* BEGINNING OF THE STATUS TEXT. SEND THE TEXT OFF TO THE OPERATOR
* GROUP RESPONSE QUEUE WITH A GROUP AUDIENCE OF ONE. IF THE REASON
* CODE INDICATES NOT CONFIGURED OR ALREADY IN DESIRED STATE, THEN
* SEND THE -UNACTIONED COMMAND- TEXT TO THE OPERATOR GROUP RESPONSE
* QUEUE WITH A GROUP AUDIENCE OF ONE.
#
IF WCB$SMID[0] EQ SMID"STUTE"
THEN
BEGIN
TMS$TIM[0] = CTM$CLOCK[0];
WCB$WORD[1] = 0;
WCB$WC[1] = 2 + (TMS$TXTL / 10);
ABHWORD[1] = TMS$TXTL;
ABHADR[1] = AUDGR3$;
FOR I=0 STEP 1 WHILE NPU$NID[I] NQ ABHSN[0] AND
I LS CSNPCNT
DO
BEGIN
END
ABHABN[1] = I;
SSTAQE(P<ORQ>,WCBUF[1],ABH[1],TMS$TXT[0]);
CSESLE(ABHSN[0],WCBUF[1],TMS$TXT);
IF STURCT[0] EQ RRCT"UC"
THEN
BEGIN
WCB$WC[1] = 2 + (UNA$CMDL / 10);
ABHTLC[1] = UNA$CMDL;
CNST1 = 1;
CNST2 = 36;
CNST3 = 42;
SSBSBF(UNA$CMD,CNST1,CNST2,CNST3,CRNT$TNM);
SSTAQE(P<ORQ>,WCBUF[1],ABH[1],UNA$CMD[0]);
CSESLE(ABHSN[0],WCBUF[1],UNA$CMD);
END
END
#
* IF THIS SM IS STU/TE/N OR MSG/TE/A, THEN SEND THE STATUS TEXT TO
* THE OPERATOR IDENTIFIED BY THE ACN OF IN INCOMING SM.
#
ELSE # ASSUMED TO BE STU/TE/N OR MSG/TE/A #
BEGIN
WCB$WORD[1] = 0;
WCB$WC[1] = 2 + (TMS$TXTL / 10) - 1; # SUBTRACT TIME WORD #
WCB$SMID[1] = SMID"TTEXT";
ABHWORD[1] = 0;
ABHADR[1] = ABHCN[0];
ABHTLC[1] = TMS$TXTL - 10; # SUBTRACT WORD CONTAINING TIME #
SSTAQE(P<CNQ>,WCBUF[1],ABH[1],TMS$TXT[1]);
#
* IF THIS SM IS MSG/TE/A, THEN LOCATED THE SUPPORTING NPU NAME IN
* NPUCB TABLE AND INSERT IN -MESSAGE NOT SENT- TEXT. SEND THE TEXT
* TO THE OPERATOR IDENTIFIED BY THE ACN IN THE INCOMING SM WITH THE
* INPUT ALLOW FLAG SET.
#
IF WCB$SMID[0] EQ SMID"MSGTEA"
THEN
BEGIN
FOR I=0 STEP 1 WHILE ABHSN[0] NQ NPU$NID[I] AND
I LS CSNPCNT
DO
BEGIN
END
IF I LS CSNPCNT
THEN
BEGIN
CNST1 = 0;
CNST2 = 30;
CNST3 = 42;
SSBSBF(MNS$TXT,CNST1,CNST2,CNST3,B<0,42>NPU$WORD[I]);
END
WCB$WC[1] = 2 + (MNS$TXTL / 10);
WCB$IAF[1] = TRUE;
ABHTLC[1] = MNS$TXTL;
SSTAQE(P<CNQ>,WCBUF[1],ABH[1],MNS$TXT);
END
END
RETURN; # **** RETURN **** #
END # CSESTS #
TERM