$HexA: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
Line 18: Line 18:
<p>%EBCDIC is set to the EBCDIC equivalent of hex_string.</p>
<p>%EBCDIC is set to the EBCDIC equivalent of hex_string.</p>


For example, in
==Examples==
<p class="code"> %JUNK = $HexA('F1F2F3')
The following statement sets %JUNK to the string <code>123</code> (EBCDIC X'F1F2F3'):
<p class="code">%JUNK = $HexA('F1F2F3')
</p>
</p>


%JUNK would be set to the string '123' (EBCDIC X'F1F2F3'), and in
And this statement sets %JUNK to EBCDIC X'0102', which is a non-displayable string.
<p class="code"> %JUNK = $HexA('102')
<p class="code">%JUNK = $HexA('102')
</p>
</p>
%JUNK would be set to EBCDIC X'0102' which is a non-displayable string.


==Products authorizing {{PAGENAMEE}}==  
==Products authorizing {{PAGENAMEE}}==  

Revision as of 23:23, 15 April 2013

Convert hexadecimal string to EBCDIC equivalent

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $HexA function is the HexToEbcdic (String function).

This function converts a hexadecimal string to its EBCDIC equivalent.

The $HexA function accepts one argument and returns a string result.

The first argument is a string containing the characters 0 - 9 and A - F. All other characters are treated as 0. If the number of characters in the first argument is odd, the first argument is considered to begin with an extra 0 character.

Syntax

%EBCDIC = $HexA(hex_string)

%EBCDIC is set to the EBCDIC equivalent of hex_string.

Examples

The following statement sets %JUNK to the string 123 (EBCDIC X'F1F2F3'):

%JUNK = $HexA('F1F2F3')

And this statement sets %JUNK to EBCDIC X'0102', which is a non-displayable string.

%JUNK = $HexA('102')

Products authorizing $HexA