> -----Original Message-----
> From: IBM Mainframe Discussion List On Behalf Of (IBM Mainframe
Discussion List)
>  
> In a message dated 7/23/2007 9:11:16 A.M. Central Daylight 
> Time, [EMAIL PROTECTED] writes:
> >Wouldn't this just be the PACK command?
>  
> Not sufficient.
>  
> >Are you needing it in binary or Packed Decimal?
>  
> OP wants it translated to "the real hex number."  Without any 
> further  
> technical specifications, I would assume, e.g., that EBCDIC 
> "A3" should be  
> translated into X'A3'.  In this case two input bytes result 
> in one output  byte.  
> There are other possibilities where the output is not exactly 
>  one-half the length 
> of the input.  This string is really X'C1F3'.  If  you PACK 
> it you will end 
> up with X'013F' which is not the same as X'A3'.   First 
> translate every byte 
> into its hex equivalent, then pack with one extra  byte on 
> the right that you 
> plan to throw away.
>        TR     STRING,TABLE
> * STRING now contains X'0A03'.

Why is this necessary?

>        PACK   OUTPUT(2),STRING(3)
> * OUTPUT now contains X'A3yx', where yx is the inverse of 
> whatever was in  
> the first byte of OUTPUT before the PACK executes.

The result would be identical without the preliminary TR.

   -jc-

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to