home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
dbclis.zip
/
DBCLIST.CMD
Wrap
OS/2 REXX Batch file
|
1993-03-05
|
4KB
|
138 lines
/* Rexx */
/* Display all DBM communications connections (APPN and NETBIOS) */
Arg func .
If Left(func,1) = 'N' | func = '' Then
Call Disp_NETBIOS
If Left(func,1) = 'A' | func = '' Then
Call Disp_APPN
Exit
/*------------------------------------------------------------------------*/
/* Display NETBIOS Information */
/*------------------------------------------------------------------------*/
Disp_NETBIOS:
If RxFuncQuery('RXNBSESSIONSTATUS') Then
Call RxFuncAdd 'RXNBSESSIONSTATUS','YDBAUTIL','RXNBSESSIONSTATUS'
If RxFuncQuery('SQLDBS') Then
Call RxFuncAdd 'SQLDBS','SQLAR','SQLDBS'
/* Get DBM nodename information */
dbmc.0 = 4 /* 4 elements total */
dbmc.1 = 7 /* nodename */
dbmc.3 = 100 /* nodetype */
Call SQLDBS 'Get Database Manager Configuration Using :dbmc'
If sqlca.sqlcode <> 0 Then
Do
Say 'Get-DBM-Configuration failed:';Say sqlmsg
Exit
End
dbmname = Strip(dbmc.2)
clientname = '#SQL'Left(dbmname,8)'00 '
servername = 'S$SQL'Left(dbmname,8)'#DB'
nbrc1 = RxNbSessionStatus(clientname,'c.','i')
nbrc2 = RxNbSessionStatus(servername,'s.','i')
If Space(nbrc1,0) <> 0 Then
c.0 = 0
If Space(nbrc2,0) <> 0 Then
s.0 = 0
/* Constants */
nbs.='?';nbs.1='Listen Pending';nbs.2='Call Pending'
nbs.3='Session Established';nbs.4='Hang-Up Pending'
nbs.5='Hang-Up Complete';nbs.6='Session Aborted'
Say;Say Center('Database Manager Active Communications Connections',79,'_')
Say;Say Copies('-',79);Say 'NETBIOS Connection Information:';Say
Say 'Outbound NETBIOS connections:';Say
Say 'To ' Left('DBM Server',10)' 'Left('Session #',9)' '||'Session State'
Say ' ' Copies('_',10)' 'Copies('_',9)' 'Copies('_',13)
Do i=1 To c.0
ss = c.i.2
If c.i.4 <> '*' Then
Say ' ' Left(SubStr(c.i.4,6,8),10)' 'Left(c.i.1,9)' 'nbs.ss
End
Say;Say;Say 'Inbound NETBIOS connections:';Say
Say 'From' Left('DBM Client',10)' 'Left('Session #',9)' '||'Session State'
Say ' ' Copies('_',10)' 'Copies('_',9)' 'Copies('_',13)
Do i=1 To s.0
ss = s.i.2
If s.i.4 <> '*' Then
Say ' ' Left(SubStr(s.i.4,5,8),10)' 'Left(s.i.1,9)' 'nbs.ss
End
Return
/*------------------------------------------------------------------------*/
/* Display APPN Information */
/*------------------------------------------------------------------------*/
Disp_APPN:
If RxFuncQuery('RXACSMGT') Then
Call RxFuncAdd 'RXACSMGT','YDBAACSM','YDBAACSM'
/* Get APPN Connection information (inbound and outbound) */
Call RxAcsMgt 'display_tp_info','t.'
Call RxAcsMgt 'display_session_info','as.'
/* Build indexed list of fqplu names keyed by convid||sessid */
Drop sk. sk1.
Do i=1 To as.0
cidsid=as.i.2||as.i.1 /* Convid||Sessid key */
sk.cidsid=Space(as.i.20,0) /* FQ Partner LU Name */
/* Say "FQPLU for cidsid = x'"c2x(cidsid)"' is '"space(as.i.20,0)"'" */
sk1.cidsid = as.i.17'/'c2x(as.i.16) /* FQPCID - FqName/UniqueProcId */
End
Say;Say Copies('-',79);Say 'APPN Connection Information:';Say
Drop ob. ib.
obc = 0;ibc = 0
Do i=1 To t.0
If Left(t.i.2,4) = '07'x||'6DB',
| Left(t.i.2,4) = '07'x||'6DA' Then
Do
If t.i.0 <> 1 Then
Say 'There are' t.i.0 'conversations for tp number' i
cidsid = t.i.1.1||t.i.1.4 /* ConvId||SessId key */
/* Say "DBM Tp cidsid = x'"c2x(cidsid)"'" */
uid = Strip(t.i.3)
Select
When Left(t.i.4,1) = 'R' Then
Do
ibc = ibc + 1
ib.ibc = Left(sk.cidsid,17)' 'Left(uid,9)' 'c2x(t.i.1.2)' ',
sk1.cidsid
End
When Left(t.i.4,1) = 'L' Then
Do
obc = obc + 1
ob.obc = Left(sk.cidsid,17)' 'Left(uid,9)' 'c2x(t.i.1.2)' ',
sk1.cidsid
End
Otherwise
Say "Unknown connection type for session '"c2x(t.i.1.4)"',",
"conversation '"c2x(t.i.1.1)"'"
End
End
End
Say;Say;Say 'Outbound APPN connections:';Say
Say 'To ' Left('Server Node',17)' '||Left('UserId',9)' 'Left('ProcCorrId',17),
'FQPCID - FqName/UniqueProcId'
Say ' ' Copies('_',17)' 'Copies('_',9)' 'Copies('_',16)' 'Copies('_',33)
Do i=1 To obc;Say ' ' ob.i;End
Say;Say;Say 'Inbound APPN connections:';Say
Say 'From' Left('Client Node',17)' '||Left('UserId',9)' 'Left('ProcCorrId',17),
'FQPCID - FqName/UniqueProcId'
Say ' ' Copies('_',17)' 'Copies('_',9)' 'Copies('_',16)' 'Copies('_',33)
Do i=1 To ibc;Say ' ' ib.i;End
Return