Previous Topic Table Of Contents Parent Topic Next Topic |  | # The SWSEB2AS Function Related Topics Web Server API Function Index
| May be used in Shadow/REXX
| May be used from Other REXX Interpreters
| High-level language interface is available
SWSEB2AS is a built-in function used to translate an EBCDIC character string to an ASCII character string. ## SWSEB2AS Syntax The SWSEB2AS function takes one or two arguments. The invocation format for SWSEB2AS is: `z = SWSEB2AS( arg1 {, arg2 } )` The first argument specifies the data to be be translated. The second argument specifies the language code of the character string. This argument is optional. If not specified, the default Shadow Server language code is assumed. ## Return Values SWSEB2AS always returns a numeric value. If the value is zero the operation has completed successfully. A non-zero return value indicates that you have specified an invalid language code. The SWSEB2AS operation creates two REXX variables containing the output translated string and the length of the output string. ASCII.TEXTOUT.0 contains the length of the output string. ASCII.TEXTOUT.1 contains the output string. ## Example The following calls will translate an EBCDIC string to an ASCII string using the Swedish language translation table. Afterwards, the ASCII string will be translated back to EBCDIC using the default language translation table assigned to the Shadow Server address space:
       RC = swseb2as("ABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#$%¬&*()_-+={}¢¦|","SVE")
       say "rc=" RC
       say "len=" ascii.textout.0
       say "data=" ascii.textout.1

       RC = swsas2eb(ascii.textout.1)
       say "rc=" RC
       say "len=" ebcdic.textout.0
       say "data=" ebcdic.textout.1
Top