Batch File Interface

Overview

The standard to define the types of the service is the target system. File batch service means when the target system is sending file data. File batch service comprised of File to File, File to DB, File to other(file standard)

Transferable Data

The transferable data as a file is as follows. These are using FTP supported by ISM excepts the custom method.

Category Description Note
Number of Files Transferable files are more than one. If the file are multiple, process it using wildcard.
File Location Connect to FTP and it should be on the relocatable location. Relocatable location include absolute path. If not, limit it on the cases of the absolute path's available.
File Type Ascii data or binary data Define whether ascii/binary for each system. It cannot be used as file based.
File Size FTP Transferable file size Transferable in the coverage of FTP. If the file is too big, longer timeout than the time required to sending file should is needed.

FTP Connecting Method

It supports two different way below.

Way Content
Passive The way the server doesn't work when the FTP Client is exchanging the data
Active The way the server is running when FTP Client is exchanging the data

Supported FTP Flatform

  • Unix
  • Windows
  • OS/2
  • OS/400
  • MVS
  • VOS
  • VMS

Supported Encoding Type

ISM exclusively supports Unicode type. No supports guaranteed for fixed length of data process using query handler of other Korean encodings.

  • There's an example which used MS949 on AIX 5.3.

Duplicated File Transfer Processing Option

  • Error Occurrence
    • If there's a file have the same name, the error occurs.
  • Overwriting File
    • If there's a file has the same name, overwrite it.
  • Adding File
    • If there's a duplicated file, append the current file to the previous one.
  • Reloading
    • If the transfer has halted from an error, try to reload it and retransfer it from the point which has been halted.

File processing option after the file transfer

  • Move
    • Move the source file to another directory after the transfer.
  • Delete
    • Delete the source file after the transfer.

File - File Batch Service

Overview

When the file transfer is required by the source system, the service send the file registered by rule or request parameter to the target system.

Service Request Protocol

When the batch service is requested by the batch agent, defined and call the source and target files. If both are not assigned, follow the transmission protocol registered on rule. Refer the service request protocol on batch agent installation guide.

FTP Connection Protocol

Both of the source and target system connects to the rule registered server by FTP. If there's a lot of server is registered, try to reconnect to the another server after five attempts. If the connections to the all server fails, stop trying.

FTP Connecting Methods - Active/Passive

Define the unit as file application. When the application is created, the default value is active. If there's no value on set on runtime, use the passive method as default.

File Transfer Mode - binary/ascii

Define the unit as integration service. If there's no value on set on runtime, use ascii as default file transmission mode.

Verification of the size of file

Compare the size of file of the object file to send and the sent file. To check the size of file, current FTP account should have the permission of Dir. The information of the size of file is extracted from the results of list command of FTP by FTP parser. If there's no permission of Dir, cannot inquire the list of files. If the size of file cannot be verified, The following value must be set on ism.xml.

<batch>
<file checkSize=”false”/>
</batch>
Date Output Form

Define the unit as application. Data Output Form is used to extract the file information from FTP parser. FTP parser analyze the returned string in units of string, the delimiter of the analysis of parser is space. The number of spaces are changed to the data output form so that the form must be set by numbers.

  • FTP Data Output Form Verification Protocol

Direct connection to the source/target system. Move to the root directory defined on rule. Execute Dir command on the target directory.

$>ftp deai
Connected to deai.
220 deai FTP server (Version 4.2 Thu Jul 12 13:39:06 CDT 2007) ready.
User (deai:(none)): bwadmin
331 Password required for bwadmin.
Password:
230-Last unsuccessful login: Tue Jul 22 10:32:54 KORST 2008 on /dev/pts/57 from 192.7.106.176
230-Last login: Tue Jul 22 13:30:04 KORST 2008 on ftp from ::ffff:192.7.105.13
230 User bwadmin logged in.
ftp> cd ISM1.1
250 CWD command successful.
ftp> dir
200 PORT command successful.
150 Opening data connection for /bin/ls.
total 265384
-rw-r-----   1 bwadmin  bwadmin     8552836 Jul 02 17:21 BWMonitorPatch.jar
-rw-r--r--   1 bwadmin  bwadmin          35 May 12 2007  Licence.txt
drwxr-xr-x   2 bwadmin  bwadmin         256 Feb 25 19:40 Uninstaller
drwxr-xr-x   6 bwadmin  bwadmin         256 Apr 22 10:02 ba
drwxr-xr-x   6 bwadmin  bwadmin         256 Apr 22 10:02 batch_agent
drwxr-xr-x   4 bwadmin  bwadmin        4096 Jun 17 20:47 bin
drwxr-xr-x   3 bwadmin  bwadmin         256 Jul 02 16:41 bwmonitor
drwxr-xr-x   3 bwadmin  bwadmin         256 Jul 02 16:41 bwmonitor.backip
drwxr-xr-x   5 bwadmin  bwadmin        4096 Jul 15 13:30 data

==> The bolded underlined part  is the date output form. The form expressed above is the default FTP date output form.

ftp data output form default form is MM DD HH:mm.

data form e.g)

drwxr-xr-x   5 bwadmin  bwadmin   4096 7M 2D 13:30 data

output form format : MM DD HH:mm

Custom Handler Definition

Define the custom handler for file data transmission. Define it when other methods are used besides FTP on file transfer. Custom handler is defined by the system.

<batch>
<file system_id handler=””/>
</batch>

File Transfer Rules on File Transferring

Absolute Path Allowance Status

Absolute Path can refer to the root directory of the system according to the authority of the FTP account. Because it could effect to the system security, determines whether to allow the root directory or not following the policy.

<batch>
<path absolute=”true”/>
</batch>

If true, allow absolute path. If false, do not allow the absolute path. If it is supposed that the path of the registered source or target file is ‘/snd/input’ and the input source filename is ‘/root/input.dat', the processing mode is as follows.

Allow the absolute path Do not allow the absolute path
/root/input.dat /snd/input/root/input.dat

Since the absolute path is allowed, ignore the registered path and use the one already registered. If not, process the file attaching the input path to already registered path.

Source File Transfer Rule
Regulation Category Description Processing Status Processing Mode
Delete the source file after the transmission completed Delete the file of the source system after the transmission completed Permission Delete the file of the source system after the transmission completed. If the source file has a wildcard, delete all the files corresponding to wildcard.
Target File Transfer Rule
Rule Category Description Processing Status Processing Mode
Transfer the file in source filename Transfer the source filename as the target system's filename. Permission The filename generated on the target file is identical to the filename of the source file, but the directory information of the source file isn't used. Since the source filename is used, do not use the input file name on request or rule registered target filename.
Define the target filename and transfer Define the target filename and transfer on request. Permission Use the filename defined by request and transfer Use the directory information of the target defined by the request If no directory is defined, use the target directory registered on rule.
Duplicate the target file If the target file already exist, duplicate the If the target file is already existed, overwrite on it. Permission  
Adding target file If the target file is already existed, add it to previous file. Permission  
Define the privilege(mask) of the target file Define the privilege of the target file. The privilege information is defined by numbers. Ex) rw-rw-rw : 666 Permission After the transfer the target file, change the authority information to the defined value.
Source File Definition Rule

The rule defining the source file as follows. The rule applied equally to File - DB Batch.

To explain the defining rules below, fix the directory and file name as follows.

  • File location - /snd/biz/
  • input data name – in.dat
  • input rule data name – in_r.txt
Input rule Permission status Processing type
File name Directory File name
/snd/biz/in.dat /snd in_r.txt Permission Process by input file Connect to FTP and get the file by input file name get /snd/biz/in.dat
snd/biz/in.dat /snd in_r.txt Not admitted Even though the same directory is repeated, process it to be attached to the the path registered on rule because there's no absolute path. Since there's no pertinent directory, the process fails. get /snd/snd/biz/in.dat
biz/in.dat /snd inpu_r.txt Permission Because there's no absolute path on input file, process it to be attached to the the path registered on rule. get /snd/biz/in.dat
in.dat /snd in_r.txt Because there's no absolute path on input file, process it to be attached to the the path registered on rule. Since there's no pertinent directory, the process fails. get /snd/in.dat
/snd/biz/in.dat /snd/biz in_r.txt Permitted In permission of the absolute path get /snd/biz/in.dat When the absolute path isn't admitted get /snd/biz/snd/biz/in.dat
No input /snd/biz in_r.txt Not admitted Combine the absolute path and the filename registered on rule and process it Since the file isn't exist, the process fails. get /snd/biz/in_r.txt
*.dat /snd/biz in_r.txt Permission Combine the absolute path and the filename registered on rule and process it get /snd/biz/*.dat
No input /snd/biz *.dat Permission Combine the absolute path and the filename registered on rule and process it get /snd/biz/*.dat
Target File Defining Mode

The defining mode below only applies on the transfer rule which isn't using the source file name.

To describe the defining rule below, fix the directory and filename as follow.

  • File directory - /rcv/biz/
  • Input filename – in.dat
  • Rule registered filename – in_r.txt
Transfer filename Rule information Permission status Processing mode
Filename Directory
/rcv/biz/in.dat /rcv in_r.txt Permission Process it according to the input file. Connect to FTP, and transfer file in the input filename. put /rcv/biz/in.dat
rcv/biz/in.dat / rcv in_r.txt Not admitted Even though the same directory is repeated, process it to be attached to the the path registered on rule because there's no absolute path. Since there's no pertinent directory, the process fails. put /rcv/rcv/biz/in.dat
biz/in.dat / rcv inpu_r.txt Permission Because there's no absolute path on input file, process it to be attached to the the path registered on rule. put /rcv/biz/in.dat
in.dat / rcv in_r.txt Permission Since there's no pertinent directory, the process fails. put /rcv/in.dat
/rcv/biz/in.dat /rcv/biz in_r.txt Permission Allow the absolute path put /rcv/biz/in.dat Do not allow the absolute path put /rcv/biz/rcv/biz/in.dat
No input /rcv/biz in_r.txt Permission Combine the absolute path and the filename registered on rule and process it put /rcv/biz/in_r.txt
*.dat /rcv/biz in_r.txt Not admitted If the input file is wildcard, only the source filename is available.
No input /rcv/biz *.dat Not admitted If the input file is wildcard, only the source filename is available.

Service Definition

Source File Service Definition

Define the directory to fetch the source file. Directory is indispensable information, if there's none, define the current directory(./). Define the source filename. If there's no filename defined, it should be inputted on batch service request. Define the status whether to delete the source file or not after the transfer is completed.

Target File Service Definition

Define the directory to save the transfer object file. Directory is indispensable information, if there's none, define the current directory(./). Define the target filename. If there's no filename defined, it should be inputted on batch service request, or the source file usage status should be on. Define whether to use the source filename or not. Since the source filename is used, even if the target filename is defined, it is sent by the source filename. Define the processing mode when the target file existed in the target defined directory.

Processing modes are the three below.

  • If it exist, error occurs.
  • If it exist, overwrite on it
  • Add it
  • Subsequent write on it

File Data Structure Definition

If there's a conversion required for the input file data, register the information for data parsing. Input file data structure can have multiple field groups.

Define the information below when the parsing of the input file data is required.

Input data type Field delimiter Record delimiter
Fixed length data X O
Delimiter data O O

Fix the delimiter as follows for convenience.

  • Field delimiter - ‘|’
  • Record delimiter - ‘\n’
Field delimiter Record delimiter Field length definition Permission status Processing mode
No input No input 0 and fixed length mixed Not admitted Since there's no field delimiter, the try of data parsing fails because the field length value isn't accurate.
No input No input Fixed length Permission Data parsing according to the field length. Since there's no record delimiter Data number * Field group length(fixed length) is the actual size of the file.
No input \n Fixed length Permission Data parsing according to the field length Since there's record delimiter Data number * (Field group length + Record delimiter) is the actual size of the file.
| No input Fixed length Permission Data parsing according to the field delimiter Since there's no record delimiter Field delimiter number / Field number within the field group is the actual size of the file.
| \n Fixed length Permission Data parsing according to the field delimiter Since there's record delimiter The number of the record delimiter is the actual processing object data number.
| \n 0 and fixed length mixed Permission Data parsing according to the field delimiter Since there's record delimiter The number of the record delimiter is the actual processing object data number.
Target Filename Management Class

In sending file, the target filename can be generated in a specific rule. On definition of the file service, the filename class can be defined so that can be changed in every the batch service execution. File name Management Class inherit the TargetFileNameGenerator and be implemented. The contents which has to be implemented in filename management class is the code which replaces the parameters included in the filename. Attach '#' to the both sides of the value to be declared as a parameter.

  • Ex) TGT_FILE.#DATE#.#COUNT#

For this example, the file is generated by taking DATE and COUNT as the parameters. Filename Management Class is implemented to return the proper value for each parameter. The convert() method of the Filename Management Class is called by each parameter unit. In the example, because the parameter is two, call the convert() method twice.

convert(“DATE”);
convert(“COUNT”);

Filename Management Class is implemented as follows.

import com.ism.common.file.TargetFilenameGenerator;

public class FileNameGenerator extends TargetFilenameGenerator {

    public String convert(String exp) {
                      return “XXX”;
    }
}

Implemented class is included to the class path so that execution process can refer it, or included in ism_custom.jar.

Service Model Definition

Form the interface services as the source and the target, and define the routing rule and mapping rule in the way the request is sent from the source to the target. Define the service flow from the source service to the target service by the service model. Determines whether to sequential process or parallel process in the definition of the service flow. The parallel process isn't available on batch service.

Source Service
Properties Description
Pattern System Interface Pattern Set the ACK transmission.
Routing
Properties Description Accept Value
Routing Determining Method Find the way to search the target service. All
Routing Input Field When the routing determining method isn't All, define the input field.  
Routing Pattern Value Define the assigned input field value, pattern, or the result of the calculation. Send the request to the target service which has the same value set.  
Service Mapping Define the conversion rule between the source service and the target service Mapping Rule
Error Mapping Defines the conversion rule when the error response returned from the target service.  
Target Service Define the target service to send the request according to the routing pattern value. Target Service
Targe Service
Properties Description
Pattern System Interface Pattern Set the ACK transmission.

Etc.

Batch service does not support the parallel processing.

Integration Service Definition

Integration Service defines the source and the target system to the service model result, and other rules on batch service execution.

Other information besides the processing flow as the batch integration service is as follows.

  • 2PC Status
    • If it's not the 2PC transaction, separate the source interface process and the target interface process.
  • Message Verification Status
    • Analyze the input message by the field and apply the verification condition to verify. If there's no verification condition, verify the its length and type.
  • Pre-process
    • The process which has to be done prior the file transmission.
  • Post-process
    • The process which has to be done after the file transmission.
  • 1 time verification number
    • 0 when there's no File – File conversion
  • Transmission Method
    • Agent direct
      • In transferring a file with no conversion, set Agent direct method.
    • Direct Transmission
      • When it is not easy to access from the Agent because of the security problem like firewall with no conversion, set ISM direct transmission.
    • Indirect Transmission
  • Rollback type
    • Whole – If a single fails, rollback the whole.
      • The range of the whole means the the data per 1 time verification number.
    • Failed data – Even if there's a failed data, continue its progress.
  • Standby timeout
    • The period of time that the batch manager waits until the source interface process generate the data verification result file.
  • Transferable file types
    • Binary
    • Ascii
      • Setting on ascii, carriage return(\r) can be deleted or stored according to the operating system.
  • File delimiter class
    • The custom class to divide the file of Fiie – DB service per 1 time verification number unit.
      • FIle with no conversion – not available on file service.
      • Defined when it cannot be processed by basic division class.

Define the object system to execute the source and target interface services defined on the service model, and the timeout value to be used on the interface with the pertinent systems. The timeout value is only available on file interface.

File-DB Batch Service

In the case sending data form file to DB, there should be the transaction unit defined for transaction process. The transaction unit is the same as the data inquiry unit number(fetch number).

If the size of the file data(number) is bigger than the transaction unit, divide the file data to the transaction unit.

File Separator

Because it isn't possible to know whether the size of the file data which will be inputted on DB is bigger than the transaction unit or not, fetch the file and separate it. On file separation job, divide the file according to its record size(Row) registered on rule.

File Separation Methods
Field Delimiter Record Delimiter Support Status Note
In use In use Supported No limits for the length of field delimiter. No limits for the record delimiter.
In use None Supported
None(length) In use Supported
None(length) None Supported The file which the contents is written in a single line viewed on editor because it has no record delimiter.

In the case the data structure registered on rule and the actual data structure is different, use Custom File Separator to separate the file. Custom seperation class is defined as an integration service unit.

Target DB Supported Calculation

  • insert
  • update
  • upsert1(update and not exist, then insert)
  • upsert2(insert and duplicated, then update)

Transaction is only supported by transaction unit. No transaction process per item is supported.

Source DB Query Generation

SQL query to input data to the source DB is generated on ISM. The input data for query generation of ISM are three as follow.

  • Table name
  • Data structure
  • Operation type

ISM generated or supported SQL query's forms as follow.

  • User defined query
  • SQL Function
    • Define the default value of Process Mapping and process it
    • In the case the input data should be replaced within the SQL function, use the transform function
    • It should be defined that the pertinent field is SQL Function on the field group definition
  • NULL Data
    • When the input data is null, input the null data
    • In the case the input is null, but no null is available, use the transform function to generate the basic data.
  • Table name dynamic change
    • In the case the table name is chanded dynamically, use the Custom Table name Management Class to generate the table name.
    • In ISM, use the Custom Class to generate the table name and replace on SQL query.
    • There should be the table name(#TABLE_NAME#) defined to be replaced.

Supported Data Type

  • Number
  • Date
  • Timestamp
  • Char
  • Varchar
  • Long
  • Float
  • Double
  • CLOB
  • BLOB
Date Type Processing Rule

In the case below, there should be a date form defined to process the date type. The form designed by format is the date type supported by Java. On description, the date form is fixed below for convenience. Date form - yyyyMMdd

Source Data Target Data Processing Mode
Type Format Type Format
Character(Including Char, Varchar) Date yyyyMMdd On inquiry, suppose that the data fits on yyyyMMdd form and convert it to Date and process it.
Date yyyyMMdd Date yyyyMMdd >The result of the data is processed as String, as the result, String should be fit on yyyyMMdd form. On the input on the target, it is converted to yyyyMMdd Date type.
Date yyyMMdd Chracter The result of the data is processed as String, as the result, String should be fit on yyyyMMdd form.

Service Definition

Source Service Definition

Follow the source service definition of File-File batch service.

Target Service Definition

Target Service defines the DB calculation to be executed when the data is applied Because the data reflecting SQL query is generated automatically, only define the reflecting target table name. In the case the data reflecting table should be changed according to the executing time of the process, define the table name management class. If the data reflecting Query cannot be generated by the information defined by ISM, define Custom Query Handler.

Data Structure Definition

Source Data Structure Definition

Follow the file data structure definition of File-File batch service.

Target DB Data Structure Definition

Target DB transfer data structure cannot have multiple field groups. Target DB transfer data must be the delimiter length data. There's no need to input both of field delimiter and the record delimiter. The structure definition of date type follow the processing rule of File-DB batch's Date type processing rule. Define whether to use SQL Function on the field group when the SQL Function is required on the generation of target SQL query If there's update query generation is required, define the key field on the definition of the field group.

Definition of the Service Model

Form the interface services as the source and the target, and define the routing rule and mapping rule in the way the request is sent from the source to the target. Define the service flow from the source service to the target service by the service model. Determines whether to sequential process or parallel process in the definition of the service flow. The parallel process is not used on batch service.

Source Service
Properties Description
Pattern

System Interface Pattern Set ACK transmission.

Routing
Properties Description Value
Routing Determining Methods Determines the way to find the target service. All
Routing Input Field If the routing determining method isn't All, define the input field.  
Routing Pattern Value Define the value of the designated input field, pattern, or the result value of the calculation. The same value is sent to request the target service.  
Service Mapping Define the conversion rule between the source and the target service. Mapping Rule.
Error Mapping Defines the conversion rule when the error response returns from the target service.  
Target Service Define the target service to send the request according to the routing pattern value. Target Service
Target Service
Properties Description
Pattern System Interface Pattern Set the ACK transmission.

Integration Service Definition

Integration Service defines the source and target system on service model result, and the rules of other Batch Service on run Other information besides processing flow for Batch Integration Service is as follows.

  • 2PC Status
    • If it's not 2PC transaction, the transaction between the source interface process and the target interface process is seperated.
  • Message Verification Status
    • Analyze the input message per field and apply the verification condition to verify. If there's no verification condition, verify the length and type.
  • Post Process
    • The process has to be handled before DB data transmission
  • Post Process
    • The process has to be handled after DB data transmission.
  • 1 time inquiry number
    • The default value is 0.
    • If it is set to 0, the unit of process is set to 10000
  • Transmission Method
    • Indirect Transfer
      • Only indirect transfer is available.
  • Rollback type
    • The whole – If even a single case fails, rollback the whole.
      • The range of the whole is the 1 time inquiry number of data.
    • Failed data – progress it even if it has failed data.
  • Standby Timeout
    • The time the batch manager standby until the source interface process generate the file of data verification result.
  • Transfer file type
    • Binary
    • Ascii
      • Setting on ascii, carriage return(\r) can be deleted or stored according to the operating system.
      • When the source server's OS and the server of ISM is different(e.g. Window verse Unix), reflects these on record delimiter.
  • File delimiter class
    • The custom class to divide the file of Fiie – DB service per 1 time verification number unit.
      • FIle with no conversion – not available on file service.
      • Defined when it cannot be processed by basic division class.

Define the object system to execute the source and target interface services defined on the service model, and the timeout value to be used on the interface with the pertinent systems. The timeout value is only available on file interface.