Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
View previous topic :: :: View next topic  
Author Message
rarvins

New User


Joined: 24 Jan 2007
Posts: 59
Location: Texas

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

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
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

New User


Joined: 24 Jan 2007
Posts: 59
Location: Texas

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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Splitting one row into multiple Rows ... Rajan Moorthy DFSORT/ICETOOL 9 Mon May 14, 2018 10:58 pm
No new posts Invalid XML character while producing... nikhil.bhole IBM Tools 4 Tue Mar 20, 2018 1:24 am
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us