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 Char Conversion using Sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
subramanianup
Warnings : 1

New User


Joined: 18 May 2005
Posts: 46
Location: Bangalore, INDIA

PostPosted: Mon Feb 09, 2009 11:42 am    Post subject: Binary to Char Conversion using Sort
Reply with quote

Hi,

In Input File i have first 4 bytes as Binary field(That is Key filed in the File and it is unsigned filed) and Using Sort I need to Convert the 4 byte Binary filed to CHAR Field. Can someone help how to get solution for this?

Thanks,
Subramanian
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Feb 09, 2009 11:57 am    Post subject:
Reply with quote

Hello,

Please post a few sample input records and the output you want when these input records are processed. Mention how wide the output char field should be. Also mention the recfm and lrecl of the files.
Back to top
View user's profile Send private message
subramanianup
Warnings : 1

New User


Joined: 18 May 2005
Posts: 46
Location: Bangalore, INDIA

PostPosted: Mon Feb 09, 2009 2:16 pm    Post subject:
Reply with quote

Input Layout(When HEX On) Record Length is 80
2C4A TEXT1....
2E1A TEXT1....

Output Required Record Lengh is 80
11338
11802
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Feb 09, 2009 9:26 pm    Post subject:
Reply with quote

Hello,

Your input is length 4 and the output might be length 5 (as posted). Should the "text" be shifted to the right or remain as is?
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: Mon Feb 09, 2009 11:12 pm    Post subject:
Reply with quote

Subramanian,

2C4A is 2 bytes (X'2C4A'), not 4 bytes. If the input field is 2 bytes and you just want to display it as character (without the other fields in the record), you can use these DFSORT statements:

Code:

  OPTION COPY                                 
  INREC BUILD=(1,2,BI,EDIT=(TTTTT))           


If the input field is 4 bytes (e.g. X'00002C4A'), you can use:

Code:

  OPTION COPY                                 
  INREC BUILD=(1,4,BI,EDIT=(TTTTT))           


If that's not what you want, then you need to do a better job of explaining what you do want.
Back to top
View user's profile Send private message
subramanianup
Warnings : 1

New User


Joined: 18 May 2005
Posts: 46
Location: Bangalore, INDIA

PostPosted: Tue Feb 10, 2009 11:46 am    Post subject:
Reply with quote

Thanks Frank I got the expected Solution. It is working fine
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 resume binary ftp in z/os meykh2014 All Other Mainframe Topics 3 Sun Jan 22, 2017 10:01 am
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm


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