Previous Topic
Table Of Contents
Parent Topic
Next Topic

The SWSAS2EB Function

Related Topics

Web Server API Function Index


 gfchkmrk.gif (134 bytes) May be used in Shadow/REXX
gfchkmrk.gif (134 bytes) May be used from Other REXX Interpreters
gfchkmrk.gif (134 bytes) High-level language interface is available

SWSAS2EB is a built-in function used to translate an ASCII character string to an EBCDIC character string.

gfgraybr.gif (1830 bytes)

SWSAS2EB Syntax

The SWSAS2EB function takes one or two arguments.

The invocation format for SWSAS2EB is:

z = SWSAS2EB( 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

SWSAS2EB 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 SWSAS2EB operation creates two REXX variables containing the output translated string and the length of the output string.

  • EBCDIC.TEXTOUT.0 contains the length of the output string.
  • EBCDIC.TEXTOUT.1 contains the output string.

Example

The following calls will translate an ASCII string to an EBCDIC string using the Swedish language translation table. Afterwards, the EBCDIC string will be translated back to ASCII 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