Technical Capabilities
Having trouble finding what you need?
Get in touch with us, so we can answer your specific questions directly.
Get In Touch

OTS$ – Data Conversion Routines

Overview

VX/OTS$ is a call-compatible implementation of the OpenVMS OTS$ general-utility run-time routines for x86 and ARM Linux. It provides the radix and numeric conversions, block memory moves, string-descriptor copy, and math primitives that compiler-generated code and mixed-language OpenVMS applications call at run time, so migrated programs link and execute while keeping the same calling conventions, string descriptors, and condition-code behavior they relied on under OpenVMS.

VX/OTS$ is a library, not a server or daemon. Its routines compile into the VX runtime library and link directly into the migrated application, and each entry point is exposed under its VMS dollar-sign name alongside a generated Fortran-callable variant. Eighteen OTS$ routines are implemented and integrate with VX/RT to deliver full OpenVMS-style data processing on Linux, so applications that depend on OTS$ services can be ported without rewriting their conversion or memory-handling logic.

Architecture and linkage

VX/OTS$ is a linked run-time library, not a running service. The OTS$ entry points are compiled from C++ into object modules, archived into the VX runtime library libvxrt.a, and linked directly into the migrated application. There is no OTS$ process, no daemon, and no inter-process substrate to configure. At run time each routine resolves a VMS string descriptor to a raw pointer and length, performs its conversion, move, or math operation, and returns a VMS condition value.

PropertyVX/OTS$
DeliveryObject modules archived into libvxrt.a, linked into the application.
Implementation languageC++ with extern "C" bodies.
Public entry points18 OTS$ routines, one per source module.
Calling modelDirect in-process function calls; no runtime server, no IPC.
Target platformsx86 and ARM Linux, through the VX/RT runtime.
PrototypesShared VX headers (ots$routines.h, descriptor and alias helpers).

Entry points and aliasing

Every module binds its internal implementation symbol to the VMS-visible names through an alias macro, so a single routine body is reachable under the upper-case VMS name, the lower-case name, and a Fortran trailing-underscore entry point. Routines whose C and Fortran calling conventions match share one body directly; the CVT_* conversions add a separate Fortran entry point that applies a string-descriptor shim. This is what lets object code compiled against the original OTS$ names resolve unchanged on Linux.

VX/OTS$ callable routines

The full set of 18 callable routines, spanning radix conversions between longwords and text, numeric text to floating-point parsing, block memory moves, unsigned and double-precision math, and a string-descriptor copy. Each is available under its VMS dollar-sign name as well as the generated Fortran-callable alias described above.

OTS$ APIFunction
OTS$CNVOUTConvert a double-precision float to a right-justified character string.
OTS$CVT_L_TBConvert a longword to a binary (base-2) text string.
OTS$CVT_L_TIConvert a longword to a signed decimal text string.
OTS$CVT_L_TOConvert a longword to an octal text string.
OTS$CVT_L_TUConvert a longword to an unsigned decimal text string.
OTS$CVT_L_TZConvert a longword to a hexadecimal text string.
OTS$CVT_T_DConvert a numeric text string to a floating-point value (D_floating, returns a double).
OTS$CVT_T_GConvert a numeric text string to a floating-point value (G_floating).
OTS$CVT_T_HConvert a numeric text string to a floating-point value (H_floating).
OTS$CVT_TB_LConvert a binary (base-2) text string to a longword.
OTS$CVT_TI_LConvert a signed decimal text string to a longword.
OTS$CVT_TU_LConvert an unsigned decimal text string to a longword.
OTS$CVT_TZ_LConvert a hexadecimal text string to a longword.
OTS$MOVE3Move a block of memory from source to destination (3-argument form).
OTS$MOVE5Move bytes from source to destination and pad the remainder of the destination with a fill character (5-argument form).
OTS$POWDDRaise a double-precision base to a double-precision power.
OTS$POWLULURaise an unsigned longword to an unsigned longword power (64-bit unsigned result).
OTS$SCOPY_R_DXCopy a source string passed by reference to a destination string passed by descriptor.

Naming convention

In CVT_L_Tx, the x is the output radix or format of the text produced from a longword; in CVT_Tx_L, the x is the input radix or format parsed from text back into a longword. B is binary, I is signed decimal, O is octal, U is unsigned decimal, and Z is hexadecimal. For CVT_T_x, the x is the target floating-point kind (D, G, or H).

SuffixMeaningLongword to textText to longword
Bbinary (base-2)OTS$CVT_L_TBOTS$CVT_TB_L
Isigned decimalOTS$CVT_L_TIOTS$CVT_TI_L
OoctalOTS$CVT_L_TOno inverse
Uunsigned decimalOTS$CVT_L_TUOTS$CVT_TU_L
ZhexadecimalOTS$CVT_L_TZOTS$CVT_TZ_L

Call pattern

Every longword-to-text conversion follows the same shape: resolve the VMS string descriptor to a pointer and length, blank-fill the destination, format the value, right-justify the result, and return a condition value. On overflow the destination is filled with asterisks and an output-conversion error is returned. OTS$CVT_L_TI (longword to signed-decimal text) is representative:

/* OTS$CVT_L_TI: longword to signed-decimal text */
U32 OTS_D_CVT_L_TI( void *value, void *string, S32 digits, S32 size, S32 flags )
{
    char *sPtr = vxrt_strptr64( string, lenptr );   /* resolve VMS descriptor  */
    memset( sPtr, ' ', sLen );                       /* blank-fill destination  */

    switch (size) {                                  /* endian-safe longword read */
        case 1: sprintf( str, "%d", *((char *)value) ); break;
        case 2: sprintf( str, "%d", Mgw(value) );       break;
        case 0:
        case 4: sprintf( str, "%d", Mgi(value) );       break;
    }

    if ( dest_too_small ) {                          /* fill with '*', return error */
        memset( sPtr, '*', sLen );
        return OTS_s_OUTCONERR;
    }
    /* right-justify the text into the descriptor, then return success */
    return SS_s_NORMAL;
}

The other CVT_L_T* routines are structurally identical: only the format string ("%o", "%u", "%X", or the binary bit-shift loop) changes.

Status codes and flags

OTS$ routines return a VMS condition value. Success has the low bit set, so callers that test the low bit continue to see the same pass or fail result they saw under OpenVMS. The conversion routines report input and output conversion errors with the standard OTS$ condition codes, while the memory and parameter checks use the shared SS$ status set.

SymbolValueMeaning
SS$_NORMAL1Success. Returned by every routine on the normal path.
SS$_BADPARAM20Bad parameter, for example a null destination or an invalid size.
SS$_INVARG4042Invalid argument, for example a move length above the 2147483647 limit.
OTS$_INPCONERR1540140Input-conversion error, returned by the text-to-value routines.
OTS$_OUTCONERR1540148Output-conversion error, returned when a formatted result does not fit the destination.

Blank and tab handling (text to longword)

The text-to-longword conversions accept a flag that controls how leading blanks and tabs in the input are treated. OTS$CVT_TB_L uses the following values:

FlagValueBehavior
Handle blanks and tabs0x00Process both blanks and tabs.
Ignore blanks, handle tabs0x01Skip blanks, process tabs.
Ignore tabs, handle blanks0x10Process blanks, skip tabs.
Ignore both0x11Skip both blanks and tabs.

Text-to-floating flag bits

OTS$CVT_T_D is the workhorse behind the text-to-floating conversions and accepts a flags word. The bits VX/OTS$ implements, and those it does not, are:

FlagMaskEffectStatus
Blank handling0x0001Replace or ignore embedded blanks.implemented
Tab handling0x0010Reject strings that contain a tab.implemented
Valid exponent0x0020Reject a bare sign with no exponent digits.implemented
Scale0x0040Apply a decimal scale shift to the result.implemented
Exponent only0x0002Exponent-only parsing.not supported
Ignore underflow0x0004Ignore underflow instead of returning an error.not supported
Truncate0x0008Truncation or rounding control.not supported

Compatibility and divergences

VX/OTS$ is built so OpenVMS applications that call OTS$ routines run on Linux without source changes. A few behaviors differ from the original VMS runtime by design, because the target platform differs. Each divergence keeps application-visible results intact while adapting to Linux.

AreaBehavior on VX/OTS$
OTS$CVT_L_TZ / OTS$CVT_TZ_LThe Z suffix denotes hexadecimal, matching the OpenVMS meaning; these routines convert between longwords and hexadecimal text. Older documentation that labels them as timezone conversions is incorrect.
OTS$CVT_T_G / OTS$CVT_T_HG_floating and H_floating parsing share the D_floating path. Linux has no native VAX G or H floating type, so all three resolve to IEEE double precision.
Octal inverseOctal has a forward converter (OTS$CVT_L_TO) but no text-to-longword inverse. The binary, signed-decimal, unsigned-decimal, and hexadecimal radixes all provide both directions.
OTS$CVT_T_D extensionsExponent-only parsing, ignore-underflow, and truncation control are not implemented, and both underflow and overflow always return an error. Standard numeric text conversion is fully supported.
OTS$POWLULUUnsigned-longword exponentiation uses an iterative multiply and produces the correct result without overflow checking.
OTS$MOVE5Returns a zero value on a bad or zero-length destination rather than a named condition symbol; the low-bit test still reports failure, and success returns the normal status.
Routine names can be misleading. Several OTS$ names describe a format the routine does not produce; the behavior documented here comes from the routine itself, not its name. The most common example is the Z suffix, which is hexadecimal rather than a timezone conversion.
Ships inside VX/RT. OTS$ is delivered as part of the VX/RT run-time, so a migrated application picks up OTS$ conversion, memory, and math services alongside the rest of the OpenVMS run-time surface on x86 and ARM Linux.

Quick reference

Longword to text (radix conversions)

OTS$CVT_L_TB
OTS$CVT_L_TI
OTS$CVT_L_TO
OTS$CVT_L_TU
OTS$CVT_L_TZ
OTS$CNVOUT

Text to longword (inverse conversions)

OTS$CVT_TB_L
OTS$CVT_TI_L
OTS$CVT_TU_L
OTS$CVT_TZ_L

Text to floating point

OTS$CVT_T_D
OTS$CVT_T_G
OTS$CVT_T_H

Memory, math, and string

OTS$MOVE3
OTS$MOVE5
OTS$POWDD
OTS$POWLULU
OTS$SCOPY_R_DX

Key facts

ItemValue
Public entry points18 OTS$ routines
Delivered inVX/RT run-time, archived into libvxrt.a
Target platformsx86 and ARM Linux
Success testLow bit set (SS$_NORMAL is 1)
Common errorsOTS$_INPCONERR, OTS$_OUTCONERR, SS$_BADPARAM, SS$_INVARG

Frequently Asked Questions

Curious about how Sector7 can facilitate your application migration? Explore our FAQs for expert insights.

What is VX/OTS$ and how does it help with OpenVMS migrations?

VX/OTS$ provides a call-compatible implementation of OpenVMS data conversion and structured data handling APIs for x86 and ARM Linux. It ensures seamless migration of OpenVMS applications that rely on OTS$ routines while maintaining compatibility with existing logic and execution behavior.

This tool is essential for organizations migrating applications that perform encoding transformations, structured data manipulation, and memory operations. Contact us to discuss how VX/OTS$ can simplify your OpenVMS migration.

Which data conversion functions does VX/OTS$ support?

VX/OTS$ supports all major OpenVMS OTS$ APIs including OTS$CNVOUT, OTS$CVT_L_TB, OTS$CVT_T_D, OTS$MOVE3, OTS$MOVE5, and OTS$POWDD among others.

Does VX/OTS$ maintain numerical representation consistency?

Yes, VX/OTS$ ensures consistency in numerical representation, memory operations, and encoding across platforms when migrating from OpenVMS to Linux.

How does VX/OTS$ handle memory operations during migration?

VX/OTS$ includes memory movement functions like OTS$MOVE3 and OTS$MOVE5 that preserve OpenVMS memory handling behavior on Linux platforms.

Can VX/OTS$ integrate with other VX migration tools?

VX/OTS$ seamlessly integrates into the VX/RT ecosystem for comprehensive OpenVMS compatibility on x86 and ARM Linux. This integration provides full OpenVMS-style data processing capabilities alongside other VX tools.

Organizations like Allianz have successfully leveraged multiple VX tools for complex migrations involving data conversion and processing requirements.

What encoding transformations are supported by VX/OTS$?

VX/OTS$ supports OpenVMS encoding transformations including conversion between numeric formats, timezone handling, and structured data encoding operations.

How does VX/OTS$ handle power and mathematical operations?

VX/OTS$ includes mathematical functions like OTS$POWDD for double-precision power calculations and OTS$POWLULU for long integer power operations, maintaining OpenVMS computational accuracy.

What are the key benefits of using VX/OTS$ for migration projects?

VX/OTS$ preserves OpenVMS data transformation logic, enabling direct porting of applications without major modifications. This reduces development costs and maintains productivity during migration.

The tool provides full compatibility with OpenVMS OTS$ functions, ensuring seamless execution of structured data operations on Linux. Companies like BNY Mellon have leveraged similar migration strategies for critical financial applications.

By eliminating the need to rewrite data conversion logic, VX/OTS$ significantly accelerates migration timelines. Contact our team to learn how VX/OTS$ can streamline your OpenVMS modernization project.

What is VX/OTS$?

VX/OTS$ is a call-compatible implementation of the OpenVMS OTS$ data-conversion and structured-data-handling routines for x86 and ARM Linux. It lets OpenVMS applications perform encoding transformations, structured data manipulation, and memory operations while preserving their existing logic and execution behavior.

Which OpenVMS OTS$ routines does VX/OTS$ provide?

VX/OTS$ implements 18 callable routines: the longword-to-text radix conversions (binary, signed decimal, octal, unsigned decimal, and hexadecimal) and their text-to-longword inverses, the text-to-floating conversions (D, G, and H floating), floating-point output with OTS$CNVOUT, the memory moves OTS$MOVE3 and OTS$MOVE5, the power functions OTS$POWDD and OTS$POWLULU, and the string-descriptor copy OTS$SCOPY_R_DX.

What do the OTS$CVT_L_T routines do?

They convert a longword into a text representation in a chosen radix: signed decimal, octal, unsigned decimal, binary, or hexadecimal. The matching OTS$CVT_T_L routines perform the reverse, parsing a text string in the corresponding radix back into a longword. Note that the Z suffix means hexadecimal, not a timezone conversion.

Does VX/OTS$ run on x86 and ARM Linux?

Yes. VX/OTS$ implements the OTS$ routines for both x86 and ARM Linux and integrates with VX/RT to deliver full OpenVMS-style data-processing capabilities on those platforms.

How does VX/OTS$ handle string and memory operations?

It provides the OpenVMS memory-move routines OTS$MOVE3, which moves a block of memory, and OTS$MOVE5, which moves bytes and pads the destination with a fill character, plus OTS$SCOPY_R_DX, which copies a source string passed by reference into a destination string passed by descriptor, preserving OpenVMS memory-handling behavior on Linux.

What mathematical functions are included?

OTS$POWDD raises a double-precision base to a double-precision power, and OTS$POWLULU raises an unsigned longword to an unsigned longword power and returns a 64-bit unsigned result, so applications that rely on OTS$ math keep the same numeric behavior after migration.

Do I need to rewrite my application to use VX/OTS$?

No major modifications are required. VX/OTS$ is call-compatible with the OpenVMS OTS$ routines, exposing them under the same OTS$ names with generated Fortran-callable entry points, so applications that call OTS$ routines can be migrated while keeping their existing calling logic.

How does VX/OTS$ fit with the rest of the VX toolset?

It integrates into the VX/RT ecosystem, which supplies the OpenVMS runtime environment on x86 and ARM Linux. Combined with VX/RT, VX/OTS$ keeps numerical representation, memory operations, and encoding consistent across platforms during a migration.

Transform Your Legacy Software Today!

Get In Touch
Unlock the potential of your legacy software with our expert migration services.