Top
PowerBSORT V7.0 User's Guide
FUJITSU Software

A.3.3 Merge processing (binary file)

The following program is an example of describing the code to merge the binary files "c:\mergein1" and "c:\mergein2" in which the external decimal number in 10 bytes from the head of the record have been already sorted in ascending order as a key field and of which the record length is 100 bytes and output the result to the binary file "c:\mergeout".

Private Sub Command1_Click()
  'Specify not to display the error message.
  PowerBSORT1.DispMessage = False
  'The merge processing is specified.
  PowerBSORT1.DisposalNumber = 1
  'The input file name is specified.
  PowerBSORT1.InputFiles = "c:\mergein1 c:\mergein2"
  'Binary fixed length is specified for each input file type.
  PowerBSORT1.InputFileType = 1
  'The output file name is specified.
  PowerBSORT1.OutputFile = "c:\mergeout"
  'Binary fixed length is specified for each output file type.
  PowerBSORT1.OutputFileType = 1
  'The external decimal numbers in 10 bytes from the head of the record
  'have been sorted in ascending order as a key field already.
  PowerBSORT1.KeyCmdStr = "0.10zdla"
  'The length of the record is 100 bytes.
  PowerBSORT1.MaxRecordLength = 100
  'DLL of PowerBSORT is called and executed.
  PowerBSORT1.Action
  'Processing for when an error is found.
  if PowerBSORT1.ErrorCode <> 0 Then
    Msgbox "An error was found in PowerBSORT." & " ErrorDetail=" & PowerBSORT1.ErrorDetail
    Exit Sub
  End If
End Sub