1. Olan Knight
  2. PowerBuilder
  3. Wednesday, 1 July 2020 16:49 PM UTC

Update:  03-JUL-2020

We found a copy of the DLL and deployed it with the utility. At this point everything compiles, but we have an unrelated DW_1 Retrieval Error occurring (the discussion is in a separate thread).


PB2019R2, b2328
Windows 10, 64 bit platform
32 bit application comprised of a single PBL

Does anyone know of a replacement for the s_1mains function from the OTSW32.DLL?

We'have had this utility for a long time, and when it runs from the PB v12.1 IDE, there are no issues.
The utility has been migrated to PB2019, a full build was done, and an EXE was created with no pdbs.

When run from the PB2019 IDE, it fails at the call to this external function.
The issue was corrected by placing the DLL in C:\Program Files (x86)\Appeon\PowerBuilder 19.0.
We have not yet tested the EXE for the utility with this build configuration.

// Input file

// Local external function call
SUBROUTINE s_1mains ( REF string ls_file_in,     REF string ls_file_out,
                                     REF string ls_ctl_stmt, REF long   ll_num_recs,
                                     REF int     li_sort_return_code)
                                      LIBRARY "otsw32.dll" alias for "s_1mains;Ansi"

// Calling the external function 
is_include_omit_stmt    = INCLUDE (7,6,LE,'180501',46,4,EQ,'0288')
is_outrec_stmt            = ""
is_file_type_txt_stmt    = "FILETYPE(TXT)"
is_workdrive_stmt        = "C:\Users\olan.knight\OMACSGITNYS1049\output_file.tmp"

ls_ctl_stmt = is_include_omit_stmt + is_outrec_stmt + is_file_type_txt_stmt + is_workdrive_stmt

is_sort_file_in              = <path & file of input data file>
is_sort_file_out            = <path & name of output file>

s_1mains (is_sort_file_in, is_sort_file_out, ls_ctl_stmt, il_sort_number_records, ii_sort_return_code)


// otsw32.DLL
The function "s_1mains" apparently takes a file filled with data as above and does the following:

   1. opens the is_sort_file_in file
   2. will only include rows whose BillDate (bytes 7-12) <= '180501' AND whose ICC (bytes 46-49) = '0288'
       in the output file is_sort_file_out

   3. Sorts the data in the is_sort_file_out by the date
This function is lightning fast.

Thank You,


Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 1 July 2020 19:45 PM UTC
  2. PowerBuilder
  3. # 1

Hi Olan, 

Newer versions of PowerBuilder use newer versions of Visual Studio to compile the runtime DLLs.  My guess is this external DLL you are trying to use was compiled with really old version of Visual Studio.  There is incompatibility between old versions of Visual Studio and new versions.  So my suggestion is get updated version of the DLL.

Best regards,

  1. Olan Knight
  2. Wednesday, 1 July 2020 22:04 PM UTC
Thanks, Armeen.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.