added mona monitoring to SAP SFTP
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1 @@
|
||||
LSL2/STPROC/TEST_DANIEL3.txt
|
||||
LSL2/STPROC/TEST_DANIEL3.txt
|
||||
|
@ -62,6 +62,9 @@ Service SendBufferedStatus(MonaResource, StatusName, StatusValue)
|
||||
MonaResource = Environment_Services("GetMonaResource")
|
||||
end
|
||||
|
||||
Prod = Environment_Services('IsProd')
|
||||
If Not(Prod) then GoSub SwapResourceNames
|
||||
|
||||
DateTime = SRP_DateTime('Now')
|
||||
Year = SRP_Datetime("Year", DateTime)
|
||||
Month = SRP_Datetime("Month", DateTime)
|
||||
@ -169,3 +172,19 @@ Service SendBufferedAverageMetric(MonaResource, MetricName, MetricValue)
|
||||
|
||||
end service
|
||||
|
||||
|
||||
SwapResourceNames:
|
||||
|
||||
// Swap out prod resource name with dev resource name
|
||||
Begin Case
|
||||
Case ( (MonaResource EQ 'GRP_OPENINSIGHT_MES_OP_FE_SAP_OUTBOUND') and (StatusName EQ 'SFTP-Interface-Outbound') )
|
||||
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_SAP_OUTBOUND'
|
||||
StatusName = 'SFTP-Interface-Outbound-Dev'
|
||||
|
||||
Case ( (MonaResource EQ 'GRP_OPENINSIGHT_MES_OP_FE_SAP_INBOUND') and (StatusName EQ 'SFTP-Interface-Inbound') )
|
||||
MonaResource = 'GRP_OPENINSIGHT_MES_OP_FE_DEV_SAP_INBOUND'
|
||||
StatusName = 'SFTP-Interface-Inbound-Dev'
|
||||
End Case
|
||||
|
||||
return
|
||||
|
||||
|
@ -58,7 +58,7 @@ Event WINDOW.CREATE(CreateParam)
|
||||
|
||||
AdminUser = Xlate('LSL_USERS', @USER4, LSL_USERS_ADMIN_USER$, 'X')
|
||||
|
||||
If AdminUser then
|
||||
If Not(AdminUser) then
|
||||
ErrMsg('You do not have the proper security to enter Message Notifications...' )
|
||||
Post_Event(@Window, 'CLOSE')
|
||||
end else
|
||||
@ -641,3 +641,4 @@ UnlockRec:
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, Dialog_Box, obj_WO_Log
|
||||
Declare function Error_Services, Environment_Services, Logging_Services, GetCurrentProcessID
|
||||
DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, ErrMsg, Set_Property, obj_Order, Yield, Clear_Table, RList, obj_Notes
|
||||
DECLARE SUBROUTINE Send_Info, Send_Event, Post_Event, obj_Notes, SetInitDirOptions, Send_Info, obj_Shipment, obj_Post_Log
|
||||
DECLARE SUBROUTINE Srp_Run_Command, Error_Services, Logging_Services, FTP_Services
|
||||
DECLARE SUBROUTINE Srp_Run_Command, Error_Services, Logging_Services, FTP_Services, Mona_Services
|
||||
|
||||
$INSERT MSG_EQUATES
|
||||
$INSERT NOTIFICATION_EQU
|
||||
@ -41,9 +41,11 @@ Equ CRLF$ TO \0D0A\
|
||||
Equ LF$ TO \0A\
|
||||
Equ TAB$ TO \09\
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\ScrapIn'
|
||||
LogDate = Oconv(Date(), 'D4/')
|
||||
LogTime = Oconv(Time(), 'MTS')
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\ScrapIn'
|
||||
LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2] : ' ScrapIn.csv'
|
||||
Headers = 'Logging DTM' : @FM : 'User' :@FM: 'WoMatKey' :@FM: 'SAPBatchNo' :@FM: 'TransQty'
|
||||
objLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$)
|
||||
@ -63,8 +65,6 @@ LogFileName = LogDate[7, 4] : '-' : LogDate[1, 2] : '-' : LogDate[4, 2]
|
||||
Headers = 'Logging DTM' : @FM : 'Notes'
|
||||
objSapInboundSftpLog = Logging_Services('NewLog', LogPath, LogFileName, CRLF$, Comma$, Headers, '', False$, False$, True$)
|
||||
|
||||
LoggingDTM = LogDate : ' ' : LogTime ; // Logging DTM
|
||||
|
||||
Main:
|
||||
|
||||
RepoID = ''
|
||||
@ -135,6 +135,7 @@ RETURN Result
|
||||
|
||||
|
||||
* * * * * * *
|
||||
|
||||
SendReconcile:
|
||||
* * * * * * *
|
||||
|
||||
@ -363,6 +364,24 @@ SendReconcile:
|
||||
LogData<2> = stat
|
||||
Logging_Services('AppendLog', objSapOutboundSftpLog, LogData, @RM, @FM)
|
||||
|
||||
GoSub CheckForErrors
|
||||
|
||||
If SftpError then
|
||||
// Send Email to FI_SUPPORT group
|
||||
Recipients = ''
|
||||
SentFrom = 'System'
|
||||
Subject = 'Outbound SFTP error in obj_SAP'
|
||||
Message = 'SFTP output: ':CRLF$:stat
|
||||
AttachWindow = ''
|
||||
AttachKey = ''
|
||||
SendToGroup = 'FI_SUPPORT'
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
obj_Notes('Create',Parms)
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_OUTBOUND', 'SFTP-Interface-Outbound', 'critical')
|
||||
end else
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_OUTBOUND', 'SFTP-Interface-Outbound', 'ok')
|
||||
end
|
||||
|
||||
StopTime = Time()
|
||||
|
||||
IF StopTime - StartTime > 30 THEN
|
||||
@ -1076,6 +1095,24 @@ SendRecord:
|
||||
LogData<2> = stat
|
||||
Logging_Services('AppendLog', objSapOutboundSftpLog, LogData, @RM, @FM)
|
||||
|
||||
GoSub CheckForErrors
|
||||
|
||||
If SftpError then
|
||||
// Send Email to FI_SUPPORT group
|
||||
Recipients = ''
|
||||
SentFrom = 'System'
|
||||
Subject = 'Outbound SFTP error in obj_SAP'
|
||||
Message = 'SFTP output: ':CRLF$:stat
|
||||
AttachWindow = ''
|
||||
AttachKey = ''
|
||||
SendToGroup = 'FI_SUPPORT'
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
obj_Notes('Create',Parms)
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_OUTBOUND', 'SFTP-Interface-Outbound', 'critical')
|
||||
end else
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_OUTBOUND', 'SFTP-Interface-Outbound', 'ok')
|
||||
end
|
||||
|
||||
StopTime = Time()
|
||||
ClearFlag = 1
|
||||
OSDelete DosTable ;* Removes table from C: drive
|
||||
@ -1112,6 +1149,24 @@ ReadInbound:
|
||||
LogData<2> = stat
|
||||
Logging_Services('AppendLog', objSapInboundSftpLog, LogData, @RM, @FM)
|
||||
|
||||
GoSub CheckForErrors
|
||||
|
||||
If SftpError then
|
||||
// Send Email to FI_SUPPORT group
|
||||
Recipients = ''
|
||||
SentFrom = 'System'
|
||||
Subject = 'Inbound SFTP error in obj_SAP'
|
||||
Message = 'SFTP output: ':CRLF$:stat
|
||||
AttachWindow = ''
|
||||
AttachKey = ''
|
||||
SendToGroup = 'FI_SUPPORT'
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
obj_Notes('Create',Parms)
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_INBOUND', 'SFTP-Interface-Inbound', 'critical')
|
||||
end else
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_INBOUND', 'SFTP-Interface-Inbound', 'ok')
|
||||
end
|
||||
|
||||
StopTime = Time()
|
||||
|
||||
IF StopTime - StartTime > 60 Then
|
||||
@ -1143,6 +1198,24 @@ ReadInbound:
|
||||
LogData<2> = stat
|
||||
Logging_Services('AppendLog', objSapInboundSftpLog, LogData, @RM, @FM)
|
||||
|
||||
GoSub CheckForErrors
|
||||
|
||||
If SftpError then
|
||||
// Send Email to FI_SUPPORT group
|
||||
Recipients = ''
|
||||
SentFrom = 'System'
|
||||
Subject = 'Inbound SFTP error in obj_SAP'
|
||||
Message = 'SFTP output: ':CRLF$:stat
|
||||
AttachWindow = ''
|
||||
AttachKey = ''
|
||||
SendToGroup = 'FI_SUPPORT'
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
obj_Notes('Create',Parms)
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_INBOUND', 'SFTP-Interface-Inbound', 'critical')
|
||||
end else
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_INBOUND', 'SFTP-Interface-Inbound', 'ok')
|
||||
end
|
||||
|
||||
StopTime = Time()
|
||||
|
||||
IF StopTime - StartTime > 60 Then
|
||||
@ -1172,6 +1245,24 @@ ReadInbound:
|
||||
LogData<2> = stat
|
||||
Logging_Services('AppendLog', objSapInboundSftpLog, LogData, @RM, @FM)
|
||||
|
||||
GoSub CheckForErrors
|
||||
|
||||
If SftpError then
|
||||
// Send Email to FI_SUPPORT group
|
||||
Recipients = ''
|
||||
SentFrom = 'System'
|
||||
Subject = 'Inbound SFTP error in obj_SAP'
|
||||
Message = 'SFTP output: ':CRLF$:stat
|
||||
AttachWindow = ''
|
||||
AttachKey = ''
|
||||
SendToGroup = 'FI_SUPPORT'
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
obj_Notes('Create',Parms)
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_INBOUND', 'SFTP-Interface-Inbound', 'critical')
|
||||
end else
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_INBOUND', 'SFTP-Interface-Inbound', 'ok')
|
||||
end
|
||||
|
||||
StopTime = Time()
|
||||
|
||||
IF StopTime - StartTime > 60 Then
|
||||
@ -1208,6 +1299,24 @@ ClearInbound:
|
||||
LogData<2> = stat
|
||||
Logging_Services('AppendLog', objSapInboundSftpLog, LogData, @RM, @FM)
|
||||
|
||||
GoSub CheckForErrors
|
||||
|
||||
If SftpError then
|
||||
// Send Email to FI_SUPPORT group
|
||||
Recipients = ''
|
||||
SentFrom = 'System'
|
||||
Subject = 'Inbound SFTP error in obj_SAP'
|
||||
Message = 'SFTP output: ':CRLF$:stat
|
||||
AttachWindow = ''
|
||||
AttachKey = ''
|
||||
SendToGroup = 'FI_SUPPORT'
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
obj_Notes('Create',Parms)
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_INBOUND', 'SFTP-Interface-Inbound', 'critical')
|
||||
end else
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_INBOUND', 'SFTP-Interface-Inbound', 'ok')
|
||||
end
|
||||
|
||||
StopTime = Time()
|
||||
|
||||
IF StopTime - StartTime > 180 THEN
|
||||
@ -1245,6 +1354,24 @@ DirNextSeq:
|
||||
LogData<2> = stat
|
||||
Logging_Services('AppendLog', objSapOutboundSftpLog, LogData, @RM, @FM)
|
||||
|
||||
GoSub CheckForErrors
|
||||
|
||||
If SftpError then
|
||||
// Send Email to FI_SUPPORT group
|
||||
Recipients = ''
|
||||
SentFrom = 'System'
|
||||
Subject = 'Outbound SFTP error in obj_SAP'
|
||||
Message = 'SFTP output: ':CRLF$:stat
|
||||
AttachWindow = ''
|
||||
AttachKey = ''
|
||||
SendToGroup = 'FI_SUPPORT'
|
||||
Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
obj_Notes('Create',Parms)
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_OUTBOUND', 'SFTP-Interface-Outbound', 'critical')
|
||||
end else
|
||||
Mona_Services('SendBufferedStatus', 'GRP_OPENINSIGHT_MES_OP_FE_OI_SAP_OUTBOUND', 'SFTP-Interface-Outbound', 'ok')
|
||||
end
|
||||
|
||||
StopTime = Time()
|
||||
|
||||
IF StopTime - StartTime > 30 THEN
|
||||
@ -1320,3 +1447,47 @@ LogTrans:
|
||||
|
||||
RETURN
|
||||
|
||||
|
||||
* * * * * * * *
|
||||
CheckForErrors:
|
||||
* * * * * * * *
|
||||
|
||||
// Expects "stat" to be populated with output from psftp call via SRP_Run_Command
|
||||
// Looking for keywords from a list of errors in psftp's (i.e., Putty) documentation.
|
||||
// See https://documentation.help/PuTTY/errors.html
|
||||
|
||||
Begin Case
|
||||
Case IndexC(stat, "host key", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "WARNING", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "SSH protocol", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "cipher", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "disconnect", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "memory", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "Unable to use", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "Server refused", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "Access denied", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "No Supported authentication", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "Incorrect CRC", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "garbled", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "proxy", 1)
|
||||
SftpError = True$
|
||||
Case IndexC(stat, "error", 1)
|
||||
SftpError = True$
|
||||
Case Otherwise$
|
||||
SftpError = False$
|
||||
End Case
|
||||
|
||||
return
|
||||
|
||||
|
@ -1,282 +0,0 @@
|
||||
Function Test_Daniel3(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10)
|
||||
#pragma precomp SRP_PreCompiler
|
||||
|
||||
Declare subroutine Set_Property, Set_Status, ErrMsg, Set_Property, obj_AppWindow, Send_Message, Logging_Services
|
||||
Declare subroutine Btree.Extract, Send_Event, Security_Err_Msg, Forward_Event, End_Window, Start_Window, FTP_Services
|
||||
Declare subroutine EditCell, obj_NCR, obj_Notes, Post_Event, obj_WO_Mat, obj_WO_Mat_Log, obj_WO_Wfr, obj_Tables, obj_RDS
|
||||
Declare subroutine Error_Services, RDS_Services, Dialog_Box, Insert, Unlock, QA_Services, Validate, Development_Services
|
||||
Declare subroutine Update_Index, Database_Services, Obj_WO_Mat_QA, Fmt, Yield, WinYield, Sleepery, Qa_Services,
|
||||
Declare subroutine Obj_Post_Log, GaN_Services, Excel_Services, obj_WO_React, Activate_Save_Select, Reduce, FSMsg
|
||||
Declare subroutine SRP_Stopwatch, Copy_Record_To_SQL, SQL_Services, Material_Services, Messaging_Services, Utility
|
||||
Declare subroutine Reactor_Services, Reactor_Services_Dev, SRP_Stopwatch, Btree.Extract, Set_Env, RDS_React_Run
|
||||
Declare subroutine obj_Prod_Spec, Security_Services, Make.List, Write_OI_To_SQL, Send_Info, PSN_Services, Free_Class.Net
|
||||
Declare subroutine Work_Order_Services, Test_Daniel2, obj_RDS_Layer, Report_Services, Pass_To_Sql, SRP_JSON, SRP_Run_Command
|
||||
Declare subroutine Httpclient_Services, SRP_TcpClient, RTI_Set_Debugger, Sleepery, Set_Env, Extract_SI_Keys, Repository
|
||||
Declare subroutine PM_Spec_Services, Push.Select, Pop.Select, GetTempPath, GetEngineVersion
|
||||
Declare function Get_Property, Get_Status, Popup, Send_Message, Msg, Security_Check, Dialog_Box, RowExists, Utility
|
||||
Declare function Dialog_Box, obj_WO_Log, obj_NCR, Check_Notes, obj_MUWafers, obj_WO_Mat, Error_Services, RDS_Services
|
||||
Declare function MemberOf, obj_Tables, obj_RDS, Environment_Services, Logging_Services, Material_Services, ErrMsg
|
||||
Declare function Work_Order_Services, RetStack, Min, Max, Obj_Prod_Spec, Insert, SRP_Trim, Xlate, Obj_Wo_Mat
|
||||
Declare function Security_Services, QA_Services, Database_Services, RowExists, Rti_Lh_Info, UNICODE_ANSI, UNICODE_UTF8
|
||||
Declare function index, Httpclient_Services, SRP_Encode, SRP_Decode, DirList, Obj_Rds_Test, Tool_Parms_Services
|
||||
Declare function SQL_Services, RDS_Services, Obj_WM_out, Schedule_Services, Obj_Tool, SRP_Sort_Array, ICONV
|
||||
Declare function Development_Services, Obj_WO_Mat_QA, SRP_Join_Arrays, NextKey, Obj_Prod_Spec, FTP_Services, SQL_Format
|
||||
Declare function DateTime, GaN_Services, SRP_Array, Excel_Services, EpiPro_Services, Repository, RTI_Task_Submit
|
||||
Declare function RTI_Task_Status, Rds_Services, StartDotNet, Reactor_Services, SRP_Get_FileVersion, Direct_Print
|
||||
Declare function obj_React_Run, RTI_Lock_Owner, obj_WM_In, Get_Repos_Entities, Get_Printer, Schedule_Services
|
||||
Declare function Location_Services, Replication_Services, List_User_Locks, Start_Window, SRP_JSON, SRP_Path
|
||||
Declare function Httpclient_Services, SRP_TcpClient, GetTickCount, Repository, Select_Into, Active_Directory_Services
|
||||
Declare function Rti_Ldap_Groups_For_User, Wafer_Counter_Services, SRP_Logon, SRP_Get_Printers, Printer_Select
|
||||
Declare function RTI_Xlate_Controller, LSL_Users_Services
|
||||
|
||||
$INSERT LOGICAL
|
||||
* $Insert RLIST_EQUATES
|
||||
* $INSERT ENVIRON_CONSTANTS
|
||||
* $Insert REVCAPI_EQUATES
|
||||
* $INSERT MSG_EQUATES
|
||||
* $INSERT APPCOLORS
|
||||
* $INSERT WM_IN_EQUATES
|
||||
* $Insert WM_OUT_EQUATES
|
||||
* $INSERT WO_LOG_EQU
|
||||
* $INSERT WO_STEP_EQU
|
||||
$INSERT WO_MAT_EQUATES
|
||||
* $INSERT ORDER_EQU
|
||||
* $INSERT RDS_EQUATES
|
||||
* $INSERT PROD_SPEC_EQU
|
||||
* $INSERT NOTIFICATION_EQU
|
||||
* $INSERT LSL_USERS_EQU
|
||||
* $INSERT SECURITY_RIGHTS_EQU
|
||||
* $INSERT POPUP_EQUATES
|
||||
* $INSERT RTI_LH_INFO_EQUATES
|
||||
* $INSERT WO_MAT_QA_EQUATES
|
||||
* $INSERT CUST_EPI_PART_EQUATES
|
||||
* $INSERT PRS_STAGE_EQUATES
|
||||
* $Insert RLIST_EQUATES
|
||||
* $Insert CLEAN_INSP_EQUATES
|
||||
* $Insert TOOL_PARMS_EQUATES
|
||||
* $Insert SCHEDULE_EQU
|
||||
* $Insert SCHED_DET_EQUATES
|
||||
* $Insert SCHEDULER_EQUATES
|
||||
* $Insert NCR_EQUATES
|
||||
* $Insert REACT_RUN_EQUATES
|
||||
* $Insert TOOL_EQUATES
|
||||
* $Insert TOOL_LOG_EQUATES
|
||||
* $Insert PM_EQUATES
|
||||
* $Insert WO_WFR_EQUATES
|
||||
$Insert REVDOTNETEQUATES
|
||||
* $Insert REACTOR_EQUATES
|
||||
* $Insert RDS_TEST_EQUATES
|
||||
* $Insert RUN_STAGE_WFR_EQUATES
|
||||
* $Insert RTI_DEBUG_COMMON
|
||||
* $Insert DICT_EQUATES
|
||||
* $Insert SRPMAIL_INSERTS
|
||||
* $Insert SCHED_DET_NG_EQUATES
|
||||
* $Insert RDS_LAYER_EQUATES
|
||||
* $Insert PROD_VER_EQUATES
|
||||
* $Insert PM_SPEC_EQUATES
|
||||
$Insert SHIFT_CALENDAR_EQUATES
|
||||
$Insert LSL_USERS_EQUATES
|
||||
* // 02/22/2023 48312 50112 ; // 5 hours = 14400 seconds
|
||||
* // Reduce modes (for Select statement)
|
||||
* Equ NEW_EXIST$ To 0
|
||||
* Equ NEXT_CUR$ To 1
|
||||
* Equ ADD_EXIST$ To 2
|
||||
*
|
||||
* EQU COL$QA_MET_PHASE_MIN TO 17
|
||||
*
|
||||
Equ Tab$ to \09\
|
||||
Equ CRLF$ to \0D0A\
|
||||
Equ LF$ to \0A\
|
||||
Equ Comma$ to ','
|
||||
|
||||
$Insert PS_EQUATES
|
||||
*
|
||||
* $INSERT PRINTSETUP_EQUATES
|
||||
* equ REV_CREATE_ENGINE_NO_UI$ to 0x040
|
||||
|
||||
Main:
|
||||
* debug
|
||||
* LSLUsers = ''
|
||||
* Open 'LSL_USERS' to hUsers then
|
||||
* EOF = False$
|
||||
* Select hUsers
|
||||
* Loop
|
||||
* Readnext UserId else EOF = True$
|
||||
* Until EOF
|
||||
* LSLUsers<-1> = UserId
|
||||
* If Not(RowExists('NOTE_PTRS', UserId)) then
|
||||
*
|
||||
* Database_Services('WriteDataRow', 'NOTE_PTRS', UserId, '', True$, False$, True$)
|
||||
* end
|
||||
* Repeat
|
||||
* end
|
||||
* Ptrs = ''
|
||||
* Open 'NOTE_PTRS' to hPtrs then
|
||||
* EOF = False$
|
||||
* Select hPtrs
|
||||
* Loop
|
||||
* Readnext Ptr else EOF = True$
|
||||
* Until EOF
|
||||
* Ptrs<-1> = Ptr
|
||||
*
|
||||
* Repeat
|
||||
* end
|
||||
*
|
||||
* Diff = SRP_Array('Join', LSLUsers, Ptrs, 'AND', @FM)
|
||||
*
|
||||
* return
|
||||
|
||||
* return
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,ACTIVE_DIRECTORY_SERVICES', '', '', '')
|
||||
Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,COMM_NOTE_PTRS', '', '', '')
|
||||
Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NOTE_PTRS_ACTIONS', '', '', '')
|
||||
Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NOTES_SERVICES', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,DATABASE_SERVICES', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,LSL_USERS_SERVICES', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NDW_AUDIT_REPORT_EVENTS', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NDW_MAIN_EVENTS', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NDW_SCHEDULE_SEARCH_EVENTS', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NOTE_MESSAGE', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,NOTES_SERVICES', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_NOTE_PTRS', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_NOTES_SENT', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_NOTES', '', '', '')
|
||||
*
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_PROD_SPEC', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,OBJ_REACTOR_LOG', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,PRINT_WO_MASTER_SCHEDULER', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,SQL_SERVICES', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,SVC_SCHEDULER', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,TOOL_SERVICES', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,WAFER_COUNTER_SERVICES', '', '', '')
|
||||
* Messaging_Services('SendMessage', 'RunProcedure', 'Request', '', 'All', 'RTP27,WO_SET_SCHEDULE', '', '', '')
|
||||
|
||||
|
||||
* debug
|
||||
* Recipients = ''
|
||||
* SentFrom = @USER4
|
||||
*
|
||||
* SendToGroup = 'RDS_HOLD' : @VM : 'FI_SUPPORT'
|
||||
*
|
||||
* Subject = 'Testing 2'
|
||||
* Message = 'Testing 1234'
|
||||
* AttachWindow = ''
|
||||
* AttachKey = ''
|
||||
*
|
||||
* Parms = Recipients:@RM:SentFrom:@RM:Subject:@RM:Message:@RM:AttachWindow:@RM:AttachKey:@RM:SendToGroup
|
||||
* obj_Notes('Create',Parms)
|
||||
*
|
||||
*
|
||||
return
|
||||
|
||||
* Main:
|
||||
* debug
|
||||
* Open 'LSL_USERS' to hTable then
|
||||
* EOF = False$
|
||||
* Select hTable
|
||||
* Loop
|
||||
* Readnext KeyID else EOF = True$
|
||||
* Until EOF
|
||||
* ReadV Shift from hTable, KeyID, LSL_USERS_SHIFT$ then
|
||||
* Commit = True$
|
||||
* Begin Case
|
||||
* Case Shift EQ 1
|
||||
* NewShift = 'A'
|
||||
* Case Shift EQ 2
|
||||
* NewShift = 'B'
|
||||
* Case Shift EQ 3
|
||||
* NewShift = 'C'
|
||||
* Case Shift EQ 4
|
||||
* NewShift = 'D'
|
||||
* Case Shift EQ 'M-F'
|
||||
* NewShift = ''
|
||||
* Case Otherwise$
|
||||
* Commit = False$
|
||||
* End Case
|
||||
* If Commit then
|
||||
* WriteV NewShift on hTable, KeyID, LSL_USERS_SHIFT$ else
|
||||
* debug
|
||||
* end
|
||||
* end
|
||||
* end else
|
||||
* debug
|
||||
* end
|
||||
* Repeat
|
||||
* end
|
||||
*
|
||||
* Return
|
||||
|
||||
|
||||
Main2:
|
||||
|
||||
For FiscalYear = 2022 to 2025 Step 1
|
||||
|
||||
FiscalWeeks = Xlate('FISCAL_YR', FiscalYear, 'WK_NO', 'X')
|
||||
FiscalStartDts = Xlate('FISCAL_YR', FiscalYear, 'WK_START_DT', 'X')
|
||||
FiscalEndDts = Xlate('FISCAL_YR', FiscalYear, 'WK_END_DT', 'X')
|
||||
FiscalMonthNos = Xlate('FISCAL_YR', FiscalYear, 'WK_MONTH_NO', 'X')
|
||||
FiscalQtrs = Xlate('FISCAL_YR', FiscalYear, 'WK_QTR_NO', 'X')
|
||||
|
||||
For each FiscalWeek in FiscalWeeks using @VM setting vPos
|
||||
|
||||
FiscalStartDt = FiscalStartDts<0, vPos>
|
||||
FiscalEndDt = FiscalEndDts<0, vPos>
|
||||
If FiscalMonthNos<0, vPos> NE '' then
|
||||
FiscalMonthNo = FiscalMonthNos<0, vPos>
|
||||
end
|
||||
If FiscalQtrs<0, vPos> NE '' then
|
||||
FiscalQtr = FiscalQtrs<0, vPos>
|
||||
end
|
||||
|
||||
For InternalDate = FiscalStartDt to FiscalEndDt Step 1
|
||||
|
||||
FirstShiftRec = ''
|
||||
SecondShiftRec = ''
|
||||
|
||||
OutDate = OConv(InternalDate, 'D4/')
|
||||
OutDatePlusOne = OConv(InternalDate + 1, 'D4/')
|
||||
FirstShiftStartTime = '06:00:00AM'
|
||||
FirstShiftStartDtm = OutDate : ' ' : FirstShiftStartTime
|
||||
FirstShift = LSL_Users_Services('GetShiftByDate', FirstShiftStartDtm)
|
||||
FirstShiftEndDtm = OutDate : ' 5:59:59PM'
|
||||
SecondShiftStartTime = '06:00:00PM'
|
||||
SecondShiftStartDtm = OutDate : ' ' : SecondShiftStartTime
|
||||
SecondShift = LSL_Users_Services('GetShiftByDate', SecondShiftStartDtm)
|
||||
|
||||
SecondShiftEndDtm = OutDatePlusOne : ' 05:59:59AM'
|
||||
|
||||
ShiftDate = OConv(InternalDate, 'DH')
|
||||
ShiftMonth = Field(ShiftDate, ' ', 1, 1)
|
||||
ShiftDay = Field(ShiftDate, ' ', 1, 2)
|
||||
Convert ' ' to '' in ShiftDay
|
||||
ShiftYear = Field(ShiftDate, ' ', 3, 1)
|
||||
|
||||
FirstShiftKey = ShiftDay : '*' : FiscalYear : '*' : FirstShift
|
||||
SecondShiftKey = ShiftDay : '*' : FiscalYear : '*' : SecondShift
|
||||
|
||||
FirstShiftRec<SHIFT_CALENDAR.START_DTM$> = IConv(FirstShiftStartDtm, 'DT')
|
||||
FirstShiftRec<SHIFT_CALENDAR.END_DTM$> = IConv(FirstShiftEndDtm, 'DT')
|
||||
FirstShiftRec<SHIFT_CALENDAR.FISCAL_WEEK$> = 'WW':FiscalWeek; // Just use Fiscal year week. Ask Evan if ISOWW is necessary
|
||||
FirstShiftRec<SHIFT_CALENDAR.FISCAL_MONTH$> = FiscalMonthNo
|
||||
FirstShiftRec<SHIFT_CALENDAR.FISCAL_QUARTER$> = 'Q':FiscalQtr
|
||||
|
||||
Database_Services('WriteDataRow', 'SHIFT_CALENDAR', FirstShiftKey, FirstShiftRec)
|
||||
|
||||
SecondShiftRec<SHIFT_CALENDAR.START_DTM$> = IConv(SecondShiftStartDtm, 'DT')
|
||||
SecondShiftRec<SHIFT_CALENDAR.END_DTM$> = IConv(SecondShiftEndDtm, 'DT')
|
||||
SecondShiftRec<SHIFT_CALENDAR.FISCAL_WEEK$> = 'WW':FiscalWeek; // Just use Fiscal year week. Ask Evan if ISOWW is necessary
|
||||
SecondShiftRec<SHIFT_CALENDAR.FISCAL_MONTH$> = FiscalMonthNo
|
||||
SecondShiftRec<SHIFT_CALENDAR.FISCAL_QUARTER$> = 'Q':FiscalQtr
|
||||
|
||||
Database_Services('WriteDataRow', 'SHIFT_CALENDAR', SecondShiftKey, SecondShiftRec)
|
||||
|
||||
Next InternalDate
|
||||
|
||||
Next FiscalWeek
|
||||
|
||||
Next FiscalYear
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user