/**/
trace o
arg input
call a_initial
if result = 0 then do
call b_accfiles
if result = 0 then do
call c_procstor
end
end
finalrc = result
call z_terminate
exit result
a_initial:
call setlocal
LogFile       = 'CHKSTORE.ERR'
UserNotifyEXE = 'CHKINFRM.EXE'
UserNotifyCMD = 'CHKINFRM.CMD'
CHKAlertEXE   = 'CHKALERT.EXE'
CHKAlertCMD   = 'CHKALERT.CMD'
CHKRecoverEXE = 'CHKRECVR.EXE'
CHKRecoverCMD = 'CHKRECVR.CMD'
LogFileOpen   = 0
OutputOpen    = 0
swopok        = 0
swoprequired  = 0
parse source . . thisprg .
thisprg_drive = filespec('drive',thisprg)
thisprg_path = filespec('path',thisprg)
prgpath = thisprg_drive||thisprg_path
call directory prgpath
signal on syntax
call on halt
'@ECHO OFF'
call aa_nlssetup
call ab_otherinit
if result = 0 then do
call ac_parameters
if result = 0 then ,
call x_msg '20' , version
end
return result
aa_nlssetup:
esc = '1b'x'['
normal = esc'0;37;40m'
crlf = '0d'x||'0a'x
msg.1 = "CHK0001E: Cannot locate LAN Requester code on this machine, program terminating..."
msg.2 = "CHK0002E: Cannot locate OS/2 boot drive on this machine, program terminating...."
msg.3 = "CHK0003E: No Userid is logged on, program terminating...."
msg.4 = "CHK0004E: Unable to locate database as error occured trying to resolve alias %1. Error was %2."
msg.5 = "CHK0005W: A new database is being created probably by another CHKSTORE"||crlf
msg.5 = msg.5||"          or CHKUNREV action. Program cannot continue."
msg.7 = "CHK0007E: Unable to Open New Database file, program terminating"||crlf
msg.7 = msg.7||"          possible causes are :-"||crlf
msg.7 = msg.7||"          1. Administrator id not logged on"||crlf
msg.8 = "CHK0008E: Unable to Open Database file, program terminating"||crlf
msg.8 = msg.8||"          possible causes are :-"||crlf
msg.8 = msg.8||"          1. Administrator id not logged on"||crlf
msg.9 = "CHK0009I: No users with storage limits on their home directories"
msg.10 = "CHK0010E: Unable to access storage information, Administrator id not logged on"
msg.11 = "CHK0011I: Processing %1"
msg.12 = "CHK0012I: used = %1, allowed = %2, percent = %3, warning limit = %4"
msg.13 = "CHK0013I: changing acl access for %1 on %2 owned by user %3"
msg.14 = "CHK0014E: Unable to change access permissions for %1 on server %2"
msg.14 = msg.14||"          return code was %3, userid will be skipped"
msg.15 = "CHK0015W: Attempt %1 to swop database files failed. %2 attempts remaining"
msg.16 = "CHK0016W: Unable to determine how much space %1 has used, 0 assumed"
msg.17 = "CHK0017E: REXXUTIL.DLL or CHKSTDLL.DLL could not be accessed. Please ensure"||crlf
msg.17 = msg.17||"          that these DLLs are in a directory specified in the LIBPATH"
msg.18 = "CHK0018I: An external interrupt was received (CTRL-C most likely). CHKSTORE"||crlf
msg.18 = msg.18||"          will terminate, database and users remain unmodified."
msg.19 = "CHK0019E: Unable to find a domain server for domain %1"
msg.20 = "CHK0020I: CHKSTORE version %1 Initialisation completed"
msg.21 = "CHK0021W: Unable to get access permissions for %1"||crlf
msg.21 = msg.21||"          on server %2, user not processed"
msg.22 = "CHK0022E: SERIOUS ERROR ****** Database file could not be updated ******, CHKSTORE"||crlf
msg.22 = msg.22||"          should not be allowed to run again until a manual swop has been done"||crlf
msg.22 = msg.22||"          The new database file will remain."
msg.23 = "CHK0023E: Users have been modified, but a system error occured. Please review"||crlf
msg.23 = msg.23||"          the CHKSTORE log for more information. Database recovery will"||crlf
msg.23 = msg.23||"          be required."
msg.24 = "CHK0024I: Revoking home directory owned by %1"
msg.25 = "CHK0025I: Unrevoking homedirectory owned by %1"
msg.26 = "CHK0026W: An external interrupt was received (CTRL-C most likely). CHKSTORE"||crlf
msg.26 = msg.26||"          CANNOT terminate as users have been modified. CHKSTORE must"||crlf
msg.26 = msg.26||"          complete to ensure the database is accurate..."
msg.27 = "CHK0027W: CHKSTORE Database recovery is being initiated"
msg.28 = "CHK0028E: A new database file exists, but no CHKSTORE, CHKUNREV or"||crlf
msg.28 = msg.28||"          CHKRECVR running. Database recovery is -->REQUIRED<--"||crlf
msg.28 = msg.28||"          but no automatic recovery was requested."
msg.29 = "CHK0029E: an unknown error %1 occurred trying to access"||crlf
msg.29 = msg.29||"          an existing new database file. Program Terminating"
msg.30 = "CHK0030E: CHKSTORE failed to update its database. Program Terminating"
msg.31 = "CHK0031I: CHKSTORE restricted from running at %1 on %2"
msg.32 = "CHK0032W: Unable to read the CHKSTORE restriction file, CHKSTORE will run"
msg.33 = "CHK0033E: Error %1 trying to get account info for %2 on"||crlf
msg.33 = msg.33||"          domain controller %3. Program Terminating"
msg.34 = "CHK0034E: Error %1 From Database recovery. CHKSTORE has"||crlf
msg.34 = msg.34||"          serious problems and requires manual assistance"
msg.35 = "CHK0035E: Database Recovery requested, but the recover database program"||crlf
msg.35 = msg.35||"          is not installed. Program Terminating."
bm = center("****** A C C E S S   R E V O K E D ******",60)||crlf
bm = bm||center("Your access to your home directory has been revoked.",66)||crlf
bm = bm||center("This is due to you using more space than you have been allocated.",66)||crlf
bm = bm||center("You can only delete and read files from your home directory now",66)
sendrevokemsg = bm
bm = center("****** U N R E V O K E D ******",66)||crlf
bm = bm||center("You now have full privileges for your home directory",66)
sendunrevokemsg = bm
ChkStorTag = 'USER'
unknown = 'UNKNOWN'
drop bm crlf
return 0
ab_otherinit:
version = '2.12'
OutputFile = 'CHKSTORE.DBN'
ChkstorFile = 'CHKSTORE.DBF'
RestrictFile = 'CHKNORUN.FIL'
req_default = '1'
retry_limit = 10
retry_delay = 10
call RxFuncAdd "SysLoadFuncs" , "REXXUTIL" , "SysLoadFuncs"
call SysLoadFuncs
call RxFuncAdd "ChkStLoadFuncs" , "CHKSTDLL" , "ChkStLoadFuncs"
call ChkStLoadFuncs
do i = 1 to queued() ; pull . ; end
dpath = translate(value('DPATH',,'OS2ENVIRONMENT'))
Lanloc = pos(':\IBMLAN\NETPROG',dpath)
if lanloc <> 0 then SrvDrive = substr(dpath,Lanloc-1,1)
else do
call x_msg '1'
return 1
end
os2loc = pos(':\OS2',dpath)
if os2loc <> 0 then OS2Drive = substr(dpath,os2loc-1,1)
else do
call x_msg '2'
return 2
end
path = prgpath';'SrvDrive':\MUGLIB;'OS2Drive':\OS2;'SrvDrive':\IBMLAN\NETPROG'
path = value('PATH',path,'OS2ENVIRONMENT')
if stream(RestrictFile,'c','query exists') <> '' then do
curday = translate(date('W'))
parse value time() with hh':'mm':'ss
curtime = hh':'mm
entries = ChkStReadFile(RestrictFile)
if pos('ERROR:',entries) <> 0 then do
call x_msg '32'
return 0
end
do i = 1 to entries
parse upper var filedata.i myday hh':'mm':'ss hhe':'mme':'sse .
if length(hh) = 1 then hh = '0'hh
if length(hhe) = 1 then hhe = '0'hhe
if length(mm) = 1 then mm = '0'mm
if length(mme) = 1 then hh = '0'mme
mytimestart = hh':'mm
mytimeend = hhe':'mme
if left(curday,length(myday)) = myday then do
if curtime >= mytimestart & curtime <= mytimeend then do
call x_msg '31' , curtime , curday
return -1
end
end
end
end
return 0
ac_parameters:
if left(input,1) = '?' then do
call aca_help_chkstore
return -1
end
parse var input '/D:'default_limit .
parse var input '/R:'acls .
parse var input '/RI:'acls .
parse var input '/DB:'db_location .
parse var input '/W:'warning_percent .
parse var input '/I:'inform_flag .
alert = 'N'
quietflag = 'Y'
simexe = 0
ignore = 0
if pos('/R',input) <> 0 & acls = '' then acls = 'RWCDAXP'
if pos('/RI',input) <> 0 then ignore = 1
if pos('/A',input) <> 0 then alert = 'Y'
if pos('/N',input) <> 0 then quietflag = 'N'
if pos('/SIM',input) <> 0 then simexe = 1
if datatype(default_limit,'Num') <> 1 then default_limit = 10240
if datatype(warning_percent,'Num') <> 1 then warning_percent = 80
inform_flag = left(inform_flag,1)
if pos(inform_flag,'RUBE') = 0 then inform_flag = 'N'
if db_location = '' then db_location = 'LOGON'
parse value ChkStNetUser() with myuserid computername domain
if domain = '' then do
call x_msg '3'
return 3
end
domain_server = ChkStDCName(domain)
if pos('ERROR',domain_server) <> 0 then do
call x_msg '19',domain
return 19
end
if left(db_location,1) <> '\' & substr(db_location,2,1) <> ':' & ,
left(db_location,1) <> '.' then do
parse value ChkStNetAlias(domain_server,db_location) with alias_server alias_path
if pos('ERROR',alias_server) <> 0 then do
call x_msg '4' , db_location , alias_server
return 4
end
if strip(alias_server,'L','\') <> computername then ,
alias_drive  = alias_server'\'translate(alias_path,'$',':')
else
alias_drive = alias_path
end
else ,
alias_drive = strip(db_location,'t','\')
OutputFile = alias_drive||'\'||OutputFile
ChkstorFile = alias_drive||'\'||ChkstorFile
return 0
aca_help_chkstore:
say 'CHKSTORE - Version' version
say '(c) Copyright International Business Machines Corporation 1994.'
say 'All rights Reserved'
say
say 'CHKSTORE - This system will utilise the CHKSTOR.EXE output to determine    '
say '           whether a user has exceeds their maximum storage limit or not.  '
say '           If they have they are "revoked". A "revoked" user will be       '
say '           "unrevoked" if they have gone under there limit.                '
say
say 'calling convention'
say '------------------'
say 'CHKSTORE /D:default_limit /W:warning_percent /I:inform_flag /A /N /SIM'
say '         /DB:db_location (/R:acls | /RI:acls)'
'pause'
say
say 'where :-'
say '  default_limit   : the actual allowed limit if a user only has 1Kb of disk'
say '                    storage. If not specified, default is 10240 Kb (10MB)'
say '  warning_percent : if the user exceeds this percentage value of disk space'
say '                    allowed then the user will receive a warning message. If'
say '                    not specified, then the default is 80%'
say '  inform_flag     : inform the user via NETPOPUP message if they have been'
say '                    revoked, unrevoked or both situations. If not specified'
say '                    the default is no informing done. The options are :-'
say '                    R - inform user if they are revoked only'
say '                    U - inform user if they are unrevoked only'
say '                    B - inform user if revoked or unrevoked'
say '                    E - call user exit to handle informing users'
say '  db_location     : specify a different location for the CHKSTORE database'
say '                    can be an alias, UNC name or local drive specification'
say '                    If not specified then default is the LOGON alias'
say '  acls            : The acls to use for automatic recovery of the CHKSTORE'
say '                    database for revoked homedirectory users. /R: or /RI:'
say '                    implies use RWCDAXP. /R: specifies recover using existing'
say '                    database information. /RI: specifies ignore any database '
say '                    files. if /R: or /RI: is not specified, no recovery will '
say '                    be done.'
say '  /A              : if this parameter is included, alerts are generated for'
say '                    any user over their storage limit'
'pause'
say '  /N              : if this parameter is included then CHKSTORE will output'
say '                    which user is currently being processed'
say '  /SIM            : use this parameter ONLY if you have experienced a problem'
say '                    with CHKSTORE, for example a SYS3175 error. It bypasses'
say '                    the call to CHKSTOR.EXE'
return
b_accfiles:
parse value ChkStNetUser() with . . check
if check = '' then do
call x_msg '3'
return 3
end
OutputOpen = 0
if stream(OutputFile,'c','query exists') <> '' then do
rc = stream(OutputFile,'c','open')
if rc = 'READY:' then do
rc = stream(OutputFile,'c','close')
if acls <> '' then do
call x_msg '27'
if db_location <> 'LOGON' then CHKRecoverParms = '/DB:'db_location
else CHKRecoverParms = ''
if quietflag = 'N' then CHKRecoverParms = CHKRecoverParms '/N'
if ignore = 1 then CHKRecoverParms = CHKRecoverParms '/I'
CHKRecoverParms = CHKRecoverParms '/R:'acls '/S /L'
if stream(CHKRecoverEXE,'c','query exists') <> '' | stream(CHKRecoverCMD,'c','query exists') <> '' then do
if stream(ChkAlertEXE,'c','query exists') <> '' then ChkAlertEXE 'RECVR'
else if stream(ChkAlertCMD,'c','query exists') <> '' then 'call' ChkAlertCMD 'RECVR'
if stream(CHKRecoverEXE,'c','query exists') <> '' then CHKRecoverEXE CHKRecoverParms
else if stream(CHKRecoverCMD,'c','query exists') <> '' then 'call' CHKRecoverCMD CHKRecoverParms
end
else do
call x_msg '35'
return 35
end
if rc <> 0 then do
call x_msg '34' , rc
return 34
end
end
else do
call x_msg '28'
return 28
end
end
else do
if rc = 'NOTREADY:32' then do
call x_msg '5'
return 5
end
else do
call x_msg '29' , rc
return 29
end
end
end
rc = stream(OutputFile,'c','open')
if rc <> 'READY:' then do
call x_msg '7'
return 7
end
OutputOpen = 1
revcnt = 0
revoke_user = ''
if stream(ChkstorFile,'c','query exists') <> '' then do
entries = ChkStReadFile(ChkstorFile)
if pos('ERROR:',entries) <> 0 then do
call x_msg '8'
return 8
end
do i = 1 to entries
if SubStr(filedata.i,25,1) = 'R' then do
revoke_user = revoke_user strip(left(filedata.i,8))
revcnt = revcnt + 1
revoke_user.revcnt  = filedata.i
end
end
revoke_user.0 = revcnt
end
output = left(version,8)||date()||' 'time()
rc = lineout(OutputFile,output)
if rc <> 0 then do
call x_msg '30'
return 30
end
return 0
c_procstor:
if simexe = 0 then do
chkstorparm = '/DOMAIN:'domain '/ALL /alerts:no'
if left(alert,1) = 'Y' then chkstorparm = '/DOMAIN:'domain '/ALL /alerts:yes'
'CHKSTOR' chkstorparm '2>&1 | RXQUEUE /FIFO'
if queued() = 0 then do
call x_msg '9'
swopok = 1
return 0
end
if queued() = 2 then do
call x_msg '10'
pull .
pull .
return 10
end
found = 0
do until found = 1
pull rubbish .
if rubbish = ChkstorTag then do
found = 1
pull .
end
end
do queued()
pull chkstout
call ca_procuser chkstout
if result > 0 then return result
if swoprequired = 0 then swoprequired = -1
rc = lineout(OutputFile,database_output)
if rc <> 0 then do
call x_msg '30'
return 30
end
end
swopok = 1
end
else do
count = ChkStAllUsers(domain_server)
if pos("ERROR",count) <> 0 then do
call x_msg '10'
return 10
end
if count = 0 then do
call x_msg '9'
swopok = 1
return 0
end
do i = 1 to count
parse value ChkStHomeDir(domain_server,user_name.i) with allowed path
if pos('ERROR:',allowed) <> 0 then do
call x_msg '33' , user_name.i , domain_server
return 33
end
if allowed <> -1 & path <> '' then do
path = strip(path)
if left(path,1) = '\' then ,
parse var path '\\'server'\'drive'$'pathname
else ,
parse var path homedrv'\'server'\'drive'$'pathname
if computername <> server then ,
used = ChkStSpaceCnt('\\'server'\'drive'$'pathname'\*.*')
else ,
used = ChkStSpaceCnt(drive':'pathname'\*.*')
call ca_procuser user_name.i allowed trunc(used/1024) path
if result > 0 then return result
if swoprequired = 0 then swoprequired = -1
rc = lineout(OutputFile,database_output)
if rc <> 0 then do
call x_msg '30'
return 30
end
end
end
swopok = 1
end
return 0
ca_procuser:
arg userid allowed used path
call x_msg '11' , userid
path = strip(path)
if left(path,1) = '\' then ,
parse var path '\\'server'\'drive'$'pathname
else ,
parse var path homedrv'\'server'\'drive'$'pathname
if allowed = req_default then allowed = default_limit
if used = unknown then do
used = 0
call x_msg '16' , userid
end
if allowed <> 0 then ,
percent = used/allowed * 100
else
percent = 99999999
call x_msg '12' , used , allowed , percent , warning_percent
database_output = left(userid,8,' ')||left(used,8,' ')||left(allowed,8,' ')
revpos = wordpos(userid,revoke_user)
if used > allowed then do
if revpos = 0 then do
call x_msg '24' , userid
call cab_procacc
if result <> 0 then return result
if savedaccess <> '' then ,
call caa_chgaccess
if result <> 0 then return 0
if (inform_flag = 'R' | inform_flag = 'B') then ,
call ChkStNetSend userid,sendrevokemsg
if inform_flag = 'E' then do
if stream(UserNotifyEXE,'c','query exists') <> '' then UserNotifyEXE 'CHKREVK' userid used allowed
else if stream(UserNotifyCMD,'c','query exists') <> '' then 'call' UserNotifyCMD 'CHKREVK' userid used allowed
end
database_output = database_output||'R'||oldaccess
end
else do
savedaccess = substr(revoke_user.revpos,25,length(revoke_user.revpos)-24)
database_output = database_output||savedaccess
end
end
else do
if revpos <> 0 then do
savedaccess = substr(revoke_user.revpos,26,length(revoke_user.revpos)-25)
call x_msg '25' , userid
call caa_chgaccess
if result <> 0 then do
savedaccess = substr(revoke_user.revpos,25,length(revoke_user.revpos)-24)
database_output = database_output||savedaccess
return 0
end
if (inform_flag = 'U' | inform_flag = 'B') & left(savedaccess,1) <> ' ' then ,
call ChkStNetSend userid,sendunrevokemsg
if inform_flag = 'E' & left(savedaccess,1) <> ' ' then do
if stream(UserNotifyEXE,'c','query exists') <> '' then UserNotifyEXE 'CHKREST' userid used allowed
else if stream(UserNotifyCMD,'c','query exists') <> '' then 'call' UserNotifyCMD 'CHKREST' userid used allowed
end
end
if percent >= warning_percent then do
database_output = database_output||'W'
if inform_flag = 'E' then do
if stream(UserNotifyEXE,'c','query exists') <> '' then UserNotifyEXE 'CHKWARN' userid used allowed
else if stream(UserNotifyCMD,'c','query exists') <> '' then 'call' UserNotifyCMD 'CHKWARN' userid used allowed
end
end
end
return 0
caa_chgaccess:
if computername <> server then ,
call SysFileTree '\\'server'\'drive'$'||pathname'\*.*' , 'subdir' , 'SD'
else ,
call SysFileTree drive':'||pathname'\*.*' , 'subdir' , 'SD'
call x_msg '13' , drive':'||pathname , server , userid
if left(savedaccess,1) <> ' ' then do
accuser.1 = userid
accacl.1 = left(savedaccess,7)
count = 1
end
else count = 0
start = 8
do while length(savedaccess) > start
count = count + 1
accuser.count = strip(substr(savedaccess,start,9))
accacl.count = strip(substr(savedaccess,start+9,7))
start = start + 16
end
accuser.0 = count
accacl.0 = count
if server <> computername then ,
rc = ChkStSetAcc('\\'server,drive':'||pathname)
else ,
rc = ChkStSetAcc('',drive':'||pathname)
if rc <> 0 then do
call x_msg '14' , drive':'pathname , server , rc
return 14
end
swoprequired = 1
do subloop = 1 to subdir.0
parse var subdir.subloop . . . . directory
directory = strip(directory)
if left(directory,1) = '\' then ,
parse var directory '\\'.'\'.'$'accpath
else ,
parse var directory ':'accpath
call x_msg '13' , drive':'||accpath , server , userid
if server <> computername then ,
rc = ChkStSetAcc('\\'server,drive':'||accpath)
else ,
rc = ChkStSetAcc('',drive':'||accpath)
if rc <> 0 then do
call x_msg '14' , drive':'||accpath , server , rc
return 14
end
end
return 0
cab_procacc:
oldaccess = ''
useraccess = '       '
savedaccess = ''
if server <> computername then ,
count = ChkStGetAcc('\\'server,drive':'||pathname)
else ,
count = ChkStGetAcc('',drive':'||pathname)
if pos('ERROR',count) <> 0 then do
call x_msg '21' , drive':'||pathname , server
return -1
end
do accloop = 1 to count
if accuser.accloop <> userid then do
if pos('W',accacl.accloop) <> 0 | pos('C',accacl.accloop) <> 0 | pos('P',accacl.accloop) <> 0 then do
oldaccess = oldaccess||left(accuser.accloop,9)||left(accacl.accloop,7)
savedaccess = savedaccess||left(accuser.accloop,9)||'RDA    '
end
end
else useraccess = left(accacl.accloop,7)
end
oldaccess = useraccess||oldaccess
savedaccess = 'RDA    '||savedaccess
return 0
x_msg:
msgno = arg(1)
do argloop = 2 to arg()
mypos = argloop - 1
field.mypos = arg(argloop)
end
msgcol = normal
msgout = msg.msgno
msgtype = substr(msgout,8,1)
startpos = 1
endflag = 0
do until endflag = 1
replacepoint = pos(' %',msgout,startpos)
if replacepoint <> 0 then do
if replacepoint+1 = length(msgout) then endflag = 1
else startpos = replacepoint + 3
fieldno = substr(msgout,replacepoint+2,1)
if datatype(fieldno,'num') = 1 then do
msgout = left(msgout,replacepoint)||field.fieldno||right(msgout,length(msgout)-replacepoint-2)
end
end
else endflag = 1
end
if msgtype = 'E' then do
if LogFileOpen = 0 then do
rc = stream(LogFile,'c','open')
rc = stream(LogFile,'c','seek <0')
rc = lineout(LogFile,'Error Log start time:'date() time())
LogFileOpen = 1
end
rc = lineout(LogFile,msgout)
call lineout "STDERR:",esc'1;31;40m'||msgout||normal
call beep 200,300
end
else do
if msgtype = 'W' then do
if LogFileOpen = 0 then do
rc = stream(LogFile,'c','open')
rc = stream(LogFile,'c','seek <0')
rc = lineout(LogFile,'Error Log start time:'date() time())
LogFileOpen = 1
end
rc = lineout(LogFile,msgout)
msgcol = esc'1;32;40m'
say msgcol||msgout||normal
end
else do
msgcol = normal
if quietflag <> 'Y' then ,
say msgcol||msgout||normal
end
end
return 0
z_terminate:
if OutputOpen = 1 then ,
rc = stream(OutputFile,'c','close')
OutputOpen = 0
if swoprequired <> 0 then do
if swopok = 1 then do
i = 0
do while i < retry_limit
rc = 0
if stream(ChkstorFile,'c','query exists') <> '' then ,
rc = SysFileDelete(ChkstorFile)
if rc = 0 then do
RenameFile = filespec("name",ChkstorFile)
'RENAME' OutputFile RenameFile '1>NUL 2>NUL'
i = retry_limit
end
else do
i=i+1
call x_msg '15' , i , retry_limit-i
if i < retry_limit then ,
call SysSleep retry_delay
else do
call x_msg '22'
end
end
end
end
else do
call x_msg '23'
finalrc = 23
end
end
swoprequired = 0
swopok = 0
If LogFileOpen = 1 then do
rc = lineout(LogFile,'Error Log end time:'date() time())
rc = lineout(LogFile,'')
rc = stream(LogFile,'c','close')
LogFileOpen = 0
end
do queued(); pull .; end
if finalrc >= 0 then do
if stream(ChkAlertEXE,'c','query exists') <> '' then ChkAlertEXE 'TERM' finalrc
else if stream(ChkAlertCMD,'c','query exists') <> '' then 'call' ChkAlertCMD 'TERM' finalrc
end
call endlocal
return finalrc
syntax:
signal off syntax
where = SigL
say 'Syntax Error in line' where 'occured'
call x_msg '17'
finalrc = 17
call z_terminate
exit finalrc
halt:
call off halt
if swoprequired <> 1 then do
swoprequired = 0
call x_msg '18'
finalrc = 0
call z_terminate
rc = SysFileDelete(OutputFile)
exit finalrc
end
else do
call x_msg '26'
call on halt
return
end
