%ATRIM

Return an alpha stripped of trailing blanks

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
alpha = %ATRIM(expression)

Return value

alpha

An alpha stripped of its trailing blanks. If expression is null or only contains blanks, the return value is an alpha whose length is 0 bytes. (a)

Arguments

expression

The alpha expression whose blanks will be stripped. (a)

Discussion

On Windows, you can use %ATRIMTOSTRING to perform the same function as %ATRIM but with less overhead when creating a string.

Examples

The example below displays the data in the fields name and comp without any trailing blanks.

subroutine show_rec
record custmast
    id          ,d5
    name        ,a50
    comp        ,a50
proc
    writes(TTCHN, "Name: " + %atrim(name))
    writes(TTCHN, "Company: " + %atrim(comp))
    xreturn
endsubroutine