Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts the use of 'B3'x character in a panel Pedro TSO/ISPF 1 Thu Feb 16, 2017 3:09 am
No new posts resume binary ftp in z/os meykh2014 All Other Mainframe Topics 6 Sun Jan 22, 2017 10:01 am
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
No new posts Continuation Character ballaswaroop SYNCSORT 8 Thu Aug 25, 2016 4:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us