rarvins
Active User
Joined: 24 Jan 2007 Posts: 53 Location: India
|
|
|
|
Hi All,
I have a requirement to convert a binary datatype to character.
The input file is of length 80, starting position of the binary field is 39 and it is of length 4 bytes ( s9(09) comp). I have converted to ZD but I dont know how to convert from BI to CH.
Can anyone pls provide a sample code that I couls look at
Thanks |
|
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4684 Location: San Jose, CA
|
|
|
|
It depends on what you mean by "CH" and whether your binary values are signed or unsigned.
ZD with an F sign is equivalent to CH for positive values. If you want a sign of some kind, you need to indicate what you want the output values to look like.
For example, you could use the following to change unsigned BI values to various types of "CH" values:
| Code: |
INREC BUILD=(39,4,BI,TO=ZDF,LENGTH=10)
|
or
| Code: |
INREC BUILD=(39,4,BI,EDIT=(TTTTTTTTTT))
|
or
| Code: |
INREC BUILD=(39,4,BI,EDIT=(IIIIIIIIIT))
|
and so on.
You could use the following to change signed values to various types of "CH" values:
| Code: |
INREC BUILD=(39,4,FI,TO=FS)
|
or
| Code: |
INREC BUILD=(39,4,FI,EDIT=(STTTTTTTTTT),SIGNS=(+,-))
|
and so on.
What you would use exactly depends on exactly what you want the output values to look like. |
|