應用程式無法引用 FILLER 資料,至少有三個可能原因:
大型主機或 COBOL 的具體細節。
自動化細節。
使用 TI Project 來進行操作程序。
以下說明這三個原因。
大型主機或 COBOL 細節
當匯入過程中遇到 FILLER 關鍵字時,交易整合器(TI)的運行時環境會根據填充的長度調整資料在發送或接收緩衝區中跟隨填充器之後的位置偏移量。 這樣會在傳送至(或接收自)主機的緩衝區中留下未填充的空隙,讓你的資料能正確地覆蓋到描述該資料的宣告上。
自動化細節
自動化方法不會參考填充資料描述條目。
使用 TI 專案的程序
資料宣告開頭的填充程式與方法、記錄集、資料表、使用者定義型別(UDT)或 .NET 結構相關聯。 你可以從方法屬性頁面的 進階 標籤檢視或更改與該方法相關的填充元件。 若要查看或更改與方法、記錄集或 UDT 相關的填充程式,請右鍵點擊方法、記錄集或 UDT,然後點擊 屬性。
資料描述條目後的填充詞會與資料描述條目相關聯(方法則為參數,記錄集為欄位,UDT 則為成員)。 你可以從參數、欄位或成員屬性的 COBOL 定義 標籤中查看或更改與參數、欄位或成員相關的填充器。 當填充符緊接於你指定作為返回值的資料描述條目後面時,你可以從方法屬性中的 COBOL 定義 標籤中查看或更改該填充符。
以下範例展示了使用 FILLER 的 COBOL 資料宣告:
01 CUSTOMER-DATA.
05 CUSTOMER-INFO.
10 LAST-NAME PIC X(20).
10 FIRST-NAME PIC X(20).
10 FILLER PIC X(12).
05 DEMOGRAPHICS.
10 DEMO-AGE PIC 999.
10 DEMO-INCOME PIC S9(9)V99 COMP-3.
10 DEMO-SEX PIC X.
10 DEMO-MSTATUS PIC X.
10 FILLER PIC X(40).
所得方法如下:
CustomerDemographics(strLastName As String, strFirstName As String, iAge As Integer _
, curIncome As Currency, strSex As String, strMStatus As String)
以下是呼叫該方法的 Visual Basic 程式碼範例:
Dim objCustomer As Object
Dim strLastName As String
Dim strFirstName As String
Dim iAge As Integer
Dim curIncome As Currency
Dim strSex As String
Dim strMStatus As String
strLastName = "Doe"
strFirstName = "John"
'create an instance of the invoicing object
On Error GoTo ErrorHandler1
Set objCustomer = CreateObject("Customer.Invoicing.1")
'invoke the SetInvoices method
On Error GoTo ErrorHandler2
objCustomer.CustomerDemographics strLastName, strFirstName _
, iAge, curIncome, strSex, strMStatus