*DECK CSESDA
USETEXT TEXTOV
USETEXT TEXTCS
USETEXT TEXTSS
USETEXT TXTAPSS
USETEXT TXTSMCS
PROC CSESDA;
# TITLE - SEND DI ACCOUNTING DATA. #
BEGIN
#
** CSESDA - SEND DI ACCOUNTING DATA.
*
* D.K. ENDO 84/11/19
*
* THIS PROCEDURE FORMATS STATISTICS INFORMATION FROM THE DI. IT
* THEN SENDS IT OUT TO THE SYSTEM ACCOUNT FILES.
*
* PROC CSESDA
*
* ENTRY 1. STI/TE/U AND STI/AP/U FROM THE EVENT QUEUE.
*
* EXIT 1. STATISTICS INFO SENT TO THE SYSTEM ACCOUNT FILES.
*
*
* ACCOUNT DAYFILE MESSAGE FORMATS:
*
* *SCTE, C1, DEVICE_NAME.
* *SCTE, C2, DEVICE_TYPE.
* *SCTE, C3, DESTINATION_SERVICE.
* *SCTE, C4, DI_NAME_OR_ADDRESS.
* *SCTE, C5, LIM, PRT, VVVV.
* *SCTE, C6, TTTTTTRRRRRRSSSSSS.
* *SCTE, C7, CCCCCC.
* *SCTE, C8, CONNECT_TIME.
*
* *SCAP, C1, SOURCE_SERVICE.
* *SCAP, C2, DESTINATION_SERVICE.
* *SCAP, C3, DI_NAME_OR_ADDRESS.
* *SCAP, C4, MMM, PRT, VVVV.
* *SCAP, C5, TTTTTTRRRRRRSSSSSS.
* *SCAP, C6, CCCCCC.
* *SCAP, C7, CONNECT_TIME.
*
* WHERE:
*
* LIM = LINE INTERFACE MODULE
* MMM = LIM OR MAINFRAME CHANNEL INTERFACE
* PRT = PORT NUMBER ON THE LIM
* VVVV = X.25 VIRTUAL CIRCUIT NUMBER
* TTTTTT = BLOCKS/PACKETS TRANSFERRED
* RRRRRR = BLOCKS/PACKETS RECEIVED
* SSSSSS = CHARACTERS TRANSFERRED
* CCCCCC = CHARACTERS RECEIVED.
*
#
#
**** PROC CSESDA - XREF LIST BEGINS.
#
XREF
BEGIN
PROC MESSAGE; # SEND TEXT TO SYSTEM ACCOUNT FILE #
PROC SSBEBF; # EXTRACT BIT FIELD #
PROC SSBSBF; # STORE BIT FIELD #
FUNC SSDCAD U; # CONVERT ASCII TO DISPLAY CODE #
FUNC XCDD U; # CONVERT DECIMAL VALUE TO DISPLAY CODE #
END
#
****
#
DEF ACCT$ # 5 #; # IDENTIFIER FOR ACCOUNT FILE #
DEF ABLANK$ # X"20" #; # ASCII BLANK #
ITEM BITS; # BIT PRSITION IN WORD -- STORE #
ITEM BITX; # BIT POSITION IN WORD -- EXTRACT #
ITEM CHR I = 0; # TEMPORARY TO STORE CHARACTER IN #
ITEM FINISHED B; # FLAG INDICATING STATUS OF CONVERSION #
ITEM I; # LOOP VARIABLE #
ITEM WORDS; # WORD POSITION -- STORE #
ITEM WORDX; # WORD POSITION -- EXTRACT #
#
* THIS ARRAY DEFINES THE STATISTICS TEXT FORMAT THAT IS SENT WHEN
* THE PROC IS INVOKED.
#
ARRAY DIS$TXT [00:00] S(5);
BEGIN
ITEM DIS$SC C(00,00,02) = ["SC"];
ITEM DIS$TYPE C(00,12,02); # STATISTIC TYPE -- TE/AP #
ITEM DIS$C1 C(00,24,03) = [", C"];
ITEM DIS$CNUM C(00,42,01); # LINE NUMBER #
ITEM DIS$UNUM U(00,42,06);
ITEM DIS$C2 C(00,48,12) = [", "];
ITEM DIS$TEXT C(01,00,31); # TEXT LINES #
ITEM DIS$LIM U(01,00,06); # LINE INTRFACE MODULE (1..7) #
ITEM DIS$COMMA1 C(01,06,02);
ITEM DIS$PORT U(01,18,06); # LIM PORT NUMBER (1..3) #
ITEM DIS$COMMA2 C(01,24,02);
ITEM DIS$VCIR U(01,36,24); # VIRTUAL CIRCUIT NUMBER #
ITEM DIS$CNT1 U(01,00,36); # BLKS XFERRED AND CHARS RCV-ED #
ITEM DIS$CNT21 U(01,36,24); # BLOCKS RECEIVED #
ITEM DIS$CNT22 U(02,00,12);
ITEM DIS$CNT3 U(02,12,36); # CHARACTERS TRANSFERRED #
END
#
* THIS ARRAY IS USED AS A CONSTANT FOR TERMINATING THE ACCOUNT
* MESSAGES.
#
ARRAY END$TXT [00:00] S(1);
BEGIN
ITEM ETX$PER C(00,36,01) = ["."];
ITEM ETX$ZBYT U(00,42,18) = [0];
END
#
* THIS ARRAY IS USED AS A TEMPORARY FOR AN INTEGER ITEM.
#
ARRAY ITEMP2 [00:00] S(1);
BEGIN
ITEM IT2$CNST1 U(00,44,04);
ITEM IT2$CNST2 U(00,48,12);
ITEM IT2$ZERO I(00,00,60) = [0];
END
CONTROL EJECT;
#
* CSESDA CODE BEGINS HERE
#
#
* IF THIS SM IS STI/TE/U, THEN SET THE MESSAGE TYPE TO *TE*, ELSE
* ASSUME THAT THE MESSAGE IS STI/TE/U AND SET THE MESSAGE TYPE TO
* *AP*.
#
IF WCB$SMID[0] EQ SMID"STITE"
THEN
BEGIN
DIS$TYPE[0] = "TE";
END
ELSE
BEGIN
DIS$TYPE[0] = "AP";
END
#
* EXTRACT THE FIRST ASCII STRING IN SM AND STORE IT IN THE
* ACCOUNT MESSAGE BUFFER, SET THE LINE NUMBER, TERMINATE THE
* THE MESSAGE, AND SEND IT TO THE ACCOUNT DAYFILE.
#
DIS$CNUM[0] = "1";
FINISHED = FALSE;
WORDX = 0;
BITX = 16;
WORDS = 1;
BITS = 0;
FOR I=1 STEP 1 WHILE NOT FINISHED AND
I LQ 7
DO
BEGIN
SSBEBF(MSGBUF[0],WORDX,BITX,8,CHR);
IF CHR EQ ABLANK$
THEN
BEGIN
FINISHED = TRUE;
END
ELSE
BEGIN
SSBSBF(DIS$TXT,WORDS,BITS,6,SSDCAD(CHR));
END
END
SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
MESSAGE(DIS$TXT,ACCT$);
#
* IF THE SM IS STI/TE, THEN EXTRACT THE DEVICE TYPE, CONVERT
* IT TO DISPLAY CODE AND STORE IT IN THE MESSAGE BUFFER.
#
IF WCB$SMID[0] EQ SMID"STITE"
THEN
BEGIN
DIS$UNUM[0] = DIS$UNUM[0] + 1;
WORDX = 1;
BITX = 12;
WORDS = 1;
BITS = 0;
FOR I=1 STEP 1 UNTIL 3
DO
BEGIN
SSBEBF(MSGBUF[0],WORDX,BITX,8,CHR);
SSBSBF(DIS$TXT,WORDS,BITS,6,SSDCAD(CHR));
END
SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
MESSAGE(DIS$TXT,ACCT$);
END
#
* EXTRACT THE NEXT ASCII STRING IN SM AND STORE IT IN THE
* ACCOUNT MESSAGE BUFFER, SET THE LINE NUMBER, TERMINATE THE
* THE MESSAGE, AND SEND IT TO THE ACCOUNT DAYFILE.
#
DIS$UNUM[0] = DIS$UNUM[0] + 1;
FINISHED = FALSE;
WORDX = 1;
BITX = 36;
WORDS = 1;
BITS = 0;
FOR I=1 STEP 1 WHILE NOT FINISHED AND
I LQ 31
DO
BEGIN
SSBEBF(MSGBUF[0],WORDX,BITX,8,CHR);
IF CHR EQ ABLANK$
THEN
BEGIN
FINISHED = TRUE;
END
ELSE
BEGIN
SSBSBF(DIS$TXT,WORDS,BITS,6,SSDCAD(CHR));
END
END
SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
MESSAGE(DIS$TXT,ACCT$);
#
* EXTRACT THE NEXT ASCII STRING IN SM AND STORE IT IN THE
* ACCOUNT MESSAGE BUFFER, SET THE LINE NUMBER, TERMINATE THE
* THE MESSAGE, AND SEND IT TO THE ACCOUNT DAYFILE.
#
DIS$UNUM[0] = DIS$UNUM[0] + 1;
FINISHED = FALSE;
WORDX = 5;
BITX = 44;
WORDS = 1;
BITS = 0;
FOR I=1 STEP 1 WHILE NOT FINISHED AND
I LQ 31
DO
BEGIN
SSBEBF(MSGBUF[0],WORDX,BITX,8,CHR);
IF CHR EQ ABLANK$
THEN
BEGIN
FINISHED = TRUE;
END
ELSE
BEGIN
SSBSBF(DIS$TXT,WORDS,BITS,6,SSDCAD(CHR));
END
END
SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
MESSAGE(DIS$TXT,ACCT$);
#
* CONVERT THE LIM/MCI, LIM PORT, AND VIRTUAL CIRCUIT NUMBERS AND
* STORE THEM IN THE ACCOUNTING MESSAGE, SET THE LINE NUMBER, SEPA-
* THE VALUES BY COMMAS, TERMINATE THE MESSAGE, AND SEND IT TO THE
* ACCOUNT DAYFILE.
#
DIS$LIM[0] = XCDD(STILIM[0]);
DIS$PORT[0] = XCDD(STIPN[0]);
DIS$VCIR[0] = XCDD(STIVCN[0]);
DIS$UNUM[0] = DIS$UNUM[0] + 1;
DIS$COMMA1[0] = ", ";
DIS$COMMA2[0] = ", ";
WORDS = 2;
BITS = 0;
SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
MESSAGE(DIS$TXT,ACCT$);
#
* CONVERT THE BLOCKS TRANSMITTED, BLOCKS RECEIVED, AND CHARACTERS
* TRANSMETTED VALUES AND PUT THEM IN THE ACCOUNT MESSAGE BUFFER,
* TERMINATE THE MESSAGE, AND SEND IT TO THE ACCOUNT DAYFILE.
#
DIS$CNT1[0] = XCDD(STIDBT[0]);
WORDS = 1;
BITS = 36;
SSBSBF(DIS$TXT,WORDS,BITS,36,XCDD(STIDBR[0]));
IT2$CNST1[0] = STIDCT1[0];
IT2$CNST2[0] = STIDCT2[0];
DIS$CNT3[0] = XCDD(ITEMP2);
DIS$UNUM[0] = DIS$UNUM[0] + 1;
WORDS = 2;
BITS =48;
SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
MESSAGE(DIS$TXT,ACCT$);
#
* EXTRACT THE NUMBER OF CHARACTERS RECEIVED, CONVERT IT, STORE
* IT IN THE ACCOUNT MESSAGE BUFFER, SET THE LINE NUMBER, TER-
* MINATE THE MESSAGE, AND SEND IT THE THE ACCOUNT DAYFILE.
#
DIS$CNT1[0] = XCDD(STIDCR[0]);
DIS$UNUM[0] = DIS$UNUM[0] + 1;
WORDS = 1;
BITS = 36;
SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
MESSAGE(DIS$TXT,ACCT$);
#
* EXTRACT THE CONNECT TIME STRING IN SM AND STORE IT IN THE
* ACCOUNT MESSAGE BUFFER, SET THE LINE NUMBER, TERMINATE THE
* THE MESSAGE, AND SEND IT TO THE ACCOUNT DAYFILE.
#
DIS$CNT1[0] = XCDD(STITI[0]);
DIS$UNUM[0] = DIS$UNUM[0] + 1;
WORDS = 1;
BITS = 36;
SSBSBF(DIS$TXT,WORDS,BITS,24,END$TXT);
MESSAGE(DIS$TXT,ACCT$);
END # CSESDA #
TERM