HLCSLNCH ;ALB/MTC/JC - START AND STOP THE LLP ;08/08/2011 15:18
;;1.6;HEALTH LEVEL SEVEN;**6,19,43,49,57,75,84,109,122,157**;Oct 13, 1995;Build 8
;Per VHA Directive 2004-038, this routine should not be modified.
;
;This program is callable from a menu
;It allows the user to Start and Stop the Lower Layer
;Protocol in the Background or in the foreground
;
;Required or Optional INPUT PARAMETERS
; None
;
;
;Output variables
; HLDP=IEN of Logical Link in file #870
;(optional)HLTRACE=if SET it launches the LLP in the Foreground
;(optional) ZTSK=if defined LLP was launched in the
;background
;
;
START ; Start up the lower level protocol
N DIC,DIRUT,DTOUT,DUOUT,HLDP,HLDAPP,HLJ,HLQUIT,HLTRACE
N HLPARM0,HLPARM4,HLTYPTR,HLBGR,X,Y,ZTCPU,ZTSK,ZTRTN,ZTDESC
W !!,"This option is used to launch the lower level protocol for the"
W !,"appropriate device. Please select the node with which you want"
W !,"to communicate",!
; patch HL*1.6*122
S POP=0
S DIC="^HLCS(870,",DIC(0)="QEAMZ" D ^DIC G:Y<0 STARTQ
S HLDP=+Y,HLDAPP=Y(0,0),HLTYPTR=+$P(Y(0),U,3),HLPARM0=Y(0)
;-- check if parameter have been setup
;-- check for LLP type
I 'HLTYPTR W !!,$C(7),"A Lower Layer Protocol must be selected before start-up can occur." G STARTQ
;-- get TCP information
S HLPARM4=$G(^HLCS(870,HLDP,400))
;-- get routine (background job for LLP)
S HLBGR=$G(^HLCS(869.1,HLTYPTR,100))
;-- get environment check routine (HLQUIT should be defined in fails)
S HLENV=$G(^HLCS(869.1,HLTYPTR,200))
;
I HLBGR="" W !!,$C(7),"No routine has been specified for this LLP." G STARTQ
;
;-- execute environment check routine if HLQUIT is defined then terminate
I HLENV'="" X HLENV G:$D(HLQUIT) STARTQ
; patch HL*1.6*122 start
; Multi-Servers: TCP service (GT.M, DSM, and Cache/VMS) is controlled
; by the external service
; patch HL*1.6*157, for Cache/UNIX for Linux
N HLOSYS
S HLOSYS=$$OS^%ZOSV
; I $P(HLPARM4,U,3)="M",$S(^%ZOSF("OS")'["OpenM":1,1:$$OS^%ZOSV["VMS") D G STARTQ
I $P(HLPARM4,U,3)="M",$S(^%ZOSF("OS")'["OpenM":1,1:(HLOSYS["VMS")!(HLOSYS["UNIX")) D G STARTQ
. W !,$C(7),"This LLP is a multi-threaded server. It is controlled by external service, i.e. TCPIP/UCX. You must use the external service to start this LLP."
. Q
; patch HL*1.6*122 end
;
I $P(HLPARM0,U,10) W !,$C(7),"The LLP was last started on ",$$DAT2^HLUTIL1($P(HLPARM0,U,10)),"." G STP1:$P(HLPARM0,U,5)'="Error"
I $P(HLPARM0,U,11) W !,"The LLP was last shutdown on ",$$DAT2^HLUTIL1($P(HLPARM0,U,11)),"."
; patch HL*1.6*122 start
; comment out-should be taken care of by the code 2 line above
; I $P(HLPARM0,U,5)'="Error",'($P(HLPARM4,U,3)="C"&("N"[$P(HLPARM4,U,4))),$P(HLPARM0,U,10)]""&($P(HLPARM0,U,11)=""),$P(HLPARM0,U,12) W !,"The LLP appears to be online already !"
; I $$TASK^HLUTIL1($P(HLPARM0,U,12)) D G STARTQ
; . W !,$C(7),"NOTE: The lower level protocol for this application is already running."
N HLTEMP
S HLTEMP=0
I $P(HLPARM0,U,12) D G:HLTEMP STARTQ
. N ZTSK
. S ZTSK=$P(HLPARM0,U,12)
. D STAT^%ZTLOAD
. I "12"[ZTSK(1) D
.. W !,$C(7),"NOTE: The lower level protocol for this application is already running."
.. I '$P(^HLCS(870,HLDP,0),"^",10) S $P(^HLCS(870,HLDP,0),"^",10)=$$NOW^XLFDT
.. S HLTEMP=1
; patch HL*1.6*122 end
I $P(HLPARM4,U,3)="C"&("N"[$P(HLPARM4,U,4)) D G STARTQ
.;4=status 9=Time Started, 10=Time Stopped, 11=Task Number
.;14=Shutdown LLP, 3=Device Type, 18=Gross Errors
.N HLJ,X
. ; patch HL*1.6*122-comment out
. ; I $P(HLPARM0,U,15)=0 W !,"This LLP is already enabled!" Q
.L +^HLCS(870,HLDP,0):2
.E W !,$C(7),"Unable to enable this LLP !" Q
.S X="HLJ(870,"""_HLDP_","")"
.S @X@(4)="Enabled",@X@(9)=$$NOW^XLFDT,@X@(14)=0
.D FILE^HLDIE("","HLJ","","START","HLCSLNCH") ;HL*1.6*109
.L -^HLCS(870,HLDP,0)
.W !,"This LLP has been enabled!"
.Q
I $P(HLPARM4,U,6),$D(^%ZIS(14.7,+$P(HLPARM4,U,6),0)) S ZTCPU=$P(^(0),U) W !,"This LLP will start on node ",ZTCPU," if it is run in the Background.",!
;
; patch HL*1.6*122 start, for tcp link
I HLTYPTR=4 D Q
. S Y="B"
. D STARTJOB
; patch HL*1.6*122 end
;
W ! S DIR(0)="SM^F:FOREGROUND;B:BACKGROUND;Q:QUIT"
S DIR("A")="Method for running the receiver"
S DIR("B")="B"
S DIR("?",1)="Enter F for Foreground (and trace)"
S DIR("?",2)=" B for Background (normal) or"
S DIR("?")=" Q to quit without starting the receiver"
D ^DIR K DIR
Q:(Y=U)!(Y="Q")
;
STARTJOB ;
S HLX=$G(^HLCS(870,HLDP,0))
;-- foreground
I Y="F" S HLTRACE=1 D G STARTQ
. S $P(^HLCS(870,HLDP,0),"^",10)=$$NOW^XLFDT
. D MON^HLCSTCP("Start")
. X HLBGR
;-- background
I Y="B" D G STARTQ
. S ZTRTN=$P(HLBGR," ",2),HLTRACE="",ZTIO="",ZTDTH=$H
. S ZTDESC=HLDAPP_" Low Level Protocol",ZTSAVE("HLDP")=""
. D ^%ZTLOAD
. ; patch HL*1.6*122 start
. I $D(ZTSK) D
.. K HLTRACE
.. D MON^HLCSTCP("Tasked")
.. S $P(^HLCS(870,HLDP,0),"^",10)=$$NOW^XLFDT
. ; patch HL*1.6*122 end
. W !,$S($D(ZTSK):"Job was queued as "_ZTSK_".",1:"Unable to queue job.")
;
Q
;
STARTQ ;
I $G(POP) W !,?5,"-Unable to Open the Device !",!,!,?6,"Check that Port is Logged Out, and that the",!,?6,"Lower Level Protocol is not Already Running."
Q
;
STOP ; Shut down a lower level protocol..
N DIC,DIRUT,DTOUT,DUOUT,HLDP,HLDAPP,HLJ,HLPARM0,HLPARM4,X,Y
W !!,"This option is used to shut down the lower level protocol for the"
W !,"appropriate device. Please select the link which you would"
W !,"like to shutdown.",!
S DIC="^HLCS(870,",DIC(0)="QEAMZ" D ^DIC K DIC Q:Y<0
S HLDP=+Y,HLDAPP=Y(0,0),HLPARM0=Y(0),HLPARM4=$G(^HLCS(870,HLDP,400))
; patch HL*1.6*122
; Multi-Servers: TCP service (GT.M, DSM, and Cache/VMS) is controlled
; by the external service
; patch HL*1.6*157, for Cache/UNIX for Linux
N HLOSYS
S HLOSYS=$$OS^%ZOSV
; I $P(HLPARM4,U,3)="M",$S(^%ZOSF("OS")'["OpenM":1,1:$$OS^%ZOSV["VMS") D Q
I $P(HLPARM4,U,3)="M",$S(^%ZOSF("OS")'["OpenM":1,1:(HLOSYS["VMS")!(HLOSYS["UNIX")) D Q
. W !,$C(7),"This LLP is a multi-threaded server. It is controlled by external service, i.e. TCPIP/UCX. You must use the external service to disable this LLP."
. Q
;
I $P(HLPARM0,U,15) W !,$C(7),"The lower level protocol is already ",$P(HLPARM0,U,5),"." Q
I $P(HLPARM0,U,10) W !,$C(7),"The lower level protocol was started on ",$$DAT2^HLUTIL1($P(HLPARM0,U,10)),"."
STP1 ;
W ! S DIR(0)="Y",DIR("A")="Okay to shut down this job" D ^DIR K DIR
I 'Y!($D(DIRUT))!($D(DUOUT)) W !!,"The job will not be shut down." Q
S ;
F L +^HLCS(870,HLDP,0):2 Q:$T
;4=status,10=Time Stopped,9=Time Started,11=Task Number,3=Device Type,14=shutdown
S X="HLJ(870,"""_HLDP_","")",@X@(4)="Halting",@X@(10)=$$NOW^XLFDT,(@X@(11),@X@(9))="@",@X@(14)=1
I $P(HLPARM4,U,3)="C"&("N"[$P(HLPARM4,U,4)),'$P(HLPARM0,U,12) S @X@(4)="Shutdown"
D FILE^HLDIE("","HLJ","","STOP","HLCSLNCH") ; HL*1.6*109
; patch HL*1.6*122 start
; I ^%ZOSF("OS")["OpenM",(($P(HLPARM4,U,3)="M"&($$OS^%ZOSV'["VMS"))!($P(HLPARM4,U,3)="S")) D
; I ^%ZOSF("OS")'["DSM",(($P(HLPARM4,U,3)="M"&($$OS^%ZOSV'["VMS"))!($P(HLPARM4,U,3)="S")) D
; patch HL*1.6*157, for Cache/UNIX for Linux
N HLOSYS
S HLOSYS=$$OS^%ZOSV
; I ($P(HLPARM4,U,3)="S")!(($P(HLPARM4,U,3)="M")&($S(^%ZOSF("OS")'["OpenM":0,1:$$OS^%ZOSV'["VMS"))) D
I ($P(HLPARM4,U,3)="S")!(($P(HLPARM4,U,3)="M")&($S(^%ZOSF("OS")'["OpenM":0,1:((HLOSYS'["VMS")&(HLOSYS'["UNIX"))))) D
. ; patch HL*1.6*157 end
. ;pass task number to stop listener
. S:$P(HLPARM0,U,12) X=$$ASKSTOP^%ZTLOAD(+$P(HLPARM0,U,12))
. ; D CALL^%ZISTCP($P(HLPARM4,U),$P(HLPARM4,U,2),10)
. ; I POP D HOME^%ZIS U IO W !,"Unable to shutdown logical link!!!",$C(7),$C(7) Q
. ; U IO W "**STOP**"
. ; W !
. ; D CLOSE^%ZISTCP
. ; patch HL*1.6*122 end
L -^HLCS(870,HLDP,0)
W !,"The job for the "_HLDAPP_" Lower Level Protocol will be shut down."
Q
;
STOPQ Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLCSLNCH 7915 printed Nov 22, 2024@17:06:48 Page 2
HLCSLNCH ;ALB/MTC/JC - START AND STOP THE LLP ;08/08/2011 15:18
+1 ;;1.6;HEALTH LEVEL SEVEN;**6,19,43,49,57,75,84,109,122,157**;Oct 13, 1995;Build 8
+2 ;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 ;This program is callable from a menu
+5 ;It allows the user to Start and Stop the Lower Layer
+6 ;Protocol in the Background or in the foreground
+7 ;
+8 ;Required or Optional INPUT PARAMETERS
+9 ; None
+10 ;
+11 ;
+12 ;Output variables
+13 ; HLDP=IEN of Logical Link in file #870
+14 ;(optional)HLTRACE=if SET it launches the LLP in the Foreground
+15 ;(optional) ZTSK=if defined LLP was launched in the
+16 ;background
+17 ;
+18 ;
START ; Start up the lower level protocol
+1 NEW DIC,DIRUT,DTOUT,DUOUT,HLDP,HLDAPP,HLJ,HLQUIT,HLTRACE
+2 NEW HLPARM0,HLPARM4,HLTYPTR,HLBGR,X,Y,ZTCPU,ZTSK,ZTRTN,ZTDESC
+3 WRITE !!,"This option is used to launch the lower level protocol for the"
+4 WRITE !,"appropriate device. Please select the node with which you want"
+5 WRITE !,"to communicate",!
+6 ; patch HL*1.6*122
+7 SET POP=0
+8 SET DIC="^HLCS(870,"
SET DIC(0)="QEAMZ"
DO ^DIC
if Y<0
GOTO STARTQ
+9 SET HLDP=+Y
SET HLDAPP=Y(0,0)
SET HLTYPTR=+$PIECE(Y(0),U,3)
SET HLPARM0=Y(0)
+10 ;-- check if parameter have been setup
+11 ;-- check for LLP type
+12 IF 'HLTYPTR
WRITE !!,$CHAR(7),"A Lower Layer Protocol must be selected before start-up can occur."
GOTO STARTQ
+13 ;-- get TCP information
+14 SET HLPARM4=$GET(^HLCS(870,HLDP,400))
+15 ;-- get routine (background job for LLP)
+16 SET HLBGR=$GET(^HLCS(869.1,HLTYPTR,100))
+17 ;-- get environment check routine (HLQUIT should be defined in fails)
+18 SET HLENV=$GET(^HLCS(869.1,HLTYPTR,200))
+19 ;
+20 IF HLBGR=""
WRITE !!,$CHAR(7),"No routine has been specified for this LLP."
GOTO STARTQ
+21 ;
+22 ;-- execute environment check routine if HLQUIT is defined then terminate
+23 IF HLENV'=""
XECUTE HLENV
if $DATA(HLQUIT)
GOTO STARTQ
+24 ; patch HL*1.6*122 start
+25 ; Multi-Servers: TCP service (GT.M, DSM, and Cache/VMS) is controlled
+26 ; by the external service
+27 ; patch HL*1.6*157, for Cache/UNIX for Linux
+28 NEW HLOSYS
+29 SET HLOSYS=$$OS^%ZOSV
+30 ; I $P(HLPARM4,U,3)="M",$S(^%ZOSF("OS")'["OpenM":1,1:$$OS^%ZOSV["VMS") D G STARTQ
+31 IF $PIECE(HLPARM4,U,3)="M"
IF $SELECT(^%ZOSF("OS")'["OpenM":1,1:(HLOSYS["VMS")!(HLOSYS["UNIX"))
Begin DoDot:1
+32 WRITE !,$CHAR(7),"This LLP is a multi-threaded server. It is controlled by external service, i.e. TCPIP/UCX. You must use the external service to start this LLP."
+33 QUIT
End DoDot:1
GOTO STARTQ
+34 ; patch HL*1.6*122 end
+35 ;
+36 IF $PIECE(HLPARM0,U,10)
WRITE !,$CHAR(7),"The LLP was last started on ",$$DAT2^HLUTIL1($PIECE(HLPARM0,U,10)),"."
if $PIECE(HLPARM0,U,5)'="Error"
GOTO STP1
+37 IF $PIECE(HLPARM0,U,11)
WRITE !,"The LLP was last shutdown on ",$$DAT2^HLUTIL1($PIECE(HLPARM0,U,11)),"."
+38 ; patch HL*1.6*122 start
+39 ; comment out-should be taken care of by the code 2 line above
+40 ; I $P(HLPARM0,U,5)'="Error",'($P(HLPARM4,U,3)="C"&("N"[$P(HLPARM4,U,4))),$P(HLPARM0,U,10)]""&($P(HLPARM0,U,11)=""),$P(HLPARM0,U,12) W !,"The LLP appears to be online already !"
+41 ; I $$TASK^HLUTIL1($P(HLPARM0,U,12)) D G STARTQ
+42 ; . W !,$C(7),"NOTE: The lower level protocol for this application is already running."
+43 NEW HLTEMP
+44 SET HLTEMP=0
+45 IF $PIECE(HLPARM0,U,12)
Begin DoDot:1
+46 NEW ZTSK
+47 SET ZTSK=$PIECE(HLPARM0,U,12)
+48 DO STAT^%ZTLOAD
+49 IF "12"[ZTSK(1)
Begin DoDot:2
+50 WRITE !,$CHAR(7),"NOTE: The lower level protocol for this application is already running."
+51 IF '$PIECE(^HLCS(870,HLDP,0),"^",10)
SET $PIECE(^HLCS(870,HLDP,0),"^",10)=$$NOW^XLFDT
+52 SET HLTEMP=1
End DoDot:2
End DoDot:1
if HLTEMP
GOTO STARTQ
+53 ; patch HL*1.6*122 end
+54 IF $PIECE(HLPARM4,U,3)="C"&("N"[$PIECE(HLPARM4,U,4))
Begin DoDot:1
+55 ;4=status 9=Time Started, 10=Time Stopped, 11=Task Number
+56 ;14=Shutdown LLP, 3=Device Type, 18=Gross Errors
+57 NEW HLJ,X
+58 ; patch HL*1.6*122-comment out
+59 ; I $P(HLPARM0,U,15)=0 W !,"This LLP is already enabled!" Q
+60 LOCK +^HLCS(870,HLDP,0):2
+61 IF '$TEST
WRITE !,$CHAR(7),"Unable to enable this LLP !"
QUIT
+62 SET X="HLJ(870,"""_HLDP_","")"
+63 SET @X@(4)="Enabled"
SET @X@(9)=$$NOW^XLFDT
SET @X@(14)=0
+64 ;HL*1.6*109
DO FILE^HLDIE("","HLJ","","START","HLCSLNCH")
+65 LOCK -^HLCS(870,HLDP,0)
+66 WRITE !,"This LLP has been enabled!"
+67 QUIT
End DoDot:1
GOTO STARTQ
+68 IF $PIECE(HLPARM4,U,6)
IF $DATA(^%ZIS(14.7,+$PIECE(HLPARM4,U,6),0))
SET ZTCPU=$PIECE(^(0),U)
WRITE !,"This LLP will start on node ",ZTCPU," if it is run in the Background.",!
+69 ;
+70 ; patch HL*1.6*122 start, for tcp link
+71 IF HLTYPTR=4
Begin DoDot:1
+72 SET Y="B"
+73 DO STARTJOB
End DoDot:1
QUIT
+74 ; patch HL*1.6*122 end
+75 ;
+76 WRITE !
SET DIR(0)="SM^F:FOREGROUND;B:BACKGROUND;Q:QUIT"
+77 SET DIR("A")="Method for running the receiver"
+78 SET DIR("B")="B"
+79 SET DIR("?",1)="Enter F for Foreground (and trace)"
+80 SET DIR("?",2)=" B for Background (normal) or"
+81 SET DIR("?")=" Q to quit without starting the receiver"
+82 DO ^DIR
KILL DIR
+83 if (Y=U)!(Y="Q")
QUIT
+84 ;
STARTJOB ;
+1 SET HLX=$GET(^HLCS(870,HLDP,0))
+2 ;-- foreground
+3 IF Y="F"
SET HLTRACE=1
Begin DoDot:1
+4 SET $PIECE(^HLCS(870,HLDP,0),"^",10)=$$NOW^XLFDT
+5 DO MON^HLCSTCP("Start")
+6 XECUTE HLBGR
End DoDot:1
GOTO STARTQ
+7 ;-- background
+8 IF Y="B"
Begin DoDot:1
+9 SET ZTRTN=$PIECE(HLBGR," ",2)
SET HLTRACE=""
SET ZTIO=""
SET ZTDTH=$HOROLOG
+10 SET ZTDESC=HLDAPP_" Low Level Protocol"
SET ZTSAVE("HLDP")=""
+11 DO ^%ZTLOAD
+12 ; patch HL*1.6*122 start
+13 IF $DATA(ZTSK)
Begin DoDot:2
+14 KILL HLTRACE
+15 DO MON^HLCSTCP("Tasked")
+16 SET $PIECE(^HLCS(870,HLDP,0),"^",10)=$$NOW^XLFDT
End DoDot:2
+17 ; patch HL*1.6*122 end
+18 WRITE !,$SELECT($DATA(ZTSK):"Job was queued as "_ZTSK_".",1:"Unable to queue job.")
End DoDot:1
GOTO STARTQ
+19 ;
+20 QUIT
+21 ;
STARTQ ;
+1 IF $GET(POP)
WRITE !,?5,"-Unable to Open the Device !",!,!,?6,"Check that Port is Logged Out, and that the",!,?6,"Lower Level Protocol is not Already Running."
+2 QUIT
+3 ;
STOP ; Shut down a lower level protocol..
+1 NEW DIC,DIRUT,DTOUT,DUOUT,HLDP,HLDAPP,HLJ,HLPARM0,HLPARM4,X,Y
+2 WRITE !!,"This option is used to shut down the lower level protocol for the"
+3 WRITE !,"appropriate device. Please select the link which you would"
+4 WRITE !,"like to shutdown.",!
+5 SET DIC="^HLCS(870,"
SET DIC(0)="QEAMZ"
DO ^DIC
KILL DIC
if Y<0
QUIT
+6 SET HLDP=+Y
SET HLDAPP=Y(0,0)
SET HLPARM0=Y(0)
SET HLPARM4=$GET(^HLCS(870,HLDP,400))
+7 ; patch HL*1.6*122
+8 ; Multi-Servers: TCP service (GT.M, DSM, and Cache/VMS) is controlled
+9 ; by the external service
+10 ; patch HL*1.6*157, for Cache/UNIX for Linux
+11 NEW HLOSYS
+12 SET HLOSYS=$$OS^%ZOSV
+13 ; I $P(HLPARM4,U,3)="M",$S(^%ZOSF("OS")'["OpenM":1,1:$$OS^%ZOSV["VMS") D Q
+14 IF $PIECE(HLPARM4,U,3)="M"
IF $SELECT(^%ZOSF("OS")'["OpenM":1,1:(HLOSYS["VMS")!(HLOSYS["UNIX"))
Begin DoDot:1
+15 WRITE !,$CHAR(7),"This LLP is a multi-threaded server. It is controlled by external service, i.e. TCPIP/UCX. You must use the external service to disable this LLP."
+16 QUIT
End DoDot:1
QUIT
+17 ;
+18 IF $PIECE(HLPARM0,U,15)
WRITE !,$CHAR(7),"The lower level protocol is already ",$PIECE(HLPARM0,U,5),"."
QUIT
+19 IF $PIECE(HLPARM0,U,10)
WRITE !,$CHAR(7),"The lower level protocol was started on ",$$DAT2^HLUTIL1($PIECE(HLPARM0,U,10)),"."
STP1 ;
+1 WRITE !
SET DIR(0)="Y"
SET DIR("A")="Okay to shut down this job"
DO ^DIR
KILL DIR
+2 IF 'Y!($DATA(DIRUT))!($DATA(DUOUT))
WRITE !!,"The job will not be shut down."
QUIT
S ;
+1 FOR
LOCK +^HLCS(870,HLDP,0):2
if $TEST
QUIT
+2 ;4=status,10=Time Stopped,9=Time Started,11=Task Number,3=Device Type,14=shutdown
+3 SET X="HLJ(870,"""_HLDP_","")"
SET @X@(4)="Halting"
SET @X@(10)=$$NOW^XLFDT
SET (@X@(11),@X@(9))="@"
SET @X@(14)=1
+4 IF $PIECE(HLPARM4,U,3)="C"&("N"[$PIECE(HLPARM4,U,4))
IF '$PIECE(HLPARM0,U,12)
SET @X@(4)="Shutdown"
+5 ; HL*1.6*109
DO FILE^HLDIE("","HLJ","","STOP","HLCSLNCH")
+6 ; patch HL*1.6*122 start
+7 ; I ^%ZOSF("OS")["OpenM",(($P(HLPARM4,U,3)="M"&($$OS^%ZOSV'["VMS"))!($P(HLPARM4,U,3)="S")) D
+8 ; I ^%ZOSF("OS")'["DSM",(($P(HLPARM4,U,3)="M"&($$OS^%ZOSV'["VMS"))!($P(HLPARM4,U,3)="S")) D
+9 ; patch HL*1.6*157, for Cache/UNIX for Linux
+10 NEW HLOSYS
+11 SET HLOSYS=$$OS^%ZOSV
+12 ; I ($P(HLPARM4,U,3)="S")!(($P(HLPARM4,U,3)="M")&($S(^%ZOSF("OS")'["OpenM":0,1:$$OS^%ZOSV'["VMS"))) D
+13 IF ($PIECE(HLPARM4,U,3)="S")!(($PIECE(HLPARM4,U,3)="M")&($SELECT(^%ZOSF("OS")'["OpenM":0,1:((HLOSYS'["VMS")&(HLOSYS'["UNIX")))))
Begin DoDot:1
+14 ; patch HL*1.6*157 end
+15 ;pass task number to stop listener
+16 if $PIECE(HLPARM0,U,12)
SET X=$$ASKSTOP^%ZTLOAD(+$PIECE(HLPARM0,U,12))
+17 ; D CALL^%ZISTCP($P(HLPARM4,U),$P(HLPARM4,U,2),10)
+18 ; I POP D HOME^%ZIS U IO W !,"Unable to shutdown logical link!!!",$C(7),$C(7) Q
+19 ; U IO W "**STOP**"
+20 ; W !
+21 ; D CLOSE^%ZISTCP
+22 ; patch HL*1.6*122 end
End DoDot:1
+23 LOCK -^HLCS(870,HLDP,0)
+24 WRITE !,"The job for the "_HLDAPP_" Lower Level Protocol will be shut down."
+25 QUIT
+26 ;
STOPQ QUIT