View previous topic :: View next topic
|
Author |
Message |
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
I have a record where two fields are defined as full words, and I am trying to convert the to character fields.
This is what the fields look like when I display them with Hex On.
000B 007C
002C 00D8
This is the code that I have tried along with several others.
RLEN = SUBSTR(TMCDATA,093,004)
XLEN = X2C(B2X(RLEN))
I get the following error and I am not sure what I am doing wrong,
any help in the would be greatful.
43 *-* XLEN = X2C(B2X(RLEN)),
43 +++ XLEN = X2C(B2X(RLEN)),
IRX0040I Error running TESTIT, line 43: Incorrect call to routine, |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
show what You expect for the data posted |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
from the first field I would expect to see 700 and from the second field I expect to see 32200 as the values. the first field is the record length and the second filed is the blksize, I am pulling this from the CA1 TMC dataset for a file. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
I believe you want the C2D function. The other functions work strings that are interpreted as binary or hexadecimal numbers; C2D works with characters (i.e., actual binary values). |
|
Back to top |
|
|
Mickeydusaor
Active User
Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon
|
|
|
|
Akatsuukami,
Thanks that was the trick. I was making this more diffcult than was need. |
|
Back to top |
|
|
|