Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Binary to character

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
rarvins

Active User


Joined: 24 Jan 2007
Posts: 53
Location: India

PostPosted: Tue Oct 21, 2008 3:32 am    Post subject: Binary to character
Reply with quote

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
Back to top
View user's profile Send private message
References
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4684
Location: San Jose, CA

PostPosted: Tue Oct 21, 2008 4:22 am    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
rarvins

Active User


Joined: 24 Jan 2007
Posts: 53
Location: India

PostPosted: Wed Oct 22, 2008 8:34 pm    Post subject:
Reply with quote

Hi Frank, sorry for not providing the details. It is an unsigned binary and I wanted to convert it to Alphanumeric. The 2nd solution that you provided worked. Thanks a lot
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1