Hello, Sathish, I recently published test-data app that utilizes a shell script to create a test file:

InterSystems Open Exchange
 

facture.cls defines the parameters for the RunScript classmethod.

ClassMethod DefineProductScript(
  pName As %String = "Demo2",
  pDebug As %Integer = 0) As %Status
  {
  Set pQuery = "SELECT ID from dc_iris.product WHERE Name = '?'"
  Set pQuery = $Replace(pQuery,"?",pName)
  Write:pDebug pQuery,!
  Set tSC = ##class(dc.iris.util).ExecuteQueryOneValue(pQuery,.oProduct)
  Write:pDebug tSC,!
  Set oProduct = ##class(dc.iris.product).%OpenId(oProduct)
  If ($IsObject(oProduct) = 0) Set oProduct = ##class(dc.iris.product).%New()
  Do:pDebug $System.OBJ.Dump(oProduct)
  Set oProduct.ClassName = "dc.iris.product"
  Set oProduct.MethodName = "RunScript"
  Set oProduct.RunCmd = "/opt/irisbuild/demo.sh"
  Set pRandom = "random"
  Set pOutput = "/opt/transform/practice/"
  Set pTemplate = "/usr/irissys/mgr/data/"
  Set oProduct.RunParam1 = "$Qty"
  Set oProduct.RunParam2 = pRandom
  Set oProduct.RunParam3 = pOutput
  Set oProduct.RunParam4 = pTemplate
  Set oProduct.Name = pName
  //Set oProduct.TargetPath = "/opt/transform/practice/"
  Set tSC = oProduct.%Save()
  Quit tSC
  }
ClassMethod RunScript(
  pProduct,
  pQuantity) As %Status
  {
  Set tSC = $$$OK
  Set oProduct = $Get(pProduct)
  If ($IsObject(oProduct) = 0) {
  Set oProduct = ##class(dc.iris.product).%OpenId(oProduct)
  }
  If ($IsObject(oProduct) = 0) {
  Set tSC = $$$ERROR($$$GeneralError,"No product defined")
  Quit tSC
  }
  Set pCmd = oProduct.RunCmd
  Set pNumberOfFiles = $Get(pQuantity,1)
  Set args=4
  Set args(1) = oProduct.RunParam1
  Set args(2) = oProduct.RunParam2
  Set args(3) = oProduct.RunParam3
  Set args(4) = oProduct.RunParam4
  For ii = 1:1:args {
  If (args(ii) = "$Qty") Set args(ii) = pNumberOfFiles
  }
  Set tReturn = $ZF(-100,"/SHELL",pCmd,.args)
  Quit tSC
 

}

Hi Mark,

I have adapted the code for Production Monitor into a custom class User.ProductionMonitor. It can get host info (status OK or Error) and also Queues sizes. I also created ProductionManager.csp to display the info. I hope it helps you. Hopefully you will share what you do and maybe we both get a better solution!

Please see code here: oliverwilms/production-monitor (github.com)

User Error identified: I missed adding USING {"from":{"file":{"header":"1"}}} at the end. The correct statement that skipped "Balance" column was:

LOAD DATA FROM FILE '/irisrun/repo/data/finance-transactions-08-Jan-2022_08-25.csv'
INTO dc_data_finance.transact(TranDate,CheckNumber,Merchant,Category,SubCategory,Memo,Credit,Debit,BillPay,DebitCard,Account,Status)
VALUES("Date","Check",Merchant,Category,SubCategory,Memo,Credit,Debit,"Bill Pay","Debit Card",Account,Status)
USING {"from":{"file":{"header":"1"}}}

I created a new class called "dc.data.finance.transact" avoiding RESERVED words DATE, CHECK, and TRANSACTION. Then I ran this command in SQL Management Portal:

LOAD DATA FROM FILE '/irisrun/repo/data/finance-transactions-08-Jan-2022_08-25.csv' into dc_data_finance.transact

Row count: 76 Performance: 4.318 seconds  91420 global references 1837548 commands executed 3 disk read latency (ms)  Cached Query: %sqlcq.USER.cls23  Last update: 2022-01-09 00:04:31.471

Print

  76 row(s) affected

I have tried to adapt your example to run on HealthShare 2019.1. I get an error when I call  ..Adapter.ExecuteUpdateBatchParamArray from SQLInsertOperation. 

I debugged the OutboundAdapter code. The error happens on this line:

Set pHS=..%JGProxy.prepareStatement(..%ConnHandle,pSQLStatement)

..%ConnHandle is not an Object. pSQLStatement looks okay.

My code is here:

https://github.com/oliverwilms/etl/blob/main/src/Oliver/SQL/OutboundAdap...(..%25ConnHandle%2CpSQLStatement)

Any idea what is the problem?